Show/Hide Toolbars

Presse universelle MecaMotion par 

"Boolean ON/OFF" instruction

Instruction used in the part-program for "Set" or "Reset" (set to "1" or "0") a variable of type BOOL.

Programmation on off bit 2 english

Figure 1: ON/OFF Boolean programming window

Below is a list of the instruction's input and output parameters:

Parameter name


Type of data

Default value






Variable set to "1" or "0".





Setpoint for changing the status of the variable

Delay [ms]




Time before changing the state of the variable

Table 1: List of instruction parameters

The basic function of the instruction is to set a BOOL variable to "1" or "0" for an indefinite period of time. But you can also define a time during which the variable must remain at "1" or "0", at the end of this time, the variable will take the opposite state.

The time set in parameter is always rounded up or down to a multiple of 50[ms], depending on whether the value set in parameter is respectively greater than "n X 50[ms] + 25[ms]" or smaller than "n X 50[ms] + 25[ms]".



set time = 120[ms]


real time = 100[ms]


set time = 135[ms]


real time = 150[ms]

The set time can be given by a constant or user variable in "TIME" format.

ProgrammerONOFFBIT2 english

Figure 2: Programmation d'un temps avant la retombée du bit

In the example in figure 2, the time that will elapse before the variable "VarBool_num6" set to "0" will actually be 100[ms], not 86[ms] as set.


If you want to reverse the state of a Boolean variable after a time, simply select in the instruction the state that the variable will have before the instruction is executed and add a time in the delay parameter. The variable will then keep its current state until the time delay has elapsed, then it will take the opposite state.


We want to set the value of a Boolean to "1" after 100[ms].

Explication programmation On Off bit english
ProgrammerONOFFBIT3 english