Write direct output flag
This instruction writes the value of an output flag (Y) using a direct execution command. The Output_Y will be written asynchronously within the current PLC cycle.
Input
Value written directly to Output_Y
Output
Global variable with FP address or explicit user address to be written directly.
FP0H, FP-XH only: Valid range for FP address is Y0–Y109F to which a real output pin is assigned. Otherwise the PLC goes into operation error.
FP_DIRECT_OUTPUT (when using FP7)
In the global variable list you define variables that can be accessed by all POUs in the project.
All input and output variables used for programming this function have been declared in the POU header.The same POU header is used for all programming languages.
VAR
bWriteOutput: BOOL:=FALSE;
END_VAR
When the variable bWriteOutput is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_CONTACT,,bWriteOutput,5,1,7,3,);
B(B_F,E_FP_DIRECT_OUT!,,15,0,24,4,,?DEN?DValue?AENO?COutput_Y);
B(B_VARIN,,bValue,13,2,15,4,);
B(B_VAROUT,,g_bDirectOut_Y1,24,2,26,4,);
L(1,0,1,5);
L(1,2,5,2);
L(7,2,15,2);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if (bWriteOutput) then
g_bDirectOut_Y1:=FP_DIRECT_OUT(bValue);
end_if;