Download  Print this page

Using Fbusio_sendmsg - Epson RC620 Manual

Robot controller option, fieldbus i/o.
Hide thumbs


3.3 Using FbusIO_SendMsg

To use FbusIO_SendMsg, install the Fieldbus master board.
FbusIO_SendMsg is used to send an explicit message to a device and return a reply. This
command operates according to the protocol.
The syntax is as follows:
FbusIO_SendMsg bus, device, msgParam, sendBytes(), recvBytes()
Description of parameter
There are two arrays passed to the parameter. The sendData array contains the data that is
sent to the device in bytes. This array must be dimensioned to the correct number of bytes
to send. If there are no bytes to send, you must use "0" for the parameter. The recvData
array returns the response in bytes. This array is automatically re-dimensioned to the
number of bytes received.
For DeviceNet, you need to initialize the sendData array with the command, class,
instance, and attribute, as shown in the example below. Consult the documentation that
came with the device for the values that can be used. The msgParam parameter value is
always "0" for DeviceNet messages.
Here is an example for DeviceNet and EtherNet/IP:
The following example acquires the information of a device MacID = 1.
' Send explicit message to the device
Byte sendData(5)
Byte recvData(10)
Integer i
sendData(0) = 14 ' Command (GetAttributeSingle)
sendData(1) = 1
sendData(3) = 1
sendData(5) = 7
FbusIO_SendMsg 16, 1, 0, sendData(), recvData()
For i = 0 To UBound(recvData)
Next i
For PROFIBUS DP, you need to specify the service number in the msgParam parameter.
Consult the documentation that came with the device for the services that are supported.
Some services require "0" send bytes. In this case, use "0" for the sendBytes parameter.
Here is an example for PROFIBUS DP:
' Send message to Profibus device
Byte recvData(10)
Integer i
' Service 56 - read all inputs
' sendBytes = 0
FbusIO_SendMsg 1, 1, 56, 0, recvData()
For i = 0 To UBound(recvData)
Next i
RC620 Option Fieldbus I/O Rev.8
' Class
' Instance
' Attribute
Print recvData(i)
Print recvData(i)
3. Operation


Table of Contents

   Also See for Epson RC620

   Related Manuals for Epson RC620

   Related Content for Epson RC620

Comments to this Manuals

Symbols: 0
Latest comments: