Using Arduino For Data Aquisition Via Modbus Tcp


jmane14

Recommended Posts

Hello,

 

I am trying to use an Arduino Leonardo  to aquire data from preasure and temperature sensors.

 

I have installed in the Arduino the MUDBUS library in the Leonardo and in fact I have read correct data and even wrote values to the Arduino with Modbus Poll.

 

The problem is that when I try to aquire data in Daq factory, the values have no sense with real ones, I thought that maybe I was reading the wrong coils.

 

But in Modbus Poll I read correctly coil 40000 and in Daqfactory, I read that same coil and same type of data, the data is still very different.

 

What do you think it could be done?

 

I have tried even 50000´s coils believing that Arduino started at coil 0 but in Modbuss poll, coil is 40000, in fact, DAQ factory marks error when reading coils 40000´s but with 50´s it works but data is wrong.

 

I would really appreciate any help or suggestion to correct data aquisition.

Link to comment
Share on other sites

Coil # 40000 is a bad choice for a coil #.  Did you pick this number in your Arduino, or is it fixed?  Its bad because 40,000 addresses in old style Modbus typically indicate a holding register.  Technically 40,000 doesn't exist and it starts with 40,001, but its still confusing.  If you do have control over the numbering, change it into the 0-9999 range.  Then restart DAQFactory and it will probably work just fine.  If you can't, the problem is that DAQFactory sees the 40,000 number and thinks you are using that style addressing.  That style addressing is numbered from 1, not 0, and the 4 is usually stripped, though I'm not sure it will be stripped for a coil.  Either way, you are probably off by one.  By reading a 50,000 register you lock it into zero indexed mode, but you still need to specify 40000, not 50000 for the coil.

 

When all else fails, look at the comm monitor and the modbus packet and see what address DAQFactory is actually requesting.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.