Hello Guest it is March 29, 2024, 10:41:26 AM

Author Topic: Problem with Test Modbus Function  (Read 5249 times)

0 Members and 1 Guest are viewing this topic.

Problem with Test Modbus Function
« on: May 01, 2014, 09:03:08 PM »
Hey Everyone, I'm running into a strange problem with the ModIO. I originally hooked it up following the manual and the Test Modbus function worked perfectly. Later I accidentally tripped an error on the board I was using and switched it out for a new board (haven't had time to go back and fix the original). Since then, I haven't been able to get Test Modbus working correctly.

I think my settings are the same as before, but now it will connect with "No Error" when I open the port, but will read "Receive Timeout" if I try to read/write to any registers. What makes it even stranger is that I can set registers fine using a brain.

Even stranger is that if I choose a register to read, say 103 for example, it first says "Receive Timeout" but if I click the Decimal radio button it will read out the data in decimal. Then if I click the Hex radio button it will read it out the values in Hex.  ???

The whole reason I'm messing with this in the first place is to set the 103 register to FF in order to keep the output lights 1-4 from blinking. However I haven't been able to write to the registers because of the above reasons. Any help you can give would be appreciated!

Attached is a screenshot of the settings I'm using. This is what it looks like after I've clicked Decimal and then Hex. But there's still a "Receive Timeout" on the bottom.

Thanks,
Sam



Re: Problem with Test Modbus Function
« Reply #1 on: May 02, 2014, 11:19:01 PM »
Hi,

When, you write to any of the config registers, you can only write to a single register at a time. if you try to write to multiple config registers in a single write command, you will get a timeout.

Also once you write to a config register, you need to reset the ModIO to take effect.

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Problem with Test Modbus Function
« Reply #2 on: May 05, 2014, 02:19:09 AM »
Hi Peter,

Thanks for the reply! In the end, we managed to get it working, but it's still reading out a receive timeout even though it's reading and writing data correctly.

I originally had three boards hooked together and they were all getting a receive timeout when I'd click to read register 103 (or 1040, so on). I was only reading one register. Then I unplugged the boards and switched in another board, trying to communicate with that. If I remember correctly it was getting the same receive timeout. Then I unhooked that board and reattached the original 3. These then read correctly! No receive timeout. I wrote to register 103 and it worked perfectly.

After that we hooked up 4 more boards together (so 7 boards daisy-chained). When I'd try to communicate with these new boards using Test Modbus I'd get a receive timeout again. But I just went ahead and inputted register 103 as "FF", opened the port, ignored the "receive timeout" message, clicked write, pushed the reset button on the board and then tried opening an output on the board. Every board was set correctly this way (no blinking)!

So things are working and we're happy! But it would still be nice to understand why I'm getting the receive timeout message. Quite likely a setting I've got wrong somewhere.

Thanks,
Sam
Re: Problem with Test Modbus Function
« Reply #3 on: May 05, 2014, 03:28:59 AM »
Basically, when you write to a config register, The ModIO stores the value in EEPROM. The chip takes time to program the value. Try changing the timeout to 200ms rather than 50ms ans see how you go.

The timeout is there to detect comms problems and needs to be set to 3-5 times the maximum round trip delay. The delay is composed of sending the request to the slave, the slave processing the request and then sending the response.

Cheers,

Peter.

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Problem with Test Modbus Function
« Reply #4 on: May 05, 2014, 03:33:14 AM »
Also, are you using a USB to serial converter? Some converters  wait for their buffer to fill  or a delay after no activity before passing the data on to the program (Mach3). Extending the timeout in Mach3 can sometimes cater for this.

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Problem with Test Modbus Function
« Reply #5 on: May 05, 2014, 03:35:43 AM »
Thank you Peter! I will try extending the timeout to 200ms. That sounds like it may work. Will let you know!

We are connecting directly to the COMM port on the computer.

Cheers,
Sam