Modbus and Ethernet


Recommended Posts

I've implemented a system to read and store electrical data, the data meters use modbus RTU connected to an ethernet network, at a baud rate of 9600 bps.

I'm implanting the system now and, while it works alright at the laboratory, I'm facing some odd behavior on the virtual machine where it should run.

Sometimes channels lag behind and some times all of then stop for some minutes or hours, and start reading again at uncertain times.

I'm studying what could be the cause of this behavior and what I've noticed so far is every time some network related event like windows updates and user password change occurred at the server machine, the channels would stop working. That is expected and should be understandable as no system is 100% reliable.

I'm using offset betwen each equipment of about 0.8 seconds and channel timing about 10 seconds. Maybe the baud rate should be highter, or those offsets a little longer? I must have then reading and storing data as fast as possible, or rather, discover which is the shortest intervals so I can inform the final users.

Any help on this?

Link to comment
Share on other sites

First, systems can be made very close to 100% reliable. The first step is to turn automatic updates off, stop any other programs that may be running (such as antivirus) and have the system not be used like a desktop.

As for your issues, if you are using a single serial to ethernet converter, there is no advantage of using Offset. In fact, it will likely make things worse. Have all your inputs on the same Timing and leave it. If you run into problems, use the SetDelay() function of of your device to space out your readings:

device.mydevice.setdelay(100)

where 100 is milliseconds between each query. This function is designed for 485 systems where the multiplexers are slow to release compared to DAQFactory's speed and basically just put a delay between each query.

Link to comment
Share on other sites

That might as well be it, I have offsets between equipments from the same converter! I will give it a try with the function you mention also.

As for running the PC not as a desktop, the IT person tells me we should run it as a windows service on a windows server, so we dont need a user logged on to keep DAQFactory open. Is there any easy way of doing that I'm missing?

Thanks in advance!

Link to comment
Share on other sites

I do not know a way to run DAQFactory as a service, though I believe there is a way to run user apps without logging in. I know one of our mail servers worked that way. Your IT guy might know how to do it. An easier way would be to have it auto-login then have the screensaver set to 1 minute with a password required to get out of it, or perhaps there is a way to auto-lock the computer. Actually a quick search found me this site: http://www.fnode.com/2007/04/how-to-lock-w...s-xp-when-idle/ which uses rundll32 to lock the computer from the scheduler. You could probably also do this right at login from startup with a batch command. rundll32 has lots of useful functions, and this site: http://dx21.com/coding/libraries/rundll32/default.aspx lists them all.

Link to comment
Share on other sites

Archived

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