3-27
3
3.8
MODBUS PROGRAMMING EXAMPLES
The following section provides information on how to configure the 8099 from
a program, and how to send commands to the Modbus slave device. New users
should try these simple examples with ICS’s VXI11_kybd program to become
familiar with controlling the 8099 and Modbus device(s) over an Ethernet link.
Refer to Appendix A1 and A2 for general information about VXI-11 program-
ming and to Section 3.9 for directions on using the VXI11_Kybd program.
3.8.2 General Configuration Guidelines
New units are factory set so that they are ready to be used when received. Table
1-3 lists the Factory Settings for the Serial Interface. Verify that the 8099's
setting match those in the Modbus device. Use the SCPI commands in Table
3-3 to query or change any 8099 setting.
SYST:COMM:SER:RS485?
‘reads current 485 mode setting
SYST:COMM:SER:RS485 1
'
sets 485 mode on
If the new setting did not verify or if the red ERR LED came on, query the ESR
Register. The command was not executed if the ERR LED came on.
Send *ESR?
‘reads Event Status Register
and clears the ERR LED.
Check the ESR reading against the bit pattern in Figure 3-1 to find the cause
of the error. Correct and repeat the above steps for each parameter you are
changing. When done save the new values.
Send “*SAV 0”
‘save the new configuration
The *SAV 0 command will cause the 8099 to blink all but one of its LEDs. .
3.8.3 Setting the Modbus Device Address
The Modbus device address in the 8099 is set with the 'C' command to match
the address set in the desired Modbus device. The 8099 remembers the Modbus
address until it is changed. It is only necessary to send the 8099 the 'C' com-
mand at the start of the program. If the 8099 is being used with only one
Modbus device, the address can be set and saved as part of the 8099’s power
on configuration. The 8099 and most Modbus devices default to a Modbus
address of 1.