Hi,
Can anyone tell me why if I have e.g. DB1.DBW0 on the OUT variable #MobileLocation it will on the rising edge of #startlocation count up 1 then on the next rising edge not count at all and on the next rising edge count up 2.
If I replace DB1.DBW0 with MW1000 it works fine (counts up 1 on each rising edge)
Also if I change #MobileLocation to IN/OUT DB1.DBW0 works fine?
I'm testing this using PLCSim
Thanks in advance!
Can anyone tell me why if I have e.g. DB1.DBW0 on the OUT variable #MobileLocation it will on the rising edge of #startlocation count up 1 then on the next rising edge not count at all and on the next rising edge count up 2.
If I replace DB1.DBW0 with MW1000 it works fine (counts up 1 on each rising edge)
Also if I change #MobileLocation to IN/OUT DB1.DBW0 works fine?
I'm testing this using PLCSim
Thanks in advance!
Code:
FUNCTION FC 500 : VOID
TITLE =Setup Mobile Location and Number
VERSION : 0.1
VAR_INPUT
MobileNumber : INT ;
StartLocation : BOOL ;
END_VAR
VAR_OUTPUT
MobileLocation : WORD ;
END_VAR
VAR_IN_OUT
LocationEstablished : BOOL ;
END_VAR
VAR_TEMP
DiPointer : DINT ;
Limit : INT ;
END_VAR
BEGIN
NETWORK
TITLE =
A #StartLocation;
AN #LocationEstablished;
JCN m010;
L DB241.DBW 0;
L 1;
+I ;
T DB241.DBW 0;
T #MobileLocation;
m010: NOP 0;
NETWORK
TITLE =Location Established OK To Next Plant
A #StartLocation;
= #LocationEstablished;
NETWORK
TITLE =
SET ;
SAVE ;
END_FUNCTION