Sign in to follow this  
Followers 0
scottmurphy

CP1H/Modbus Easy Master

12 posts in this topic

I am trying to get to the bottom of what seems to be an intermittent error Here is the setup Site 1 1x CP1H using the Modbus Easy master function 2x Modlon Slave devices, that act as a Modbus-Lonworks Gateway app 15-20m total network cabling 2-wire Modbus from CP1H, T+/R+ & T-/R- connected at Slave end I am polling each slave for 2x blocks of data, at identical intervals. Every so often, the CP1H reports a no response from 1 of the slave device's. If I set to only poll 1 slave, the system does not skip a beat. If I set to poll the other slave, the same thing, consistent replies, no errors. Site 2 I tried the identical setup with 2 different types of slaves, VSD's that have Modbus on-board, as opposed to this Modbus to Lonworks device. The other difference being the length of cabling, on this install, the PLC & VSD's are in the same cabinet. This config ran fine with no failures. This proves the code/wiring/Master device. The only other difference between the 2, was that Site 2 has a scan time of app 13mS, whereas site 1 was 2mS. I fixed Site 1 at 20mS, and this did seem to reduce the error count, but not eliminate it. Where could the problem be, where should we be looking? If it was a cabling thing, then there would be issues when polling the single device. If it were a code issue, then the issue would of been present on the 2nd site that I tried this on. I have also tried increasing the time between polls, currently at 2.5 Sec, which I think is quite a long time. The error count seems to be almost zero with this setup. I have had it out to 5sec, whilst this does reduce the error count, it does not go away!! I could leave at it this, but surely 2.5 sec between polls is too long? I would normally expect to initiate the next poll when the previous poll has been completed, as indicated by the Ready/Executing flags. Any thoughts?

Share this post


Link to post
Share on other sites
Scott When the 'no response' occurs, does the port error bit turn on? That would be A392.12 for port 1, or A392.04 for port 2. (Yes, those bits appear backwards). Something to try would be to increase the peripheral servicing time. This helps out a whole lot with all kinds of comms. '50' as shown below, allows up to 5.0 ms per scan for servicing peripheral devices. By the way, did you see this posting? http://forums.mrplc.com/index.php?autocom=...mp;showfile=867

Share this post


Link to post
Share on other sites
No, I only had the reference for the 3GMV invertor, there is definitely more info in those files. I have created a FB to do similar, but with only 3 function codes instead. Seems to work fine, apart from this issue... Edited by scottmurphy

Share this post


Link to post
Share on other sites
Scott &128 (&H80) is a timeout regardless of the function code. The fact that your Step 2 in your original post tested 2 inverters with Modbus, and they worked fine, seems to point to the Modbus to LON gateway devices. Did you use the same wiring for the VFD test that you are using on the LON gateways? When you are increasing your polling interval, are you timing between sending the first Modbus command and sending the second Modbus command, or are you timing from when you recieve a Modbus response to the first command until when you send the next command? In my code, I found that this second method (an intermessage delay) of ~ 20ms helped to increase stability. A packet snooper on the RS485 line would be the only way to tell for certain what is going on. If you happen to have a pair of Omron NT-AL001 adapters, the manual that I include with Supermon has a diagram of how to create an RS422 or RS485 snooper.

Share this post


Link to post
Share on other sites
I have downloaded your SuperMon files, looks like something I need to try. I should be able to do this with any 485/422 - 232 convertors, not specifically the Omron ones?

Share this post


Link to post
Share on other sites
Scott Any RS485 converters should be OK. I simply had 2 NT-AL001s on hand.

Share this post


Link to post
Share on other sites
Right, Have done some 'snooping' and have attached the results. I only used the standard monitor function, perhaps I need to go more in depth. When I had the sniffer on, there were a few errors that came through, so these should be evident in the files... I am having a closer look now. BS02_01.txt BS02_02.txt BS02_03.txt

Share this post


Link to post
Share on other sites
Scott When monitoring a binary protocol like Modbus, I find it more helpful to use the Binary view mode. This makes <02><03>% from the ASCII view mode appear as 02 03 25, which I find easier to read. The Logging mode may work better, as it seperates out the strings from one another, and time stamps them. I have not yet split apart the text files. Any idea where the errors occurred?

Share this post


Link to post
Share on other sites
Right, I finally managed to get back to site today, had 2x Loan VSD's identical to Site 2. Put the 2 VSD's at the end of line where the terminator is ( This install has the termination point adjacent to the origin to allow for future devices), modified the node no's in the polling commands, and away the comms went, without missing a beat, no failures or errors at all!! I couldn't get the logging mode to work, I tried uni & bi-directional, but no data was retrieved, is it possible my wiring was incorrect for this format, even though it works in the monitor mode. Just for an example of what the VSD message looked like with no 'no responses', look at 7&8.txt. 7_8.txt 1122_with_failure.txt 2_8_with_failure.txt

Share this post


Link to post
Share on other sites
Scott I am not sure why logging did not work for your setup. It will be a while until I can set this up and test it out with Modbus. It sounds like you are heading in the right direction. You have almost completely eliminated the PLC and the wiring as the cause of the timeout. Have you turned down the timeout value on the port? The defaut of 0 = 5 seconds. You could speed up recovery by decreasing to 1 second.

Share this post


Link to post
Share on other sites
Just checked, it looks like I have it set to 10 (1sec). The other settings that I have not tried on this install was going back to a variable scan time as opposed to fixed at 20mS. This is not a major, I want to get this issue sorted first. Scott

Share this post


Link to post
Share on other sites
I briefly called into this site recently, and made some interesting observations. I was looking at the Poll/Failure rate, and noticed that this was varying when if I was online/offline via the CJ1W-ETN21. When offline, Start Polls := 46550 Fails := 465 % := 0.998 Finish Polls := 46950 Fails := 467 % := 0.994 And then Online, Start Polls 47000 Fails 467 % 0.993 Finish Polls := 47312 Fails := 475 % := 1.003 This was a period of 5-10 minutes each, you can see that there is a noticeable difference between when I was online/offline. This is an interesting find, it seems that I maybe need to increase the peripheral servicing time again, to allow for the ETN module. Currently, it as 5mS, is there a way to calculate/determine what the ideal settings for this should be? The agent has made some further suggestions, mainly to try again with 4wire and earth on/off etc. I haven't had time to do this as yet, but don't imagine I will get much difference Edited by scottmurphy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0