Table of Contents

Advertisement

If the slave is another Galil Ethernet controller, the SA command can be used to send commands as in
the following example:

Modbus

An additional protocol layer is available for speaking to I/O devices. Modbus over TCP is a protocol
that packages information in binary packets that are sent as part of a TCP/IP packet. In this protocol,
each slave has a 1 byte slave address. The CDS-3310 can use a specific slave address or default to the
handle number. The port number for Modbus is 502. The Modbus protocol has a set of commands
called function codes. The CDS-3310 supports the 10 major function codes:
Function Code
01
02
03
04
05
06
07
15
16
17
The CDS-3310 provides three levels of Modbus communication. The first level allows the user to
create a raw packet and receive raw data. It uses the MBh command with a function code of –1. The
format of the command is
The second level incorporates the Modbus structure. This is necessary for sending configuration and
special commands to an I/O device. The formats vary depending on the function code that is called.
For more information refer to the Command Reference.
The third level of Modbus communication uses standard Galil commands. Once the slave has been
configured, the commands that may be used are @IN[], SB, CB, OB, and AO. For example, AO
2020,8.2 would tell I/O number 2020 to output 8.2 volts.
If a specific slave address is not necessary, the I/O number to be used can be calculated with the
following:
CDS-3310
IHC=10,10,10,20
#L; JP#L, _IHC2<>-2
SAC = "MG _TPX"
WT5
Position = _SAC0
Definition
Read Coil Status (Read Bits)
Read Input Status (Read Bits)
Read Holding Registers (Read Words)
Read Input Registers (Read Words)
Force Single Coil (Write One Bit)
Preset Single Register (Write One Word)
Read Exception Status (Read Error Code)
Force Multiple Coils (Write Multiple Bits)
Preset Multiple Registers (Write Words)
Report Slave ID
MBh = -1,len,array[]
I/O Number = (HandleNum*1000) +((Module-1)*4) + (BitNum-1)
;'open a handle to another Galil controller
;'wait until the connection is complete
;'sent a command to the controller
;'wait for the response
;'assign the result to a variable
where
len is the number of bytes
array[] is the array with the data
Chapter 4 Communication
i
27

Advertisement

Table of Contents
loading

Related Products for Galil Motion Control CDS-3310

Table of Contents