Chapter 8 Logic Instructions
8-27
FB/FC
FC
Exchange is used for the data exchange.
Parameters
Meaning
Description Valid range
In1
Input Data to exchange
Depends on the data type of the variable
that the input parameter is connected to.
In2
Input Data to exchange
Depends on the data type of the variable
that the input parameter is connected to.
Boolean
Bit string Integer
Real
number
Time, date
String
DT
In1
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
In2
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data
type.
Function Explanation
The Exchange instruction exchanges the values of In1 and In2.
Precautions for Correct Use
The data types of In1 and In2 must be same.
The instruction has no output but two input parameters.
Programming Example
The variable table and program
1
Exchange
EN ENO
In1
In2
Exchg_EN
Exchg_In1
Exchg_In2