Interface for Microcontroller with MODBUS

A

Thread Starter

AndreaB93

Hi everybody,

I'm a beginner and I'm trying to acquire data from a microcontroller with Modbus serial protocol in order to create an interface with LabVIEW. I'm using a Prolific Technology USB-RS232 converter and Windows 7 as OS.

I can't read data from the micro. I know that read only variables are in registers from 100hex and 1FFhex and read/write variables are from 200hex and 2FFhex.

How does the memory of micro need to be used? How do I define holding registers and input registers?

Thanks in advance for any advice.

Andrea.
 
A
Do you still need help with this?
Kevin

>I'm a beginner and I'm trying to acquire data from a
>microcontroller with Modbus serial protocol in order to
>create an interface with LabVIEW. I'm using a Prolific
>Technology USB-RS232 converter and Windows 7 as OS.
>
>I can't read data from the micro. I know that read only
>variables are in registers from 100hex and 1FFhex and
>read/write variables are from 200hex and 2FFhex.
>
>How does the memory of micro need to be used? How do I
>define holding registers and input registers?
 
B

Bob Peterson

the Modbus protocol would have to be running as a driver or program on the microcontroller. if it does not already exist there, you would have to implement it. it is not real hard to do, the protocol is pretty simple and the spec for it is not hard to come by, but it is not trivial either. you would then map the internal registers into Modbus register addresses.

you are also going to have to write or buy software on the PC side as well.

I think you may have bitten off a big chunk of work that you may not be prepared for.

--
Bob
http://ilbob.blogspot.com/
 
There are simple free open source code and tools here for a Modbus master (RTU) on a PC (Windows or Linux) or an ARM board (Raspberry Pi or Beaglebone Black):
http://ctrlterm.com/custom.htm

You can get a nice free Windows slave simulator here:
http://www.peakhmi.com/
Select Downloads then "PeakHMI Slave Simulators"

There are various options for getting enough serial ports. See #3 and #4 here:
http://ctrlterm.com/related.htm

This might be the easiest way to get started with Modbus using a PC.
 
B
for your ready reference,
go thru this manual
page no 163 onwards.

http://ww1.microchip.com/downloads/en/devicedoc/39632c.pdf

Have you programmed the micro controller...??

You need to program it only then it will be able to answer a query. Ready made programs is available in Google. Are you using micro C or something like that for micro controller programming...??

I assume you know the basics of mucro controller programming and practical implementation.
 
Top