Hi,
I'm programming a piece of software to scan the inputs of the PLC.
But i got a problem... First the code:
A #START_TEL <-- Enable BIT to start the LOOP
JC LP
JU END
LP: L P#1.7 <-- OFFSET start counting at ADRESS 1.7 (I 1.7)
T MD 205 <-- The problem (but it only works with a MD)
L 16 <- Scan for 1 word 16bits
NEXT: T #T_MEM1 <-- LOOP
A I [MD 205] <-- Check input
AN #B_MEM1 <- BLOCK when i see a input
JC WRT
JU EXT
WRT: S #B_MEM1 <-- Set BLOCK
L #T_MEM1 <-- LOAD LOOP COUNT
T #OUTPUT <-- TRANSFER the loop count into VAR
EXT: NOP 0
L MD 205
L P#0.1
-D (min 0.1)
T MD 205
L #T_MEM1
LOOP NEXT (LOOP not ended? goto....)
END: NOP 0 (END LOOP)
R #B_MEM1 (Reset BIT mem)
Whats the problem? I want to:
T MD 205 <-- The problem
Transfer that into a local var example: #A_NAME
Like:
L P#1.7
T #A_NAME
L 16 <- Scan for 1 word 16bits
NEXT: T #T_MEM1 <-- LOOP
A I [#A_NAME] <-- Check input
AN #B_MEM1 <- BLOCK when i see a input
But that doesn't work
Ps. #A_NAME = a DWORD
Can some one help me? I want to use a local input to give my function a variable adress.
Thank you!
Best regards Rob
I'm programming a piece of software to scan the inputs of the PLC.
But i got a problem... First the code:
A #START_TEL <-- Enable BIT to start the LOOP
JC LP
JU END
LP: L P#1.7 <-- OFFSET start counting at ADRESS 1.7 (I 1.7)
T MD 205 <-- The problem (but it only works with a MD)
L 16 <- Scan for 1 word 16bits
NEXT: T #T_MEM1 <-- LOOP
A I [MD 205] <-- Check input
AN #B_MEM1 <- BLOCK when i see a input
JC WRT
JU EXT
WRT: S #B_MEM1 <-- Set BLOCK
L #T_MEM1 <-- LOAD LOOP COUNT
T #OUTPUT <-- TRANSFER the loop count into VAR
EXT: NOP 0
L MD 205
L P#0.1
-D (min 0.1)
T MD 205
L #T_MEM1
LOOP NEXT (LOOP not ended? goto....)
END: NOP 0 (END LOOP)
R #B_MEM1 (Reset BIT mem)
Whats the problem? I want to:
T MD 205 <-- The problem
Transfer that into a local var example: #A_NAME
Like:
L P#1.7
T #A_NAME
L 16 <- Scan for 1 word 16bits
NEXT: T #T_MEM1 <-- LOOP
A I [#A_NAME] <-- Check input
AN #B_MEM1 <- BLOCK when i see a input
But that doesn't work
Ps. #A_NAME = a DWORD
Can some one help me? I want to use a local input to give my function a variable adress.
Thank you!
Best regards Rob