Re: Use more then 1 varaible
Hi henri,
It does not work because your program does nothing if Var 2 or Var 3 changes value.
You have to take an approach like this (call a subrutine if one of the related variables changes, and in that subroutine you set the leds according to the states of these variables):
Code:
Var 2, Link FSUIPC_IN Offset $3340, Length 4
{
CALL &CtrlLeds
}
var 3, Link FSUIPC_IN offset $092C, length 2
{
CALL &CtrlLeds
}
var 4, link FSUIPC_IN offset $3344, length 4 // need this one also
{
CALL &CtrlLeds
}
Var 10 Link SUBRUTINE Name CtrlLeds
{
L0 = TESTBIT V2,14
if L0 = 0
{
&leds2 = 0
&leds3 = 0
}
else
{
L1 = TESTBIT V3,0
if L1 = 1
{
&Leds2 = 0
&leds3 = 0
}
else
{
&leds2 = 1
&leds3 = 1
// &leds4 = 1 not defined ?
}
}
}
var 5, name Leds2 link iocard_out, output 15
var 6, name Leds3 link iocard_out, output 13
And I think you have to take Var 4 into account as well (in the subroutine).
regards,
Nico
Re: Use more then 1 varaible
OK so that's how it works. Great and thanks for pointing the right direction.
regards,
Henri