Conversion to TOD-s7-300 SIEMENS

Neets

Member
Join Date
Jan 2013
Location
Pretoria
Posts
2
Hello

Could someone please help me with this query?

I need a TOD value to be written to an s7-300 PLC from a SCADA. I have already created a string in SCADA ( for example 16:45:00 in the format HH:MM:SS) and sent it to the PLC

In the PLC code, I split up the string into hours, minutes and seconds( HH-16, MM-45, SS-00). I then convert each of these to DINT format using FC37( string to double integer).

I know that the TOD data type is a 32 bit value in milliseconds. So then I calculate the millisecond value of the string by ( ((16*60*60)+(45*60)+0)*1000).

When I use the move operation to move this value to a TOD data format it gives me a monitored value of 1:45:00.000. When I monitor the TOD variable in TIME data format, it shows 12d1h45m0s. I do not require the time in milliseconds to be converted to days, which is the cause of the discrepancy. I just need it in HH:MM:SS which is the format of TOD.

Any help would be highly appreciated.
emotion-1.gif
 
Once you have values as 3 integers you can join them to TOD format using instruction below
L HH
L L#3600000
*D
T TOD_Value
L MM
L L#60000
*D
L TOD_Value
+D
T TOD_Value
L SS
L 1000
*D
L TOD_Value
+D
T TOD_Value
 

Similar Topics

I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
175
Currently I’m using ESA model VT155W0000 HMI and it’s communicate with Fanuc PLC. Can any one suggest can I convert ESA model to EXOR HMI eSMART07M
Replies
0
Views
80
hi... i have an issue in s7 300 plc, while we run the machine(in idle there is no fault) , plc cpu goes in SF mode, after restart the power cycle...
Replies
2
Views
107
I have a Type C to RS485 adapter connect to my Siemens RWF55. I use modscan to scan it to get a value from the Siemens controller. In the...
Replies
4
Views
95
Hi all, I'm in the process of upgrading a PanelView1200 HMI program to be developed in FactroyTalk View Studio. The filetype for PanelView 1200...
Replies
7
Views
274
Back
Top Bottom