//采用gRCVReqUDPData数据发送
IF bReceiveReq AND NOT bSendActive AND NOT bReceiveActive THEN
retDint := _udpsend(
sourceport := 8192
,destinationaddress := gRemoteIPAddress
,destinationport := 4096
,communicationmode := DO_NOT_CLOSE_ON_EXIT
,datalength := 21
,data := gRCVReqUDPData
);
END_IF;
(*以下IF程序用于从PLC中接收数据*)
IF bReceiveActive AND NOT bSendActive AND NOT bReceivereq THEN
gRetValReceive :=_udpreceive(
port := 8192
,communicationmode := DO_NOT_CLOSE_ON_EXIT
,nextcommand := IMMEDIATELY
,receivevariable := gReceivedUDPData
);
END_IF;
问题如下:
,data := gRCVReqUDPData,是将data赋初值,
可receivevariable 是输出变量,要将接收到的数据传递出去,怎么也要初始化,给它个值?