µTasker Forum > MODBUS

MODBUS simulation/testing on PC

<< < (2/3) > >>

mark:
Hi Jez

I just took the LPC23XX project and added the MODBUS module.
In config.h I activated MODBUS by enabling USE_MODBUS (SERIAL_INTERFACE was already defined).
In app_hw_lpc23xx I checked the UART settings and found them to be as follows:
MODBUS_UART_0   2 - SERIAL_PORT_2   11
MODBUS_UART_1   3 - SERIAL_PORT_3   12
DEMO_UART 0 - SERIAL_PORT_0   4

These are setting the two MODBUS serial ports (as used by the MODBUS demo application) to UARTs 2 and 3 on the chip and the debug output to UART 0 [note that some chips with only 2 UARTs need to disable DEMO_UART when testing MODBUS so that the 2 available ones can be used for it].

The MODBUS serial ports are being mapped to COM ports 11 and 12. On my PC I have com0com performing a virtual loop back between these two. When I run this I get the expected result.

Check carefully that your com0com configuration matches the set up and change either accordingly if this is not the case.
To check just the UART transmission I find it useful to set the serial MODBUS port to ASCII mode and then open a terminal emulator on COM 12 - then anything sent over MODBUS serial port 0 (over COM 11) will be seen in the terminal. The loop back will of course not work since the terminal is blocking it, but it is good to verify that data is really being sent.

Also watch debug output (on the debug output or via TELNET) since there is some MODBUS debug out, such as when a slave doesn't respond.

Regards

Mark

jezc:
Hi Mark,

Brilliant - I'd got the serial port setup wrong, reverting back to the original settings and re-configuring COM0COM to suit has done the trick!

I can now see both the MODBUS queries and responses in Wireshark - great!

Thanks - feel a bit daft for not sorting this out for myself.

Cheers,
    JezC

shelest:
I use Modbus Reader for testing RTU and TCP. See www.kurysoft.com

mhoneywill:
Does this mean you also have Modbus Constructor? I use the mbaxp.ocx control from here http://www.modbustools.com/modbus_activex.asp and have made my own tools in VB6.

For a free tool I use http://omniflow.com/Products/SoftwareDownloads/ModbusTester_install_v2.11.zip

Cheers

Martin

HDowns:
Another serial port monitor software has the MODBUS RTU/ASCII slave/mater emulation plugin. Allows to debug MODBUS traffic in the sniffer mode too. Recommend.

--
Helen

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version