cgehlhausen
Member
Need to Jump to different Tasks, based on different Bits.
Need Logic like this in STL:
Tried all of these, none work:
Attempt 1
L B#16#0 // Clear Accumulator
A "Bit1" // Load Bit1
JN Task1 // Jump to Task1 if Not Zero
Attempt 2
L B#16#0 // Clear Accumulator
A "Bit1" // Load Bit1
L STW // Load Status Word to ACCU1
SRW // Shift Right Word
JN Task1 // Jump to Task1 if Not Zero
Attempt 3
L B#16#0 // Clear Accumulator
A "Bit1" // Load Bit1
L STW // Load Status Word to ACCU1
LAR1 // Load ACCU1 to ADDR REG1
SRW // Shift Right Word
JN Task1 // Jump to Task1 if Not Zero
Need Logic like this in STL:
If Bit1 = 1, Jump to Task1
If Bit2 = 1, Jump to Task2
If Bit3 = 1, Jump to Task3
If Bit4 = 1, Jump to Task4
Else Jump to END.
Simple task, but can't seem to get that into Siemens STL (S7). Trying to get the RLO to get Set!If Bit2 = 1, Jump to Task2
If Bit3 = 1, Jump to Task3
If Bit4 = 1, Jump to Task4
Else Jump to END.
Tried all of these, none work:
Attempt 1
L B#16#0 // Clear Accumulator
A "Bit1" // Load Bit1
JN Task1 // Jump to Task1 if Not Zero
Attempt 2
L B#16#0 // Clear Accumulator
A "Bit1" // Load Bit1
L STW // Load Status Word to ACCU1
SRW // Shift Right Word
JN Task1 // Jump to Task1 if Not Zero
Attempt 3
L B#16#0 // Clear Accumulator
A "Bit1" // Load Bit1
L STW // Load Status Word to ACCU1
LAR1 // Load ACCU1 to ADDR REG1
SRW // Shift Right Word
JN Task1 // Jump to Task1 if Not Zero