Data transfer via communication ports
774
Part III FP Instructions
Example
In this example the function has been programmed in ladder diagram (LD) and structured text (ST).
GVL
In the global variable list you define variables that can be accessed by all POUs in the project.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
If bRead1 and sys_bIsComPort1F145F146NotActive are set to TRUE, the global variable
Slave2_g_bY38, which is assigned to Y38 of slave 2, is read and stored in bBool2.
LD
ST
When programming with structured text, enter the following:
if (bRead1 and sys_bIsComPort1F145F146NotActive) then
F146_READ_DATA(Port := SYS_COM1_PORT,
SlaveAddress := 2,
SlaveData := Slave2_g_bY38,
MasterData => bBool2);
bRead1 := false;
bWrite1 := true;
end_if;