Siemens 'SFB4: TON' in SCL

svoicum

Member
Join Date
Sep 2006
Location
Cluj
Posts
43
I want to use 'SFB4: TON' because I want the code to be self contained, I don't have to assign a timer in the symbol list. I want to use the 'SFB4: TON' as a STAT within the functon block. In this way I can use the complete FB where ever I want with only calling the FB with the correct parameters assigned. But I don't know how to do it. Please help me.
THX in advance
 
Here's an example of SCL calling SFB4 using two instances. Note that the output from SFB4 is referenced using SFB4Instance1.Q and SFB4Instance2.Q

Code:
FUNCTION_BLOCK FB9
VAR
SFB4Instance1:SFB4;
SFB4Instance2:SFB4;
END_VAR
SFB4Instance1(IN := M0.0,PT:=t#1s); 
SFB4Instance2(IN := M0.1,PT:=t#1s); 
M0.2:=SFB4Instance1.Q;
M0.3:=SFB4Instance2.Q;
END_FUNCTION_BLOCK

This code has been tested in the simulator.
 

Similar Topics

Hi, Is it possible to manipulate the standard SFB4-TON timer from Siemens in a VAT table? I need to do some qualification tests on a system with...
Replies
5
Views
4,569
I have modified an existing program on an S7-400 and download just the FC that had the change made to it while the PLC continued in RUN mode...
Replies
2
Views
1,549
Hi Guys, Please help on this: I called an SFB4 (TON)in a FB, Do you know how to calculate how much time left? On the picture, I want the...
Replies
6
Views
4,350
Hi I am trying out SCL and wish to use a stat SFB4 with a preset from a DB, Say Stuff, T1 where T1 is type TIME Compiles FUNCTION_BLOCK FB20...
Replies
2
Views
3,571
Hi I have used a lot of these in a multi instance function block for alarm debouncing. However if the customer does not wish to use a debounce, my...
Replies
3
Views
3,826
Back
Top Bottom