Time string to double integer

doannhat0507

Member
Join Date
Nov 2010
Location
ho chi minh city
Posts
22
Hi All,
Now i get a problem about converting from Time string to double integer. I used FC37 to convert it but after converting it, DINT value got value 0. (variable: "M_Start_Timestamp" to "M_Start_Timestamp_DINT")
Can somebody help me about that?
stringtodint.jpg

p/s: i'm using Simatic S7300 for programming.
Thanks All!!!
 
fc37 is string conversion. Time is not a string datatype. It is Time datatype or S5Time datatype.

You can use instruction T_Conv to convert from Time datatype to Int datatype. Then convert from Int to Dint if you need.
 
TIME is in the same format as DINT, in ms resolution. So you can just move the TIME into a DINT using a MOVE instruction.
 
Gotya,

Now I understand why the T_Conv was mentioned. Your string is similar to a DT (date and time) format.

How are you expecting the DINT?

I think you will have to extract every part (Y-M-D-etc) from your string.
 

Similar Topics

Hi I want add a double quote in a string without using the function StringChar(34). Is it possible? I have dozens of strings to be sent to an...
Replies
2
Views
7,113
All, I am trying to reset timers when a Work Order change occurs. The Work Order comes in as a string and I am comparing it to a tag...
Replies
2
Views
98
Hello, I am using studio 5000 pro and am trying to figure out the structured text. Here's my scenario: An operator scans a barcode, the barcode...
Replies
15
Views
288
I am creating a global object in FTView SE 13. I want to have a string read from the PLC and display (in this case the tagname). So lets say...
Replies
4
Views
195
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
448
Back
Top Bottom