Umwandlung vom Typ BOOL in einen beliebigen anderen Typ:
Bei Zahlentypen ist das Ergebnis 1, wenn der Operand TRUE ist, und 0, wenn der Operand FALSE ist.
Für den Typ STRING ist das Ergebnis 'TRUE' oder 'FALSE'.
Beispiele in ST:
(* Result is 1 *) i:=BOOL_TO_INT(TRUE); (* Result is "TRUE" *) str:=BOOL_TO_STRING(TRUE); (* Result is T#1ms *) t:=BOOL_TO_TIME(TRUE); (* Result is TOD#00:00:00.001 *) tof:=BOOL_TO_TOD(TRUE); (* Result is D#1970 *) dat:=BOOL_TO_DATE(FALSE); (* Result is DT#1970-01-01-00:00:01 *) dandt:=BOOL_TO_DT(TRUE);
Beispiele im FBD:
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|