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.
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.