Commissioning
EL600x, EL602x
141
Version: 4.6
References
•
•
private, via NMEA, many formats:
http://www.gpsinformation.org/dale/
nmea.htm
http://www.nmea.de/nmea0183datensaetze.html
•
http://www.meinberg.de/german/info/irig.htm
, IRIG codes
5.8.3
Sample program 3 (LIN)
Download (TwinCAT 3 example program):
https://infosys.beckhoff.com/content/1033/el600x_el602x/Resources/zip/1805853195.zip
Global variables for LIN master example program
VAR_GLOBAL
nSetBaudrate : UINT := 10417; // Für Rx-Delay-Berechnung
(* I/O variables for EL6001 terminal acting as Master*)
COMin_EL6001_MASTER AT %I* : EL6inData22B;(* linked to the EL6001 in the TwinCAT System Manager *)
COMout_EL6001_MASTER AT %Q*: EL6outData22B;(* linked to the EL6001 in the TwinCAT System Manager *)
RxBuffer_MASTER : ComBuffer;(* Receive data buffer; used with all receive function blocks *)
TxBuffer_MASTER : ComBuffer;(* Transmit data buffer; used with all receive function blocks *)
END_VAR
Data types for LIN master-slave example program
TYPE tDataFrame : ARRAY[0..8] OF BYTE; END_TYPE // Datentyp für ein LIN-Frame
Function for adding data length information and parity bits:
Declaration part:
FUNCTION F_ADD_LIN_NODE_PARITY : BYTE
VAR_INPUT
nNodeID:BYTE; // Inputvariable: node-Id
nReqLen:BYTE; // Inputvariable: length-identification: 2,4,8 Byte-Frame
END_VAR
VAR
bParity0:BYTE; // Internal intermediate value parity 0
bParity1:BYTE; // Internal intermediate value parity 1
nPrepId:BYTE; // Intermediate value for PID
END_VAR
Execution part:
nPrepId := nNodeID OR SHL(nReqLen,4);
bParity0 :=
(nNodeID AND 2#0001)
XOR (SHR((nNodeID AND 2#0010), 1))
XOR (SHR((nNodeID AND 2#0100), 2))
XOR (SHR((nNodeID AND 2#0001_0000), 4));
bParity1 := 16#01 AND (NOT(
SHR((nNodeID AND 2#0010), 1)
XOR (SHR((nNodeID AND 2#1000),3))
XOR (SHR((nNodeID AND 2#0001_0000), 4))
XOR (SHR((nNodeID AND 2#0010_0000), 5))));
F_ADD_LIN_NODE_PARITY := nPrepId OR SHL(bParity0,6) OR SHL(bParity1,7);
Function for calculating the checksum (conventional method)
Declaration part:
FUNCTION F_CALC_LIN_CHKSUM : BYTE
VAR_INPUT
pData:POINTER TO ARRAY[0..10] OF BYTE; // Pointer to source datafield
nLen:BYTE; // Number of bytes used for calculating the checksum
END_VAR
VAR
Содержание 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...