Galil DMC-3425 Home Security System User Manual


 
DMC-3425 Chapter 4 Communication 51
The DMC-3425 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
MBh = -1,len,array[] where len is the number of bytes
array[] is the array with the data
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[], @AN[], 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:
I/O Number = (HandleNum*1000) +((Module-1)*4) + (BitNum-1)
Where HandleNum is the handle number from 1 (A) to 8 (H). Module is the position of the module in
the rack from 1 to 16. BitNum is the I/O point in the module from 1 to 4.
If an explicit slave address is to be used, the equation becomes:
I/O Number = (SlaveAddress*10000) + (HandleNum*1000) +((Module-1)*4) + (Bitnum-1)
To view an example procedure for communicating with an OPTO-22 rack, refer to the appendix.
Other Communication Options
User Defined Ethernet Variables
It may be necessary within a distributed system to share information that is not contained as position,
torque, velocity or other control data. The DMC-3425 provides 2 user defined variables that are
passed as part of the QW record shared among the distributed system. In this way, it is not necessary
for a single controller to write variable data directly to all the other controllers in the system.
ZA and ZB are two user defined variables which are passed with the QW record at each update. Data
that is written to these variables is then seen by the master DMC-3425 in the system.
Handle Switching
By default, when initiating a communication session with a DMC-3425 controller, the first available
handle is used. If no handles have been assigned to the controller, the A handle is chosen. The
command HS allows the user to switch this connection to another handle, freeing up the initial handle
or trading with another currently used handle. Or, once handles have been defined, the HS command
may be used to switch handles to prioritize slave locations and I/O locations.
Handle Restore on Communication Failure
There are instances within an Ethernet system, whether UDP or TCP/IP, when a handle may become
disconnected without closing properly. An example of this would be a simple cable failure, where the
Ethernet cable of a certain slave becomes detached.
The command HR is used to enable a mode in which the master controller, upon seeing a failure on a
handle, will attempt to restore that handle. This is helpful when a distributed system is already fully
configured and a slave is lost. The #TCPERR routine can be used to flag the error, while the handle
restore will attempt to reconnect to the slave until the problem is fixed. This makes it unnecessary to
re-run the setup for the entire distributed system.