BOOL_TO_STRING (Boolean to String)
Converts a boolean (BOOL) value into "TRUE" or "FALSE" and writes the result to the target STRING variable.
Description
BOOL_TO_STRING evaluates the boolean operand src (IN) and writes "TRUE" or "FALSE" to the target STRING variable for diagnostic logging or HMI status text.
Syntax
- variable_name: Target
STRINGvariable - qualifier: Typically
ActionQualifier.P(Pulse) - instruction:
ActionInstruction.BOOL_TO_STRING - src (
IN): SourceBOOLvariable or literal
Sequence Visual Editor
- Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
- Select Conversions -> BOOL_TO_STRING and choose the P qualifier.
- Fill in the target
STRINGvariable and the sourceBOOLoperand (IN).
Python
from automation_machine import ActionQualifier, ActionInstruction
step.add_action("safety_status_str", "Format safety state as text", qualifier=ActionQualifier.P, instruction=ActionInstruction.BOOL_TO_STRING, src="safety_ok")