Commissioning
EL600x, EL602x
143
Version: 4.6
Timeout:= T#1S,
DataReceived=> DataReceived,
busy=> ReceiveBusy,
Error=> ReceiveErrorID,
RxTimeout=> ReceiveTimeout );
IF DataReceived THEN
// DataReceived := FALSE;
ReceiveCounter := ReceiveC 1;
IF NOT ReceiveBusy THEN
// Compare checksum
nRxChecksum := aDataRX[nDataLen];
nCalcChecksum := F_CALC_LIN_CHKSUM(pData := ADR(aDataRX), nLen := nDataLen);
IF(nRxChecksum = nCalcChecksum) THEN
// Response received - clear databuffer:
memset(ADR(LastReceivedDataBytes[1]), 0, (SIZEOF(aDataRX)-1));
// Take-over data when checksum OK:
memcpy(ADR(LastReceivedDataBytes[1]), ADR(aDataRX), (nD1));
END_IF
nState := 0;
END_IF
ELSE
Timer(IN:=TRUE, PT:=T#0.1S); // Receive-Timeout 100 ms: no data
IF Timer.Q THEN
nState := 0;
END_IF
END_IF
END_CASE
(*==================================================================
*)
Program fast task / RS232 background communication
In this example, third task should be created with as few “cycle ticks” as possible, which deals with the
background communication with the EL6001 terminal (as master).
Declaration part:
PROGRAM FAST
VAR
(* background communication with the EL6001 as Master device *)
COMportControl_MASTER: SerialLineControl;
COMportControlError_MASTER: BOOL;
COMportControlErrorID_MASTER: ComError_t;
END_VAR
Execution part:
COMportControl_MASTER(
Mode:= SERIALLINEMODE_EL6_22B,
pComIn:= ADR(COMin_EL6001_MASTER),(* I/O data; see global variables *)
pComOut:= ADR(COMout_EL6001_MASTER),(* I/O data; see global variables *)
SizeComIn:= SIZEOF(COMin_EL6001_MASTER),(* I/O data; see global variables *)
TxBuffer:= TxBuffer_MASTER,(* transmit buffer; see global variables *)
RxBuffer:= RxBuffer_MASTER,(* receive buffer; see global variables *)
Error=> COMportControlError_MASTER,(* indicating an error *)
ErrorID=> COMportControlErrorID_MASTER );(* contains the error-ID *)
Содержание EtherCAT EL6001
Страница 1: ...Documentation EL600x EL602x Serial Interface Terminals 4 6 2018 09 24 Version Date...
Страница 2: ......
Страница 52: ...Mounting and Wiring EL600x EL602x 52 Version 4 6 Fig 40 Other installation positions...
Страница 84: ...Commissioning EL600x EL602x 84 Version 4 6 Fig 85 Incorrect driver settings for the Ethernet port...