STL - Boolean pointer looping

davidsk2001

Member
Join Date
Jun 2006
Location
Bukit Mertajam
Posts
8
Hi all, i'm working with STL code following case.

STL will continuously loop to check the condition of an array of boolean (Array[0..99] of Boolean). It will detect boolean is ON or OFF only. If condition is ON, then run a timer; if condition is OFF, then loop the pointer.

1. How do I check boolean value with pointer?
2. How do I restart pointer once it reach 99?

Thank you so much for helping me out
 
Siemens Step 7.

I had manage to get this. But I can't get access status from my array of boolean.
L P#DBX 0.0
LAR1

L MW 2 //Check pointer below 100
L 100
>=I
JC ST02


A [AR1,P#0.0]
L S5T#2S
SD T 1
JNB ST01

A T 1
JNB ST02
L MW 2
L 1
+I
T MW 2
+AR1

ST01: L MW 2
L 1
+I
T MW 2
+AR1

ST02: NOP 0
 
Step 7 is just the brand name for the Siemens PLC programming package. It comes in two flavors: V13/TIA Portal or v5.5/Simatic Manager.

Sorry. it is simatic manager V5.5.

i don't know the answer,only question

if the few bool [ ] is ON what happen to the timer ON

If few bool[] is on, then it will run the delay timer and jump next bool[n+1] once delay timer is reach.

if bool[] is off, then it will skip the delay timer and jump next bool[n+1]
 
If few bool[] is on, then it will run the delay timer and jump next bool[n+1] once delay timer is reach.

if bool[] is off, then it will skip the delay timer and jump next bool[n+1]

You need to be more specific - what exactly is a "few"?
 
if bool [3] is ON and bool[4] is ON and bool[6] is ON timer starting/complete ,then jump to bool[5] and bool[7] ?

what will happen if previous bool repeat the process ?

what source triggering the bool ,are the triggering step by step or randomly.
 
if bool [3] is ON and bool[4] is ON and bool[6] is ON timer starting/complete ,then jump to bool[5] and bool[7] ?

what will happen if previous bool repeat the process ?

what source triggering the bool ,are the triggering step by step or randomly.

For example:
bool[3] is ON, bool[4] is ON, bool[5] is OFF.

when detect bool[0] = OFF, pointer will go to bool[1] without delay timer.

it will run until bool[3] where is ON. then bool[3] will wait for delay timer to complete and go to bool[4]. bool[4] = ON, then it will also wait for delay timer to complete and go to bool[5]. bool[5] = OFF, then skip delay timer and go to bool[6] and go on.

it will keep on looping the array until bool[] go OFF.

The source trigger the bool will be trigger randomly by external code.
 
Last edited:
You need to be more specific - what exactly is a "few"?

For example:
bool[3] is ON, bool[4] is ON, bool[5] is OFF.

when detect bool[0] = OFF, pointer will go to bool[1] without delay timer.

it will run until bool[3] where is ON. then bool[3] will wait for delay timer to complete and go to bool[4]. bool[4] = ON, then it will also wait for delay timer to complete and go to bool[5]. bool[5] = OFF, then skip delay timer and go to bool[6] and go on.

it will keep on looping the array until bool[] go OFF.
 
Code your application completely for 3 bools, and post the code as an archived library. We can then see how to expand it for 100 bools
 
For example:
bool[3] is ON, bool[4] is ON, bool[5] is OFF.

when detect bool[0] = OFF, pointer will go to bool[1] without delay timer.

it will run until bool[3] where is ON. then bool[3] will wait for delay timer to complete and go to bool[4]. bool[4] = ON, then it will also wait for delay timer to complete and go to bool[5]. bool[5] = OFF, then skip delay timer and go to bool[6] and go on.

it will keep on looping the array until bool[] go OFF.


What about drawing a good, old flowchart? With a pencil.

Kalle
 
What about drawing a good, old flowchart? With a pencil.

Kalle

Thank for the suggestion. Hereby I attach the flow chart for the whole idea. Hope everyone can understand for more.

2zxz6o1.jpg
 

Similar Topics

Hello, I am new to PLC programming. I have a very basic doubt about STL programming. As per Siemens manual 'Statement List (STL) for S7-300 and...
Replies
1
Views
2,314
i am new to simatic manager and i am trying to figure what this part do in the code : A I 5.6 = DB50.DBX 4.6...
Replies
3
Views
136
Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
210
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
324
First off thank you in advance. Second I am very new to STL. I am trying to build a counter that has one count up and 23 count down options. Am...
Replies
6
Views
380
Back
Top Bottom