Data transfer via communication ports
772
Part III FP Instructions
Example
In this example the function has been programmed in ladder diagram (LD) and structured text (ST).
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
The system variable sys_bPulse1s is copied to bBool1 and Bool16_OverlappingDut_1.b0. If
bWrite1 and sys_bIsComPort1F145F146NotActive are set to TRUE, bBool1 is written to the
output Y38 of slave 2 via Bool16_OverlappingDut_1.b0.
LD
ST
When programming with structured text, enter the following:
bBool1 := sys_bPulse1s;
Bool16_OverlappingDut_1.b0 := bBool1;
if (bWrite1 and sys_bIsComPort1F145F146NotActive) then
F145_WRITE_DATA_TYPE_OFFS(Port := SYS_COM1_PORT,
SlaveAddress := 2,
MasterWordData :=
Bool16_OverlappingDut_1.w0,
SlaveWordAddressType := WY0,
SlaveWordAddressOffs := 3,
NumberOfWords_BitsInWords :=
16#8800);
bRead1 := true;
bWrite1 := false;
end_if;