(1)| 11/24/2010 3:22 PM | |
|
Posts: 18 Rating:
|
Hi Is there function to convert time and s5 times to real number or codes should be written? thanks |
| 11/25/2010 9:14 AM | |
|
Joined: 10/7/2005 Last visit: 12/19/2025 Posts: 3052 Rating:
|
Hello hextalker a TIME value is a simple DINTvalue in milliseconds, e.g. T#1m (TIME display format) = 60000 (DINT display format), so a simple DTR (DINT to REAL) conversion can be done on it to get a REAL value (in milliseconds). S5TIME formatted values are a bit different (they are dating back to S5 days and still areBCD basedand have additional time base bits in, see Step 7 help for more on its format if interested). Step 7 does however has FC33 (S5TI_TIM) in the IEC librarywhich converts an S5TIME formatted value into a TIME formatted (DINT) value (after which you can use the above described simple DTR). And just in case, FC40 (TIM_S5TI) in the IEC librarydoes the reverse of FC33. I hope this helps |
|
Cheers |
|
This contribution was helpful to
|
|
Follow us on