<9. Advanced Engineering >
9.1.3 _RB and _BOOL Suffix Variables of Device Label
Variables
When a device label variable is defined, other variables with “_RB” and “_BOOL”
suffices may be automatically created.
The figure below shows examples of “_RB” and “_BOOL” variables created for each
device label variable.
Analog input AI001 : no “_RB” and “_BOOL” variable created
Analog output AO001 : AO001_RB
Digital input DI001 : DI001_BOOL
Digital output DO001 : DO001_BOOL, DO001_RB_BOOL, DO001_RB
To summarize, a “_BOOL” suffix variable is generated for the device label variable of
a digital input or digital output ,and a “_RB” suffix variable is generated for the
device label variable of an analog output or digital output .
● “_BOOL” Suffix Variable of Digital Input/Output
Device label variables for digital inputs and digital outputs have data types
DTag_I_Sts and DTag_O_Sts respectively. Both of these structure data type have
members named Status and Value.
However, as can be seen from the above figures, member Value of DTag_I_Sts and
DTag_O_Sts have WORD data type.
When accessing ON/OFF data of digital inputs or outputs in a control application,
conversion of Value into BOOL data type using the “WORD_TO_BOOL” data type
conversion function is necessary.
This conversion is automatically performed by the system, which stores the
converted result in the variable with “_BOOL” suffix.
Specifically, ON/OFF data is extracted from DI001, converted from WORD type to
BOOL type, and stored in DI001_BOOL.
The same applies to DO001.