PDA

View Full Version : FCU HDG TRK FPA LED BAR with a Displaycard and SIOC Script



tcane
03-21-2015, 09:00 AM
Hi JL,
Now here is the continuation of the discussion. :)


Iīm done with your steps and changed all this things that you had written.

Itīs look like this now:


Var 51, name LVLCH_LED, Link IOCARD_OUT, Device 20, Output 105
{
IF &LVLCH_LED = 0
{
&LVLCH_BAR_ONE = 0
}
ELSE
{
&LVLCH_BAR_ONE = 8
}
}


Var 52, name HDG_LED, Link IOCARD_OUT, Device 20, Output 103
{
IF &HDG_LED = 0
{
&HDG_BAR = 0
}
ELSE
{
&HDG_BAR = 8
}
}


Var 53, name TK_LED, Link IOCARD_OUT, Device 20, Output 104
{
IF &TK_LED = 0
{
&TK_BAR = 0
}
ELSE
{
&TK_BAR = 8
}
}


Var 55, name SPD_LED, Link IOCARD_OUT, Device 20, Output 100
{
IF &SPD_LED = 0
{
&SPD_BAR = 0
}
ELSE
{
&SPD_BAR = 8
}
}


Var 56, name MACH_LED, Link IOCARD_OUT, Device 20, Output 101
{
IF &MACH_LED = 0
{
&MACH_BAR = 0
}
ELSE
{
&MACH_BAR = 8
}
}

Var 60, name HDGVS_LED, Link IOCARD_OUT, Device 20, Output 106
{
IF &HDGVS_LED = 0
{
&HDGVS_BAR = 0
}
ELSE
{
&HDGVS_BAR = 8
}
}


Var 61, name TKFPA_LED, Link IOCARD_OUT, Device 20, Output 107
{
IF &TKFPA_LED = 0
{
&TKFPA_BAR = 0
}
ELSE
{
&TKFPA_BAR = 8
}
}


Var 62, name ALTman_LED, Link IOCARD_OUT, Device 1, Output 90


Var 63, name VS_LED, Link IOCARD_OUT, Device 20, Output 108
{
IF &VS_LED = 0
{
&VS_BAR = 0
}
ELSE
{
&VS_BAR = 8
}
}


Var 64, name FPA_LED, Link IOCARD_OUT, Device 20, Output 109
{
IF &FPA_LED = 0
{
&FPA_BAR = 0
}
ELSE
{
&FPA_BAR = 8
}
}


(on the END of the Script)





Var 1000, name LVLCH_BAR_ONE, Link IOCARD_DISPLAY, Device 1, Digit 65, Numbers 1


Var 1001, name HDG_BAR, Link IOCARD_DISPLAY, Device 1, Digit 79, Numbers 1


Var 1002, name TK_BAR, Link IOCARD_DISPLAY, Device 1, Digit 64, Numbers 1


Var 1003, name SPD_BAR, Link IOCARD_DISPLAY, Device 1, Digit 77, Numbers 1


Var 1004, name MACH_BAR, Link IOCARD_DISPLAY, Device 1, Digit 78, Numbers 1


Var 1005, name HDGVS_BAR, Link IOCARD_DISPLAY, Device 1, Digit 66, Numbers 1


Var 1006, name TKFPA_BAR, Link IOCARD_DISPLAY, Device 1, Digit 67, Numbers 1


Var 1007, name VS_BAR, Link IOCARD_DISPLAY, Device 1, Digit 70, Numbers 1


Var 1008, name FPA_BAR, Link IOCARD_DISPLAY, Device 1, Digit 71, Numbers 1


Var 1009, name LVLCH_BAR_TWO, Link IOCARD_DISPLAY, Device 1, Digit 68, Numbers 1


Var 1010, name LVLCH_BAR_THREE, Link IOCARD_DISPLAY, Device 1, Digit 69, Numbers 1





Compiled to the ssi. And start your Software for a Test.
Yeah the LED-BARS goes on... but ALL LED Bars and for example when i push the SPD/Mach Button only the SPD BAR turns a bit off... On the other bars are general no changes :sad: I can explane this in a short Video if you like?!
When i start the SIOC-Monitor and send (for Example) to Display DIGIT Position 77 (SPD Bar) a Number "8" only the SPD BAR goes on. All the same with the other LED BARīs. So it think there are no fault in wiring. I can control all individually.
Maybe there missing a addition in the Script that says: If a LED off, turn off/blank the corresponding Display Output?

Also a second one:
i have 3 IOCARD_DISPlay Outputs for the LVL/CH (LVLCH_BAR_ONE,LVLCH_BAR_TWO, LVLCH_BAR_THREE), how can I link to one IOCard Output (LVLCH_LED) in the script?


Again,
Big thanks for your nice support!
And king regards

Florian

jeehell
03-21-2015, 09:40 AM
yes a video would help.

For the LVLCH_BAR_TWO and LVLCH_BAR_THREE do that:


Var 1000, name LVLCH_BAR_ONE, Link IOCARD_DISPLAY, Device 1, Digit 65, Numbers 1
{
&LVLCH_BAR_TWO = &LVLCH_BAR_ONE
&LVLCH_BAR_THREE = &LVLCH_BAR_ONE
}

...
Var 1009, name LVLCH_BAR_TWO, Link IOCARD_DISPLAY, Device 1, Digit 68, Numbers 2
Var 1010, name LVLCH_BAR_THREE, Link IOCARD_DISPLAY, Device 1, Digit 69, Numbers 1

tcane
03-21-2015, 10:09 AM
Hi,
ah Ok thanks for the addition in the Script! ;)

Here is the Video what happens when i started your software and like to change something.

https://youtu.be/I4VbbFSQf6g

And here you can see that i can controll each individual LED bar.

https://youtu.be/16Pk0pNOTG4

tcane
03-21-2015, 01:16 PM
I think in the Script be missing a command to "blank" the Display?!
Maybe something like this? http://www.lekseecon.nl/howto.html#digit You must scroll down to: "Suppress (blank) leading zeroes in a display"
But i have no idea how to integrate it correctly.

King Regards
Florian

tcane
03-21-2015, 01:18 PM
Mhm maybe like this? :roll:

Var 51, name LVLCH_LED, Link IOCARD_OUT, Device 20, Output 105
{
IF &LVLCH_LED = 0
{
&LVLCH_BAR_ONE = -999999
}
ELSE
{
&LVLCH_BAR_ONE = 8
}
}

tcane
03-21-2015, 01:54 PM
YES!
IT WORKS! :!::D:idea:

https://youtu.be/lL135XdPEdE

My last post with the -999999 was the missing respectively changed value.

Again a big thank you for your help and support JL! My next beer I drink to you!

jeehell
03-21-2015, 02:35 PM
Ah yes well done, of course "0" displays a 0, and does not turn off the dislay...

Cheers,
JL

vagelisdrivas
12-28-2015, 06:15 PM
Dear Flortian,
This is my code for the fcu which works well
// **********************
// * FCU *
// **********************
// *VAR RANGE 200 -299 *
// **********************


// *****************
// ******SPEED******
// *****************


Var 0200, name spd_mach_sw, Link IOCARD_SW, Input 151, Type I
{
&spd_mach_tr = 16 * &spd_mach_sw
}


Var 0201, name spd_mach_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0202, name spd_pul_sw, Link IOCARD_SW, Input 162, Type I
{
&spd_pul_tr = 1 * &spd_pul_sw
}


Var 0203, name spd_pus_sw, Link IOCARD_SW, Input 164, Type I
{
&spd_pus_tr = 2 * &spd_pus_sw
}


Var 0204, name spd_pul_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0205, name spd_pus_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0206, name spd_rot, Link IOCARD_ENCODER, Input 156, Aceleration 2, Type 2
{
IF &spd_rot = 1
{
&spd_change1 = 1
&spd_change2 = &spd_val + 1
&spd_change1 = DELAY 0 ,10
}
IF &spd_rot = -1
{
&spd_change1 = 1
&spd_change2 = &spd_val - 1
&spd_change1 = DELAY 0 ,10
}
}


Var 0207, name spd_val, Link FSUIPC_IN, Offset $73C1, Length 2
{
CALL &spd_disp
}


Var 0208, name spd_led_1, Link IOCARD_DISPLAY, Digit 160, Numbers 1


Var 0209, name spd_led_2, Link IOCARD_DISPLAY, Digit 162, Numbers 1


Var 0210, name spd_led_3, Link IOCARD_DISPLAY, Digit 161, Numbers 1


Var 0211, name spd_led_dot, Link IOCARD_OUT, Output 173


Var 0212, name spd_disp, Link SUBRUTINE
{
if &spd_val = 64538
{
&spd_led_1 = -999999
&spd_led_2 = -999999
&spd_led_3 = -999999
}
else
{
IF &spd_val >= 100
{
IF &spd_val = 64537
{
&spd_led_dot = 0
&spd_led_1 = -999998
&spd_led_2 = -999998
&spd_led_3 = -999998
}
ELSE
{
&spd_led_dot = 0
&spd_led_1 = DIV &spd_val ,100
L0 = MOD &spd_val ,100
L0 = DIV L0 ,10
&spd_led_2 = L0
&spd_led_3 = MOD &spd_val ,10
}
}
ELSE
{
&spd_led_dot = 1
&spd_led_1 = 0
&spd_led_2 = DIV &spd_val ,10
&spd_led_3 = MOD &spd_val ,10
}
}
}


Var 0213, name spd_sgn, Link IOCARD_OUT, Output 166


Var 0214, name mach_sgn, Link IOCARD_OUT, Output 160


Var 0215, name spd_change1, Link FSUIPC_OUT, Offset $73CC, Length 1


Var 0216, name spd_change2, Link FSUIPC_OUT, Offset $73CD, Length 2


Var 0217, name man_spd_dot, Link IOCARD_OUT, Output 169


Var 0218, name man_spd_read, Link FSUIPC_IN, Offset $7391, Length 1
{
&man_spd_dot = TESTBIT &man_spd_read ,0
}


Var 0219, name mach_spd_read, Link FSUIPC_IN, Offset $7390, Length 1
{
L0 = TESTBIT &mach_spd_read ,7
IF L0 = 0
{
&spd_sgn = 1
&mach_sgn = 0
}
ELSE
{
&spd_sgn = 0
&mach_sgn = 1
}
}


// *****************
// *****HEADING*****
// *****************


Var 0220, name trk_fpa_sw, Link IOCARD_SW, Input 146, Type I
{
&trk_fpa_tr = &trk_fpa_sw * 15
IF &trk_fpa_sw = 1
{
IF &vs_fpa_st = 0
{
&vs_fpa_st = 1
}
ELSE
{
&vs_fpa_st = 0
}
CALL &vs_disp
}
}


Var 0221, name trk_fpa_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0222, name hdg_pul_sw, Link IOCARD_SW, Input 165, Type I
{
&hdg_p_p_tr = &hdg_pul_sw * 3
}


Var 0223, name hdg_pus_sw, Link IOCARD_SW, Input 153, Type I
{
&hdg_p_p_tr = &hdg_pus_sw * 4
}


Var 0224, name hdg_p_p_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0225, name hdg_rot, Link IOCARD_ENCODER, Input 154, Aceleration 2, Type 2
{
IF &hdg_rot = 1
{
&hdg_change1 = 2
&hdg_change2 = &hdg_val + 1
&hdg_change1 = DELAY 0 ,10
}
IF &hdg_rot = -1
{
&hdg_change1 = 2
&hdg_change2 = &hdg_val - 1
&hdg_change1 = DELAY 0 ,10
}
}


Var 0226, name hdg_change1, Link FSUIPC_OUT, Offset $73CC, Length 1


Var 0227, name hdg_change2, Link FSUIPC_OUT, Offset $73CD, Length 2


Var 0228, name hdg_val, Link FSUIPC_INOUT, Offset $73C3, Length 2
{
CALL &hdg_disp
}


Var 0229, name hdg_led_1, Link IOCARD_DISPLAY, Digit 163, Numbers 1


Var 0230, name hdg_led_2, Link IOCARD_DISPLAY, Digit 164, Numbers 1


Var 0231, name hdg_led_3, Link IOCARD_DISPLAY, Digit 165, Numbers 1


Var 0232, name hdg_disp, Link SUBRUTINE
{
IF &hdg_val = 64537
{
&hdg_led_1 = -999998
&hdg_led_2 = -999998
&hdg_led_3 = -999998
}
ELSE
{
if &hdg_val = 64538
{
&hdg_led_1 = -999999
&hdg_led_2 = -999999
&hdg_led_3 = -999999
}
else
{
&hdg_led_1 = DIV &hdg_val ,100
L0 = MOD &hdg_val ,100
&hdg_led_2 = DIV L0 ,10
&hdg_led_3 = MOD &hdg_val ,10
}
}
}


Var 0233, name man_hdg_dot, Link IOCARD_OUT, Output 175


Var 0234, name man_hdg_read, Link FSUIPC_IN, Offset $7391, Length 1
{
&man_hdg_dot = TESTBIT &man_hdg_read ,1
}


Var 0235, name hdg_fpa_read, Link FSUIPC_IN, Offset $7390, Length 1
{
L0 = TESTBIT &hdg_fpa_read ,6
IF L0 = 0
{
&hdg_sgn = 1
&hdg_vs_sgn_1 = 1
&hdg_vs_sgn_2 = 1
&vs_sgn = 1
&trk_sgn = 0
&trk_fpa_sgn_1 = 0
&trk_fpa_sgn_2 = 0
&fpa_sgn = 0
}
ELSE
{
&hdg_sgn = 0
&hdg_vs_sgn_1 = 0
&hdg_vs_sgn_2 = 0
&vs_sgn = 0
&trk_sgn = 1
&trk_fpa_sgn_1 = 1
&trk_fpa_sgn_2 = 1
&fpa_sgn = 1
}
}


Var 0236, name hdg_sgn, Link IOCARD_OUT, Output 164


Var 0237, name trk_sgn, Link IOCARD_OUT, Output 162


Var 0238, name lat_sgn, Link IOCARD_OUT, Output 168 // SSSSSSOOOOOOSSSS


Var 0239, name hdg_vs_sgn_1, Link IOCARD_OUT, Output 144


Var 0240, name hdg_vs_sgn_2, Link IOCARD_OUT, Output 146


Var 0241, name trk_fpa_sgn_1, Link IOCARD_OUT, Output 140


Var 0242, name trk_fpa_sgn_2, Link IOCARD_OUT, Output 142


Var 0243, name vs_sgn, Link IOCARD_OUT, Output 150


Var 0244, name fpa_sgn, Link IOCARD_OUT, Output 148


Var 0245, name metric_sw, Link IOCARD_SW, Input 286, Type I
{
&metric_tr = &metric_sw * 17
}


// *****************
// ****ALTIMETER****
// *****************


Var 0246, name metric_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0247, name alt_pul_sw, Link IOCARD_SW, Input 167, Type I
{
&alt_p_p_tr = &alt_pul_sw * 5
}


Var 0248, name alt_pus_sw, Link IOCARD_SW, Input 170, Type I
{
&alt_p_p_tr = &alt_pus_sw * 6
}


Var 0249, name alt_p_p_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0250, name alt_rot, Link IOCARD_ENCODER, Input 158, Aceleration 2, Type 2
{
IF &alt_rot = 1
{
&alt_change1 = 3
&alt_change2 = &alt_val + 1
&alt_change1 = DELAY 0 ,10
}
IF &alt_rot = -1
{
&alt_change1 = 3
&alt_change2 = &alt_val - 1
&alt_change1 = DELAY 0 ,10
}
}


Var 0251, name alt_change1, Link FSUIPC_OUT, Offset $73CC, Length 1


Var 0252, name alt_change2, Link FSUIPC_OUT, Offset $73CD, Length 2


Var 0253, name alt_val, Link FSUIPC_IN, Offset $73C5, Length 2
{
if &alt_val = 64538
{
&alt_led = -999999
}
else
{
&alt_led = &alt_val * 100
}
}


Var 0254, name man_alt_dot, Link IOCARD_OUT, Output 171


Var 0255, name man_alt_read, Link FSUIPC_IN, Offset $7391, Length 1
{
&man_alt_dot = TESTBIT &man_alt_read ,2
}


Var 0256, name alt_led, Link IOCARD_DISPLAY, Digit 166, Numbers 5


Var 0257, name alt_sgn_1, Link IOCARD_OUT, Output 152 // sssssoooooooooooosssssssssss


Var 0258, name alt_sgn_2, Link IOCARD_OUT, Output 154 // sssssoooooooooooosssssssssss


Var 0259, name alt_sgn_3, Link IOCARD_OUT, Output 158 // sssssoooooooooooosssssssssss


Var 0260, name alt_sgn_4, Link IOCARD_OUT, Output 170 // sssssoooooooooooosssssssssss


Var 0261, name vs_pul_sw, Link IOCARD_SW, Input 167, Type I
{
&vs_p_p_tr = &vs_pul_sw * 7
}


Var 0262, name vs_pus_sw, Link IOCARD_SW, Input 170, Type I
{
&vs_p_p_tr = &vs_pus_sw * 8
}


Var 0263, name vs_p_p_tr, Link FSUIPC_OUT, Offset $78EB, Length 1


Var 0264, name vs_rot, Link IOCARD_ENCODER, Input 160, Aceleration 2, Type 2
{
IF &vs_rot = 1
{
&vs_change1 = 4
&vs_change2 = &vs_val + 1
&vs_change1 = DELAY 0 ,10
}
IF &alt_rot = -1
{
&vs_change1 = 4
&vs_change2 = &vs_val - 1
&vs_change1 = DELAY 0 ,10
}
}


Var 0265, name vs_change1, Link FSUIPC_OUT, Offset $73CC, Length 1


Var 0266, name vs_change2, Link FSUIPC_OUT, Offset $73CD, Length 2


Var 0267, name vs_val, Link FSUIPC_INOUT, Offset $73C7, Length 1
{
CALL &vs_disp
}


Var 0268, name vs_disp, Link SUBRUTINE
{
if &vs_val = 246
{
&vs_led_1 = -999999
&vs_led_2 = -999999
&vs_led_3 = -999999
&vs_led_4 = -999999
&vs_led_5 = -999999
&vs_led_dot = 0
}
else
{
IF &vs_val = 129
{
&vs_led_1 = -999998
&vs_led_2 = -999998
&vs_led_3 = -999998
&vs_led_4 = -999998
&vs_led_5 = -999998
&vs_led_dot = 0
}
ELSE
{
IF &vs_fpa_st = 0
{
&vs_led_dot = 0
IF &vs_val < 0
{
&vs_led_1 = -999998
}
ELSE
{
&vs_led_1 = -999999
}
L0 = &vs_val * 100
IF L0 = 0
{
&vs_led_2 = -999999
&vs_led_3 = -999999
&vs_led_4 = -999999
&vs_led_5 = 0
}
IF L0 < 1000
{
IF L0 > 0
{
&vs_led_2 = -999999
&vs_led_3 = DIV L0 ,100
L1 = MOD L0 ,100
&vs_led_4 = DIV L1 ,10
&vs_led_5 = MOD L1 ,10
}
}
IF L0 >= 1000
{
&vs_led_2 = DIV L0 ,1000
L1 = MOD L0 ,1000
&vs_led_3 = DIV L1 ,100
L2 = MOD L1 ,100
&vs_led_4 = DIV L2 ,10
&vs_led_5 = MOD L2 ,10
}
}
ELSE
{
&vs_led_dot = 1
&vs_led_1 = -999999
&vs_led_2 = -999999
&vs_led_3 = -999999
&vs_led_4 = DIV L0 ,10
&vs_led_5 = MOD L0 ,10
}
}
}
}


Var 0269, name vs_led_1, Link IOCARD_DISPLAY, Digit 171, Numbers 1


Var 0270, name vs_led_2, Link IOCARD_DISPLAY, Digit 172, Numbers 1


Var 0271, name vs_led_3, Link IOCARD_DISPLAY, Digit 173, Numbers 1


Var 0272, name vs_led_4, Link IOCARD_DISPLAY, Digit 174, Numbers 1


Var 0273, name vs_led_5, Link IOCARD_DISPLAY, Digit 175, Numbers 1


Var 0274, name vs_led_dot, Link IOCARD_OUT, Output 165


Var 0275, name vs_fpa_st, Value 0

If you need any help please let me know
Regards
Vagelis