iwik
04-28-2013, 01:46 AM
Hi Guys,<br>
Having a problem with blanking a leading zero on a O/C Display II card. I've tried to follow Nico Howto which was very helpful.<br>
I have a four digit display for RPM and when below 1000rpm I want the leading zero supressed. I have run my code thru the IOconsole<br>
in SIOC and it seems to give me the correct values UNTILL I hit > 1000 or 2000 rpm. It then goes weird giving incorrect values.<br>
When operated with the hardware, Master card outputs and other Displays operate even though they are not configured in Sioc.<br>
Could someone please review my code and see where im wrong and correct if possible. My maths and programming skills are <br>
very basic and all help would be appreciated.<br>
Here is the code and thanks<br>
Les<br>
<br>
Var 6020, name rpm, Link FSUIPC_IN, Offset $0898, Length 2, Type 1<br>
{<br>
L0 = &rpm * 10800<br>
L1 = L0 / 65536<br>
L2 = MOD L1 10<br>
&Digitr = L2<br>
L2 = MOD L1 100<br>
&Digitl1 = L2<br>
<br>
L2 = MOD L1 1000<br>
&Digitl2 = L2<br>
<br>
L2 = Div L1 1000<br>
IF L2 < 1<br>
{<br>
&Digitl3 = -999999<br>
}<br>
ELSE<br>
{<br>
&Digitl3 = L2 <br>
}<br>
}<br>
<br>
<br>
Var 1, name Digitr Link IOCARD_DISPLAY, Digit 0, Numbers 1<br>
<br>
Var 2, name Digitl1 Link IOCARD_DISPLAY, Digit 1, Numbers 1<br>
Var 3, name digitl2 Link IOCARD_DISPLAY, Digit 2, Numbers 1<br>
Var 4, name Digitl3 Link IOCARD_DISPLAY, Digit 3, Numbers 1
Having a problem with blanking a leading zero on a O/C Display II card. I've tried to follow Nico Howto which was very helpful.<br>
I have a four digit display for RPM and when below 1000rpm I want the leading zero supressed. I have run my code thru the IOconsole<br>
in SIOC and it seems to give me the correct values UNTILL I hit > 1000 or 2000 rpm. It then goes weird giving incorrect values.<br>
When operated with the hardware, Master card outputs and other Displays operate even though they are not configured in Sioc.<br>
Could someone please review my code and see where im wrong and correct if possible. My maths and programming skills are <br>
very basic and all help would be appreciated.<br>
Here is the code and thanks<br>
Les<br>
<br>
Var 6020, name rpm, Link FSUIPC_IN, Offset $0898, Length 2, Type 1<br>
{<br>
L0 = &rpm * 10800<br>
L1 = L0 / 65536<br>
L2 = MOD L1 10<br>
&Digitr = L2<br>
L2 = MOD L1 100<br>
&Digitl1 = L2<br>
<br>
L2 = MOD L1 1000<br>
&Digitl2 = L2<br>
<br>
L2 = Div L1 1000<br>
IF L2 < 1<br>
{<br>
&Digitl3 = -999999<br>
}<br>
ELSE<br>
{<br>
&Digitl3 = L2 <br>
}<br>
}<br>
<br>
<br>
Var 1, name Digitr Link IOCARD_DISPLAY, Digit 0, Numbers 1<br>
<br>
Var 2, name Digitl1 Link IOCARD_DISPLAY, Digit 1, Numbers 1<br>
Var 3, name digitl2 Link IOCARD_DISPLAY, Digit 2, Numbers 1<br>
Var 4, name Digitl3 Link IOCARD_DISPLAY, Digit 3, Numbers 1