25 TYPE CONVERSION FUNCTIONS
25.67 Writing the Specified Bit of the Word Label
1889
25
Precautions
When using SET_BIT_OF_INT(_E) in ST, create a program which assigns the return value to a variable.
The return value of SET_BIT_OF_INT(_E) also works as input/output. Do not directly assign it to the input argument of
another instruction, function, or function block.
Operation error
There is no operation error.
By using the bit specification of labels, a concise program having the same operation as SET_BIT_OF_INT
can be created.
The following example changes the value in bit 5 (b5) of g_int1 to the value of g_bool1 the same as when
SET_BIT_OF_INT is used.
Ladder
ST
g_int1.5 := g_bool1;
FBD/LD
//The return value of SET_BIT_OF_INT is assigned to a variable and used.
g_int1 := SET_BIT_OF_INT(TRUE, 0);
g_bool1 := GET_BIT_OF_INT(g_int1, 0);
//In the following program, the value of the first argument of GET_BIT_OF_INT is undefined.
g_bool1 := GET_BIT_OF_INT( SET_BIT_OF_INT(TRUE, 0), 0);
Summary of Contents for MELSEC iQ-R Series
Page 1: ...MELSEC iQ R Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 24: ...22 INDEX 2092 INSTRUCTION INDEX 2093 REVISIONS 2104 WARRANTY 2105 TRADEMARKS 2106 ...
Page 34: ...32 MEMO ...
Page 35: ...33 PART 1 PART 1 OVERVIEW This part consists of the following chapter 1 OVERVIEW ...
Page 68: ...66 1 OVERVIEW 1 5 Precautions on Programming MEMO ...
Page 1448: ...1446 14 REDUNDANT SYSTEM INSTRUCTIONS 14 2 Disabling Enabling System Switching MEMO ...
Page 1972: ...1970 33 TIME DATA TYPE FUNCTIONS 33 4 Division MEMO ...
Page 2067: ...APPX Appendix 5 PID Control Program Examples 2065 A 252 Set PID control data for loop 2 ...
Page 2109: ......