OC Elec Panel

Taurus
Posts: 19
Joined: 09 Jan 2017, 00:06

OC Elec Panel

Postby Taurus » 11 Jan 2017, 21:55

Hi Guys

Been working on this for quite a long time with no joy, I am attempting to get the elec panel to work, this is an OC panel connected with OC display card.

Set out below is the SIOC code I have for the panel, the panel works but the displays are in reverse????

Var 1305, name ACVOLT, static, Link IOCARD_DISPLAY, Device 2, Digit 9, Numbers 3 // Elec panel down right
{
IF &ACVOLT = -1
{
V1315 = -999999
}
ELSE
{
V1315 = &ACVOLT
}
}

Var 1306, name ACAMP, static, Link IOCARD_DISPLAY, Device 2, Digit 7, Numbers 2 // Elec panel down center
{
IF &ACAMP = -1
{
V1316 = -999999
}
ELSE
{
V1316 = &ACAMP
}
}

Var 1307, name DCVOLT, static, Link IOCARD_DISPLAY, Device 2, Digit 5, Numbers 2 // Elec panel down left
{
IF &DCVOLT = -1
{
V1317 = -999999
}
ELSE
{
V1317 = &DCVOLT
}
}

Var 1308, name CPSFREQ, static, Link IOCARD_DISPLAY, Device 2, Digit 2, Numbers 3 // Elec panel upper right
{
IF &CPSFREQ = -1
{
V1318 = -999999
}
ELSE
{
V1318 = &CPSFREQ
}
}

Var 1309, name DCAMP, static, Link IOCARD_DISPLAY, Device 2, Digit 0, Numbers 2 // Elec panel upper left
{
IF &DCAMP = -1
{
V1319 = -999999
}
ELSE
{
V1319 = &DCAMP
}
}


Var 1315, Link IOCARD_DISPLAY, Device 2, Digit 9, Numbers 3 // Elec panel down right

Var 1316, static, Link IOCARD_DISPLAY, Device 2, Digit 7, Numbers 2 // Elec panel down center

Var 1317, static, Link IOCARD_DISPLAY, Device 2, Digit 5, Numbers 2 // Elec panel down left

Var 1318, static, Link IOCARD_DISPLAY, Device 2, Digit 2, Numbers 3 // Elec panel upper right

Var 1319, static, Link IOCARD_DISPLAY, Device 2, Digit 0, Numbers 2 // Elec panel upper left


This is what is in my Prosim config under numerical is set up using the Variables 1305 to 1309.

To try explain it better this is what shows on my prosim panel:

15 399

24 75 115


This is what shows on my actual elec display:

51 993

42 57 511

Hope this makes sense.

Best Regards

belgianguy
Posts: 2521
Joined: 29 May 2011, 20:45
Location: Belgium

Re: OC Elec Panel

Postby belgianguy » 12 Jan 2017, 11:48

Hi,

First of all, you use to many code, but this has nothing to do with your problem.
With these lines of code, your displays will work too, no need to add extra lines of code:

Var 1305, name ACVOLT, static, Link IOCARD_DISPLAY, Device 2, Digit 9, Numbers 3 // Elec panel down right
{
IF &ACVOLT = -1
{
&ACVOLT = -999999
}
}

Var 1306, name ACAMP, static, Link IOCARD_DISPLAY, Device 2, Digit 7, Numbers 2 // Elec panel down center
{
IF &ACAMP = -1
{
&ACAMP = -999999
}
}

Var 1307, name DCVOLT, static, Link IOCARD_DISPLAY, Device 2, Digit 5, Numbers 2 // Elec panel down left
{
IF &DCVOLT = -1
{
&DCVOLT = -999999
}
}

Var 1308, name CPSFREQ, static, Link IOCARD_DISPLAY, Device 2, Digit 2, Numbers 3 // Elec panel upper right
{
IF &CPSFREQ = -1
{
&CPSFREQ = -999999
}
}

Var 1309, name DCAMP, static, Link IOCARD_DISPLAY, Device 2, Digit 0, Numbers 2 // Elec panel upper left
{
IF &DCAMP = -1
{
&DCAMP = -999999
}
}



Now concerning your problem. I had the same problem in the past and only because I followed the manual of Opencockpits :)
If I remember well, the problem is situated in the connections between the electrical panel and J7 on your display card.

It's been a whike since I mounted my display, but I think that I swapped all my connections for each group, so for example the DCAMP group, here you will have 2 wires that go to J7. You need to swap both wires for a correct display and you should do the same for each group. So you keep using the same pins for each group, but you need to change the order.

Maybe someone else can confirm this, because as said before, it's been a few years since I mounted this panel.
Best Regards,
Gert

Taurus
Posts: 19
Joined: 09 Jan 2017, 00:06

Re: OC Elec Panel

Postby Taurus » 12 Jan 2017, 15:23

Hi Gert

Thank you so much for your reply and your lesson in SIOC, it is very much appreciated. :D

I have my panel wired using a 40 pin IDC connector.

I will reconfigure the pin wiring and post back when complete.

Thanks again.

Best regards.

Taurus
Posts: 19
Joined: 09 Jan 2017, 00:06

Re: OC Elec Panel

Postby Taurus » 12 Jan 2017, 19:13

Hello Gert

I have now removed the 40 pin IDC connector and replaced it with single connectors onto the 40 way ribbon cable, only connecting the 12 pins required for the electrical panel.

I had to move around the connectors until the configuration was correct and displayed the correct digits.

All is working as it should now, thank you so very much for your information.

The only thing that is showing now is zeros in all segments when only one zero shows on the prosim OH panel, but I can live with that.

Thanks again.

Best regards

Sammy

belgianguy
Posts: 2521
Joined: 29 May 2011, 20:45
Location: Belgium

Re: OC Elec Panel

Postby belgianguy » 13 Jan 2017, 10:23

Glad I could help ;)
Best Regards,
Gert

zillmer
Posts: 15
Joined: 09 Oct 2016, 21:48

Re: OC Elec Panel

Postby zillmer » 17 Jan 2017, 21:36

Hi,

This may be a little late but I am posting the SIOC code that I have developed for the electrical panel. It is a bit more complicated than Gert has suggested, but it does address a few of the issues mentioned:

(i) Each digit on the display is individually addressed so you don't need to rewire your electrics ; or perhaps can revert back to simple ribbon cable.

(ii) The code suppresses leading zeroes when the reading is a single digit.

(iii) The code also displays a negative value (up to -9) in the DC Amps display when the battery is discharging. In the Prosim window this can be up to around -30 but most panels only have 2 7-segment displays available for the DC Amps so -9 is the max that can be displayed.

I've attached it as a file as it is quite long.The first lines link to your specific device so will you will need to update the Device Number and Digits to match your setup. You'll also need to ensure the variable numbers don't clash with anything else in your code ; I'm pretty sure I've used variables names throughout the code so you should only need to change the variable number at the beginning of each line.

Hope this might be of some help to you or others.

regards

Simon.
Attachments
elecdisp.txt
(5.06 KiB) Downloaded 18 times

Taurus
Posts: 19
Joined: 09 Jan 2017, 00:06

Re: OC Elec Panel

Postby Taurus » 19 Jan 2017, 17:21

Thank you so much Simon, very much appreciated.

Regards

Sammy


Return to “Opencockpits”

Who is online

Users browsing this forum: No registered users and 2 guests