Cicode Programming Reference > Cicode Function Categories > Miscellaneous Functions Introduction > Toggle

Toggle

Toggles a digital tag on or off. If the variable tag is ON (1), this function will turn it OFF. If the variable tag is OFF (0), this function will turn it ON.

Syntax

Toggle(sTag)

sTag:

The digital tag to toggle.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

Pulse

Example

Buttons

Text

Motor 145

Command

Toggle(M145)

Comment

Toggle the variable tag M145 (Motor 145) on or off

To toggle the Paging Alarm property:

Toggle(MyCluster.Alarm_1.Paging);

See Also

Miscellaneous Functions