How can I pass a 'timer' into an FB in Step 7?

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,

I have an FB that I've created that uses a timer. At the moment I've just given it an address (T 71) but I'd like to be able to pass that value into the block in order to make the block 'reusable'. In other words, is there a way of passing a value into the block through the Variable Declaration Table that the block can then use as a timer.?

I can't see anything resembling this in the 'data types' but I wondered if you can pass a number as an integer and then do some clever-stuff in the FB to make it into a timer designation??

Any ideas? Or do S5Timers have to be directly addressed??

Many thanks

;-)
 
S5 timers can be added as IN-parameter only.
Ie you assign a timer to the variable when you call the block and inside the FB you can use it as #Timer for example.
 
That's working a treat now (once I'd figured out to look in the 'Multiple Instances' folder for the STAT timer).

Many thanks to LD, Peter, Turpo and Jeebs for your (always) excellent help.

;-))
 

Similar Topics

Hello, I am still new to PLC programming and I just got this job two year out of school so I don’t remember much. I was given a task were I have...
Replies
1
Views
182
So I'm having issues with a certain rung and one of my coworkers mentioned it may not allow the signal past the latch coil. For example in the...
Replies
27
Views
3,762
I’m a bit stuck on HMI (KTP-1200) programming… See the picture attached. The PASS or FAIL box should only appear when the toggle switch is...
Replies
7
Views
1,091
I've been given a line that has several sysmac c200Hx PLCs. The First station Im trying to wrap my head around has a NS8 HMI. I'm using Cx-one...
Replies
2
Views
753
See image below. Look at line 95. I tested all data type, but none of them works. https://ibb.co/H2Csr15 See this. TEMPDATA2 is used only...
Replies
3
Views
2,711
Back
Top Bottom