800xA AC800m PM856: time_to_string function does not work - It ignores the "formatstring" input?
The function time_to_string ignores the "formatstring" input and gives an output in the format of '1d1h3m5s23ms' regardless. What is going on?
https://i.imgur.com/ktQdCCb.jpg
https://i.imgur.com/ktQdCCb.jpg
Voted best answer
It is a bug in the Function Diagram Editor.
Try to use Structured Text or FBD instead for this, and refer the Product Bulletin: 3BSE081800D0051 Function Diagram: Always Default Format When Converting to String Variable
Name Format/Rule Parameter Default Value
date_and_time_to_string formatstring YYYY-MM-DD-HH:MI:SS.TTT
time_to_string formatstring DHMST
dint_to_string base 10 (decimal notation)
int_to_string base 10 (decimal notation)
uint_to_string base 10 (decimal notation)
Table1 System Functions always using default value of formatstring and base.
Try to use Structured Text or FBD instead for this, and refer the Product Bulletin: 3BSE081800D0051 Function Diagram: Always Default Format When Converting to String Variable
Name Format/Rule Parameter Default Value
date_and_time_to_string formatstring YYYY-MM-DD-HH:MI:SS.TTT
time_to_string formatstring DHMST
dint_to_string base 10 (decimal notation)
int_to_string base 10 (decimal notation)
uint_to_string base 10 (decimal notation)
Table1 System Functions always using default value of formatstring and base.
Add new comment