Write Message to Trendview recorder via Modbus
1Dan Weise, Lesman Instrument Co. © 2012 rev2a
Write Message to Trendview via Modbus
• A Modbus master can write text messages to a recorder – PLC, SCADA, HMI
• Messages appear– on the Trendcharts
– in the User Message log along with a date/time stamp
• Trendview recorder is a Modbus slave, no credits are needed.
• The messages can be written over either ethernet (Modbus TCP) or RS-485 (Modbus RTU).RS-485 (Modbus RTU).
• All recorders have 16 holding registers in the 4xxxx memory area reserved for messages of up to 32 ASCII characters
– starting address = 0004, register (4)0005
• Recorder configuration:– Slave mode must be enabled
– recorder must be assigned a slave node ID number, 1 – 247
– for Modbus RTU, the RS-485 port must be configured and the settings must
match the Master’s settings.
2Dan Weise, Lesman Instrument Co. © 2012
Trendview Setup
Trendview Setup for Modbus RTU over RS-485
does not matter, can be something else
3Dan Weise, Lesman Instrument Co. © 2012
Modscan 32 as Modbus MasterModscan 32 Connection setup:
USB/RS-485 adapter installed on PC’s COM 8
Direct Connection to COM8 matches the COM port shown in Device Manager
4Dan Weise, Lesman Instrument Co. © 2012
Modscan 32
Modscan 32 Connection setup:
Comm settings under Configuration match Trendview’s setup
5Dan Weise, Lesman Instrument Co. © 2012
Write Message to Trendview via Modbus
Compose message of ASCII character hex values
• Setup > Extended > Preset Regs
6Dan Weise, Lesman Instrument Co. © 2012
Modscan 32
Enter data
• Slave Device node number (1)
• Register address 5 = 40005, starting from 40001
• Number of registers (points)
Number of points should be 4,
not 3, for message “Cleared”
7Dan Weise, Lesman Instrument Co. © 2012
Modscan 32
For each register address, enter the hex values for two ASCII characters
sample message: Cleared
• 43 = C
• 6C = l
• 65 = e
• 61 = a
• 72 = r• 72 = r
• 65 = e
• 64 = d
• 00 = nul
• ‘To File’ saves the setup
• ‘From File’ loads a previously configured setup
• ‘Update’ sends message to slave device8Dan Weise, Lesman Instrument Co. © 2012
Modscan 32
Modscan32’s completed ‘write message’ transaction for
• Slave (Device) 1
• Address 40005
• 4 registers (8, 8 bit ASCII characters)
9Dan Weise, Lesman Instrument Co. © 2012
Trendview Mark-on-Chart
Message “Cleared” marked on the Trendview chart
10Dan Weise, Lesman Instrument Co. © 2012
ASCII Table
11Dan Weise, Lesman Instrument Co. © 2012
Banner USB/RS-485 converter cable
• Banner USB/RS-485 converter cable
• part number BWA-HW-006
• used for Trendview Modbus RTU
• FTDI chipset
– registered with Microsoft
– if installed on PC with internet access, will find drivers and self-access, will find drivers and self-
install
• Check Device manager to see which COM port the converter installs on
12Dan Weise, Lesman Instrument Co. © 2012
Wiring Banner USB-RS-485 converter cable toTrendview X series RS-485 Modbus
Wh
ite
Bla
ck
Gra
y o
r gre
en
/ye
llow
• Use 5 pin M12 male cordset to adapt Banner M12 5 pin Female connector to flying leads
• Wire Honeywell connector as shown
Banner M12 node connections
Trendview
Banner M12 node connections
RS-485 uses white, black & gray
13Banner
Dan Weise, Lesman Instrument Co. © 2012
Trendview Manual: write message via Modbus
Input Text message
• This facility allows a text message to be passed to the recorder to be
annotated on the chart and added to the message log.
• The maximum length of the message is 32 bytes of ASCII characters, which
need not be null-terminated.
• It operates by utilising modbus function code 16 (0x10), Preset Multiple
registers, and the unique address 0x0004 in the Modbus global register map (Table A-1). The Modbus message format follows that shown in map (Table A-1). The Modbus message format follows that shown in
section 3.7 of the document cited.
• The Start Address will be 0004, and the Byte Count of the number of bytes
in the text message. (# of characters/2)
• As [a minimum of] 2 Modbus registers are needed to pass an address
[range] to [by] function 16, the Number of Addresses has to be back
calculated from the required Byte Count to give the lowest integer such that
(Number of Addresses) / 2 ��= Byte Count.
• For example if Byte Count = 4, then Number of Addresses = 2
• But if Byte Count = 5, Number of Addresses = 3.
14Dan Weise, Lesman Instrument Co. © 2012
Trendview Manual: write message via Modbus
Input Text message, con’t.
• As an example, to send the 5-character message Start to a slave address
02 the complete [10(hex) function code] message would be:
• The response follows the normal response for function code 16 given in
section 3.7, and so to the above message the response would be: – 02 10 00 04 00 03 CRC CRC
15Dan Weise, Lesman Instrument Co. © 2012