EasyManuals Logo
Home>Beckhoff>I/O Systems>EtherCAT EL6022

Beckhoff EtherCAT EL6022 User Manual

Beckhoff EtherCAT EL6022
204 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #141 background imageLoading...
Page #141 background image
Commissioning
EL600x, EL602x 141Version: 4.6
References
www.beuth.de, IEC61162: based on NMEA2000
http://gpsinformation.net 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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Beckhoff EtherCAT EL6022 and is the answer not in the manual?

Beckhoff EtherCAT EL6022 Specifications

General IconGeneral
BrandBeckhoff
ModelEtherCAT EL6022
CategoryI/O Systems
LanguageEnglish

Related product manuals