INT to S5T in LADDER

gripster

Member
Join Date
Dec 2010
Location
Londinium
Posts
40
Really struggling to convert a variable INT to a TYPE accepted by an S7 timer.

Int is 0-255
Variable on -(SE)-
S5T#5s

Is there a simple way to convert the incoming INT to a TYPE acceptable to the above timer?
The -(SE)- wont accept MD MW or INT in LADDER.
DO I have to use a different extended pulse timer
What is the TYPE to use
This should be a really simple thing to do but am struggling in S7 :unsure:
 
Forget old S5 timers and go to IEC timers (SFB3, SFB4 and SFB5), time is esier to adjust with them and timers are not limited by plc type.
(You only need to know, that siemens IEC timers don't like of timesetting 0ms, timer never times/ output never goes to "1" state with timesetting 0ms)

But if you wan't to use s5timers, then you need to keep in mind, that s5time is two parts, timebase and number

bits 12-15 are timebase and number 0-999 is time setting.

http://www.plctalk.net/qanda/showthread.php?t=8237
http://www.plctalk.net/qanda/showthread.php?t=34319
http://www.plctalk.net/qanda/showthread.php?t=34319


You can use also FC40 to convert to s5time, but input is dint
http://www.plctalk.net/qanda/showthread.php?t=30956
 
Last edited:
Thanks for the feedback, I need to use the S7Timers for consistency my problem was finding the correct data types to use as they were global variables.
Gonna try with using local in the block so I can use TIME, and an FC40 but twitchy now about the updating the FB and DB live
 
Well that was a fail!
Tried, but had a problem with updating the FB and DB (probably the way in which I was uploading) but the main issue is creating the word in ladder to use on the timer.
I found a post on here where it had been done but was in German and I was unable to see the Variable types used or the Blocks used.
Any further posts I can look at that are coded in Ladder I am struggling to translate the mnemonic posts

Cheers
 
Since you are programming an FB with associated DB (instance DB), I am guessing you are programming a reusable block.
Basically, S5Timers are not suited to reusable programming. Forget going that way !

I need to use the S7Timers for consistency
No, you must either drop programming reusable code, or drop using the S5Timers.
NB. "I need xxxx for consistency". That is a handy phrase. I have to write that down. Useful in any situation. Scott Adams would be proud.

Gonna try with using local in the block so I can use TIME, and an FC40.
Not sure what you are doing with the TIM_S5TI block, but I think you are headed down a dead end.
 
Last edited:
Since you are programming an FB with associated DB (instance DB), I am guessing you are programming a reusable block.
Just adding an extra timer to an existing block, the Blocks are used for different locations
Basically, S5Timers are not suited to reusable programming. Forget going that way !
So I am learning!!

NB. "I need xxxx for consistency". That is a handy phrase. I have to write that down. Useful in any situation. Scott Adams would be proud.
All the other timers used have been S5Timers, its just a variable pulse I need so not wanting to add a single IEC timer when all the others used in the Prog were S5

Not sure what you are doing with the TIM_S5TI block, but I think you are headed down a dead end.

I think I have managed it with a couple of standard FBs (INT operations) and the FC40. Providing the INT comes through ok on OPC!!
Will prob need to bracket the incoming value for peace of mind though.

Mr Larson is a bit Blue Collar for me! I'm more your brown overalls type of guy:beer:

Thanks to everyone who took the trouble to respond, I learnt a far more than I expected.
 

Similar Topics

Is there a way to convert an INT value into a Timer value? I'd like to have the time always be in 0.1 seconds. So if I have a INT value of 500...
Replies
5
Views
3,483
We are having issues with our viewpoint server randomly crashing and only loading the error page if anything at all. It lives on 3 servers all of...
Replies
0
Views
33
Good morning, I have a question regarding some point I/O modules. We use 1734-IE2V modules to measure the tension of a fiber, but we have quite a...
Replies
2
Views
79
Will someone please convert this logic to pdf?
Replies
2
Views
152
Anyone have access to Melsec Medoc plus 2.31a that can either open a file (.pcd zipped in link below) and send a PDF/screenshot of the ladder, or...
Replies
10
Views
403
Back
Top Bottom