Industry Online Support
Technical Forum
2/20/2012 9:29 AM | |
Posts: 6 Rating:
|
Dear fritz , i am replying to this old question, i came across same diffuculty. I need to use time in real time calculation. for that i need to convert TIME to REAL. As you have said TIME is stored in DINT format. Can i directly use VAR1(DINT) := VAR2(TIME) ?? I tried but it is giving me error. I even tried to use DINT_TO_REAL(VAR2(TIME)) This is also not working. Any other way ? I am working in SCL. Regards HBB |
Last edited by: O_Moderator at: 2/20/2012 12:34 PMnew subject after splitting from /tf/WW/de/Posts/51234#top |
|
This contribution was helpful to
2 thankful Users |
2/20/2012 5:31 PM | |
Joined: 1/28/2009 Last visit: 9/10/2024 Posts: 6849 Rating:
|
Dear HBB, Check this: [code]ORGANIZATION_BLOCK OB1 VAR_TEMP // Reserved info : ARRAY[0..19] OF BYTE; // Temporary Variables END_VAR // MD0 defined as TIME and MD4 as real in Symbol Table MD4:= ROUND(DINT_TO_REAL(TIME_TO_DINT(MD0))/1000.0) ; END_ORGANIZATION_BLOCK[/code] Best regards, Hamid Hosseini |
Last edited by: hdhosseini at: 2/20/2012 7:14 PM// note included |
|
This contribution was helpful to
2 thankful Users |
Follow us on