AndyCYXU
10-11-2015, 08:33 PM
Hi so I made a simple sioc code to display my clock using 7segment displays and Displays2 card from Opencockpits, but I have little problem...
Here is the code:
// ---------------------- CLOCK ----------------
Var 9014, name Local_Year_Dis, Link IOCARD_DISPLAY, Device 31, Digit 3, Numbers 4
Var 9006, name Zulu_Day_Hour, Link IOCARD_DISPLAY, Device 31, Digit 9, Numbers 2
Var 9007, name Zulu_Day_Min, Link IOCARD_DISPLAY, Device 31, Digit 7, Numbers 2
Var 9008, name Local_Day_Hour, Link IOCARD_DISPLAY, Device 31, Digit 5, Numbers 2
Var 9009, name Local_Day_Min, Link IOCARD_DISPLAY, Device 31, Digit 3, Numbers 2
Var 9001, name Zulu_Hour, link FSUIPC_INOUT, offset $023B, length 1
{
CALL &Show_Display
}
Var 9002, name Zulu_Minute, link FSUIPC_INOUT, offset $023C, length 1
{
CALL &Show_Display
}
Var 9003, name Local_Hour, link FSUIPC_INOUT, offset $0238, length 1
{
CALL &Show_Display
}
Var 9004, name Local_Minute, link FSUIPC_INOUT, offset $0239, length 1
{
CALL &Show_Display
}
Var 9010, name Local_Month, link FSUIPC_INOUT, offset $0244, length 1
{
CALL &Show_Display
}
Var 9011, name Local_Day, link FSUIPC_INOUT, offset $023D, length 1
{
CALL &Show_Display
}
Var 9013, name Local_Year, link FSUIPC_INOUT, offset $024A, length 2
{
CALL &Show_Display
}
Var 9012, name TIME, Link IOCARD_SW, Device 31, Input 40
{
CALL &Show_Display
}
Var 9005, name Show_Display, Link SUBRUTINE
{
IF &TIME = 0
{
&Zulu_Day_Hour = &Zulu_Hour
&Zulu_Day_Min = &Zulu_Minute
&Local_Day_Hour = &Local_Hour
&Local_Day_Min = &Local_Minute
}
IF &TIME = 1
{
&Zulu_Day_Hour = &Local_Month
&Zulu_Day_Min = &Local_Day
&Local_Year_Dis = &Local_Year
}
}
Basically clocks displays in upper display ZULU Time in lower Display it shows LOCAL Time, when I press a Momentary switch Upper display shows Month/Day
Lower display shows year
now when i release the button Upper display nicely returns to show ZULU time when lower displays is stuck on showing the year
when one minute elapses MINUTE digits on lower display will change to show Local minutes
when hour elapses HOUR digits will change also on lower display to show Local hours
... so ... how can i make it speed up so that IDK.. sioc of FSUIPC gets the value updated quicker for the Local Time
I suspect there is a problem with declaration on top where i declare Var 9014 uses digits from var 9008 and 9009 so somehow i have to force SIOC or FSUIPC to somehow check for updated value for Var 9008 and 9009 quicker ...
well i hope I'm explaing myself correctly
Any help is appriciated
Andy
https://www.facebook.com/photo.php?fbid=10206177440292541&set=p.10206177440292541&type=3&theater
Here is the code:
// ---------------------- CLOCK ----------------
Var 9014, name Local_Year_Dis, Link IOCARD_DISPLAY, Device 31, Digit 3, Numbers 4
Var 9006, name Zulu_Day_Hour, Link IOCARD_DISPLAY, Device 31, Digit 9, Numbers 2
Var 9007, name Zulu_Day_Min, Link IOCARD_DISPLAY, Device 31, Digit 7, Numbers 2
Var 9008, name Local_Day_Hour, Link IOCARD_DISPLAY, Device 31, Digit 5, Numbers 2
Var 9009, name Local_Day_Min, Link IOCARD_DISPLAY, Device 31, Digit 3, Numbers 2
Var 9001, name Zulu_Hour, link FSUIPC_INOUT, offset $023B, length 1
{
CALL &Show_Display
}
Var 9002, name Zulu_Minute, link FSUIPC_INOUT, offset $023C, length 1
{
CALL &Show_Display
}
Var 9003, name Local_Hour, link FSUIPC_INOUT, offset $0238, length 1
{
CALL &Show_Display
}
Var 9004, name Local_Minute, link FSUIPC_INOUT, offset $0239, length 1
{
CALL &Show_Display
}
Var 9010, name Local_Month, link FSUIPC_INOUT, offset $0244, length 1
{
CALL &Show_Display
}
Var 9011, name Local_Day, link FSUIPC_INOUT, offset $023D, length 1
{
CALL &Show_Display
}
Var 9013, name Local_Year, link FSUIPC_INOUT, offset $024A, length 2
{
CALL &Show_Display
}
Var 9012, name TIME, Link IOCARD_SW, Device 31, Input 40
{
CALL &Show_Display
}
Var 9005, name Show_Display, Link SUBRUTINE
{
IF &TIME = 0
{
&Zulu_Day_Hour = &Zulu_Hour
&Zulu_Day_Min = &Zulu_Minute
&Local_Day_Hour = &Local_Hour
&Local_Day_Min = &Local_Minute
}
IF &TIME = 1
{
&Zulu_Day_Hour = &Local_Month
&Zulu_Day_Min = &Local_Day
&Local_Year_Dis = &Local_Year
}
}
Basically clocks displays in upper display ZULU Time in lower Display it shows LOCAL Time, when I press a Momentary switch Upper display shows Month/Day
Lower display shows year
now when i release the button Upper display nicely returns to show ZULU time when lower displays is stuck on showing the year
when one minute elapses MINUTE digits on lower display will change to show Local minutes
when hour elapses HOUR digits will change also on lower display to show Local hours
... so ... how can i make it speed up so that IDK.. sioc of FSUIPC gets the value updated quicker for the Local Time
I suspect there is a problem with declaration on top where i declare Var 9014 uses digits from var 9008 and 9009 so somehow i have to force SIOC or FSUIPC to somehow check for updated value for Var 9008 and 9009 quicker ...
well i hope I'm explaing myself correctly
Any help is appriciated
Andy
https://www.facebook.com/photo.php?fbid=10206177440292541&set=p.10206177440292541&type=3&theater