Siemens STL programming

AlecTek

Member
Join Date
Sep 2010
Location
Vancouver
Posts
155
O #A1
ON #A2
= L 0
T #Time1
T #Time2
T #Time3
NOP 0


Can someone tell me how to program this in STL(the above program is wrong):
A1,2: bool; Time1,2,3: integer

if (A1 and not A2) then Time1,2,3 = 0 end if
 
O #A1
ON #A2
= L 0
T #Time1
T #Time2
T #Time3
NOP 0


Can someone tell me how to program this in STL(the above program is wrong):
A1,2: bool; Time1,2,3: integer

if (A1 and not A2) then Time1,2,3 = 0 end if


Are you trying to stop, reset or preset the timers with 0?

If you could describe what the boleans and timers are supposed to do - including the timer start - it would be easier for us to help you.

If you program your code in LAD first, Step7 can convert it to STL and you'll get a clue how it should look like.

Kalle


EDIT: Pherhaps this is what you ask for:

O A1
ON A2
JCN L001
L 0
T TIME1
: aso
L001: NOP 0
 
Last edited:
Thank you, Kalle. I just want to assign 0 to three integer variables. I used Step 7 to convert the LAD, but it seems a mess. I am hoping someone can teach me how to program stl.
 
O #A1
ON #A2
JC SET
BEU
SET: L 0
T #Time1
T #Time2
T #Time3

I should add that the BEU is just an example, I don't know if you would want to continue in the block or not, the common way would be to have the condition NOT to load the zero and just jump over the transfer section if that NOT condition is true.
 
Last edited:
O #A1
ON #A2
JC SET
BEU
SET: L 0
T #Time1
T #Time2
T #Time3

I should add that the BEU is just an example, I don't know if you would want to continue in the block or not, the common way would be to have the condition NOT to load the zero and just jump over the transfer section if that NOT condition is true.


Hi Peter, Thanks a lot!

Do you mean the common way should be like this:


AN #A1
A #A2
JC somewhere
L 0
T #Time1
T #Time2
T #Time3
somewhere: ....
 
Thank you!

I have another question which is in a new post, please tell me if it is possible.

Best regards.

Siemens Basic Question? on WinCC Flexible SCL
Hi all, I was told that I can not program winCC Flexible 2008 in SCL, but today I just saw a Function Block which is created in SCL but unfortunately it is locked so I cannot open the source. If anyone knows how to program in SCL please help.
 

Similar Topics

Hello everyone, I have been attempting to complete a simple weight conversion program... basically it loads in 3 values from a BCD Thumbwheel...
Replies
3
Views
2,972
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
667
I'm having trouble trying to convert this code to ladder, anyone able to help me? A M4.0 A M4.1 A M117.0 AN M17.7 A ( A I38.6 AN I3.7 O ( A M4.5...
Replies
8
Views
1,206
Hello, I am still new to STL. But from what I understand is the JC mnemonic should jump if RLO = 1. If we review both pictures the M0bf RLO = 1...
Replies
5
Views
1,051
Hello, I am working on a project to upgrade some old S5-100U processors. The programs are all uploaded and I don't have descriptors...ugh. Be that...
Replies
4
Views
1,163
Back
Top Bottom