Reading MODBUS TCP data

Hello,

I am looking to read some modbus data from some Mayekawa chillers. How do I reference these points in my program?

So my panel IP is: 192.168.1.168
My first modbus device is 192.168.1.31

I need to read registers: 40101-40115, and 40131

TIA,

Jim.

Looking at the example on the forum:

https://forums.temcocontrols.com/t/network-programming-overview/316

I think it will work out to something like this in your application:

10 VAR2 = 31MB_REG40101.

Let me know how this works out for you. The staff are all off till Feb 2 for the local break, we will help out more later if this doesnt work.

No luck. No data is pulled in.

Latest version of firmware and software

Solving problems, one building at a time.

Hey Jim, according to the example that Maurice pointed you to, you might need to place the modbus network ID number of your modus device after the last IP digit with a decimal separating them.

For example, if your modus network ID number is 101, then it would look like this.

10 VAR2 = 31.101MB_REG40101

I know that they were talking about a rework of how that gets addressed for bacnet, but for modbus, I thought that it was still addressed that way.

Mike

Hi Jim,
you can understand how to do a poll on Modbus by reading the topic: https://forums.temcocontrols.com/t/temco-plc-as-modbus-master/566
I hope you find it useful.

Aleksei

I will give it another try. Didn’t seem to work but perhaps I was being hasty.

I did try that too.

Solving problems, one building at a time.

Here are a couple screen caps of what I am seeing. Does anything jump out at anyone?

mbreadpg

I have 2 devices I am trying to read. The first is 192.168.1.31, device id 31 and 192.168.1.32, device id 32.

Thanks All,

I have found the error of what I was doing:

Should be: var = 31.31.MB_REG101, not 40101

Thanks again,

Jim.

Nice catch there Jim!

A post was split to a new topic: Pi reading modbus registers