Siemens S7 TIME data type - extract mins/secs.

rtgibson

Member
Join Date
May 2012
Location
Barnsley
Posts
44
Hi all - got an S7 classic Step 7 program. I have a variable that's a TIME data type it contains a value such as T#1h30m5s - how can I extract each of those values (hours/mins/secs) into separate integers ?

Thanks in advance.
 
The TIME data type is really a DINT in ms (milliseconds)...

So you if you take the DINT and divide by 1000 you have total seconds.
Take that result and DIV by 60 and you have minutes, MOD (this instruction gives the remainder) the same result by 60 and you get seconds.
 

Similar Topics

This feels like a simple, elementary question, but I am a Siemens novice and know there are experts here. My S7-1500 project (TIA Portal v17) has...
Replies
10
Views
2,678
Is it possible to make I/O filed on HMI of POINTER data type? Pointer data type can be either temp, IN or IN_OUT variable inside FB. it would be...
Replies
1
Views
1,764
Hi, 1)I configure : a)AI point address as PIW 1 b)AO point address as PQW 1 Are the "PIW" and "PQW" assignment correct? 2)What Data Type are...
Replies
13
Views
7,427
Dear Experts, Please, kindly guide me through how to read data from ABB PLC to S7-1200 Siemens PLC. I want to use Siemens S7-1200 PLC to read data...
Replies
1
Views
442
Looking for options to write data to Siemens PLC. Looking for something closest to way we were doing it with AB PLC and excel sheet. Old way...
Replies
7
Views
887
Back
Top Bottom