DeviceNet communication
EL6752
30
Version: 2.1
5.2
Explicit messages
Program example „ExplMessageEditor“:
https://infosys.beckhoff.com/content/1033/el6752/Resources/
With the following ADS commands you can use EL6752 to send explicit messages.
GET_ATTRIBUTE_SINGLE via ADSRead Data Transfer
SET_ATTRIBUTE_SINGLE via ADSWrite Data Transfer
COMMON SERVICE via ADSReadWrite Data Transfer
For the ADS NetID and the port, the values from the system manager are to be used.
(*
GET_ATTRIBUTE_SINGLE via ADSRead Data Transfer
IDXGRP: Index GroupNumber = Object Class
IDXOFFS: Index OffsetNumber = (Object Instance *. 0x100) + Attribute Id
LEN: Read Data Lengths in Bytes
DESTADDR: Address of DataBuffer to read with the Get-Attribute Single Service
*)
fbADSRead(
NETID:= ADSNetId,
PORT:= ADSPort,
IDXGRP:= IGrp_ADSRead,
IDXOFFS:= IOff_ADSRead,
LEN:= ADSReadLen,
DESTADDR:= ADR(GetAttributeData[0]),
READ:= ADSReadCommand,
TMOUT:= T#5s,
BUSY=> ADSReadBusy,
ERR=> ADSReadErr,
ERRID=> ADSReadErrID);
(*
COMMON SERVICE via ADSReadWrite Data Transfer
IDXGRP: Index GroupNumber = Object Class
IDXOFFS: Index OffsetNumber = (Object Instance *. 0x100) + Service Id
WRITELEN: Write Data Lengths in Bytes
READLEN: Read Data Lengths in Bytes
SRCADDR: Address of DataBuffer to write
DESTADDR: Address of DataBuffer to read
*)
fbADSReadWrite(
NETID:= ADSNetId,
PORT:= ADSPort,
IDXGRP:= Grp_ADSReadWrite,
IDXOFFS:= IOff_ADSReadWrite,
WRITELEN:= ADSReadWriteWriteLen,
READLEN:= ADSReadWriteReadLen,
SRCADDR:= ADR(CommonServiceWriteData[0]),
DESTADDR:= ADR(CommonServiceReadData[0]),
WRTRD:= ADSReadWriteCommand,
TMOUT:= T#5s,
BUSY=> ADSReadWriteBusy,
ERR=> ADSReadWriteErr,
ERRID=> ADSReadWriteErrID);
and
(*
SET_ATTRIBUTE_SINGLE via ADSWrite Data Transfer
IDXGRP: Index GroupNumber = Object Class
IDXOFFS: Index OffsetNumber = (Object Instance *. 0x100) + Attribute Id
LEN: Write Data Lengths in Bytes
SRCADDR: Address of DataBuffer to write with the Set-Attribute Single Service
*)
fbADSWrite(
NETID:= ADSNetId,
PORT:= ADSPort,
IDXGRP:= IGrp_ADSWrite,