beautypg.com

B&B Electronics MODSCAN32 - Manual User Manual

Page 41

background image

41

User Defined Messsages


Use this command to customize a command string for transmission to a designated modbus slave device.
This command is useful for observing the slave response to non-standard modbus queries or to test its
reaction to requests for data which may not be available. The slave device should respond with the proper
exception message if a master device asks for data which is beyond its address range or otherwise
unavailable via the modbus.

After transmitting the user string, ModScan will receive characters for the entire time-out period specified
for the connection. The results will then be updated to the appropriate edit control on the dialog box. User
defined messages transmitted to a slave device will not show up in the ModScan message counters.

Scripts


Test scripts consist of ASCII text data field separated by commas. They may be constructed using any word
processor or spreadsheet application. A test script entry consists of at least 7 data fields as depicted in the
following example script, (example.csv).

//
// Example Test Script for ModScan Application
//
// Each Script entry consists of the following
// comma delimited data fields:
//
// TEST NAME, NODE, FUNCTION, ADDRESS, LENGTH, DATA, CONTROL CODE
//
// Double slashes on the front of a line denote comments
//
// The following Control Codes may be used (i.e. last field on each line)
//

\ -- Continue DATA fields on next line

//

C -- Generate Bad CRC message to slave

//

D -- Check response data quantity only, (ignore actual data)

//

1 -- Expect Exception Response 01

//

2 -- Expect Exception Response 02

//

4 -- Expect Exception Response 04

//

R -- Expect no Response

//

T (default) -- Verify Response Data

//
//
// First Test:
//

Write 20 Coils to Node 1 starting at address 100

//

Data is alternating pattern of ones & zeros

// (DATA field consists of 32-bits and may be specified
//

as a decimal, hex or floating-point value)

//
Preset Multiple Coils,1,15,100,20,0xAAAAA,T
//
//
// Second Test:
//

Verify results of first test by reading the pattern back

//
Verify Coil Status,1,1,100,20,0xAAAAA,T
//
// Third Test:
//

Read 100 Input Status values