Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Occasional erroneous data (zero or infinity) from modbus communication (RS485) with instrument; what may be causing this to happen?

Using a developed Visa that allows communication over RS485. A property node is used to designate the baud rate, parity, ect. Using visa open, read, write, and close funtions to send and receive data according to MODBUS codes. The instruments are two Micro Motion Elite mass flow meters. On the same RS485 line there are also 15 or more Honeywell pressure transducers. There are never any erroneous readings from the pressure transducers. All of the devices have different polling addresses.
An erroneous mass flow will show up every hour or so on average, but there is definitely no repeatability. Some times two erroneous reading wil
l be two minutes apart, while at other times two hours. In addition, for the same scan meter 1 will show an erroneous reading and meter 2 will be a correct value.
I'm thinking that there may be a problem having the two different instruments on the same line or that there may be some residual data left in the shift registers, but I'm a novice in the serial communications department. If anyone can help please email Mike at mgiannavola@evapco.com

thanks,
Mike
0 Kudos
Message 1 of 14
(5,450 Views)
Hi Mike,

By answering here I can help others in the future.

I suggest you start narrowing things down.

1) do errors only come from meter 1?

2) Put the meters all by themselves on the rs-485 port and run them for 8 hours or more to convince yourself that they work or don't.

Let us know what you find, or feel free to elaborate.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 14
(5,447 Views)
Hi Ben,

Erroneous data show up from both mass flow meters, but not necessarily at the same time. The data received from the meters is typically good, it is just an occassional problem, but a problem nonetheless.

I isolated the meters from the pressure transducers by "Disabling" the transducers in LabView(does not attempt communication). However, the transducers are still wired in the the RS485 loop. If I have to physically separate them I will, but it is tideous. This isolation hasn't solved the problem.

I have currently added resisters (150ohm) at beginning of the RS485 line (near the computer connection) and at each of the mass flow meter transmitter. If the problem is electrical reflectance then this should solve the problem. I'll le
t you know if this fixes the problem. If not, I may just run a new RS485 line from my computer to the transmitter to convince myself that it's not the wire or pressure transducers causing the problems.

Thanks,
Mike
0 Kudos
Message 3 of 14
(5,447 Views)
Ben,

I have put the meters on a completely separate (brand new wire) RS485 line. 150 ohm Resistors were connected at the RS485 plug and across the terminals of the meter at the end of the line (meter B). This should help against any electrical reflection problems. The wire from the RS485 runs directly into one meter (meter A) and then the second meter (B) is jumpered to the first.

This has NOT mitigated or eliminated the problem. Please let me know if you have any ideas that can cure this problem. Your help is very much appreciated.

Thanks,
Mike
0 Kudos
Message 4 of 14
(5,447 Views)
Hi Mike,

Sorry about the delay in responding. 10 year aniversary had me out of touch for a while.

I did not see you say that any one meter runs good al by itself. If you just run one meter for an extended period, does that work OK?

As it stand is appear that you should work on proving the bad readings are coming from,
1) Meters stepping on each other,
2) Wiring (bad environment, etc)
3) The PC.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 14
(5,449 Views)
Hey Ben,

Don't worry about the delay, I just appreciate the help.

Here's what I have done:

1st Test- Wire was run from serial port to Meter1 and then a jumper wire was run from Meter1 to Meter2. In this wiring configuration I acquired data from one meter at a time. The meter not being tested was also not powered. Each meter was tested for an extended period of time (2-3 hours). The results of these tests showed occassional-erroneous data.

2nd Test - Run similarly to 1st Test except only one meter connected to the serial port at a time. Again, results showed erroneous data.

I've been plotting these occurrances and it seems that 9/10 times the data is erroneous, it is 0 in all testing. So 1/10 times it is a rediculo
usly high number like "5e23". I have also noticed that as I increase my channel scan rate from 1scan/35sec to 1scan/10sec or 1scan/5sec the occurrances increase for a given time period, but are similar for the number of scans (hopefully I'm making this understandable). Kind of like there will be an erroneous data point every 50 scans regardless of scan rate.

Hopefully you can help out. This is not a problem that has kept us from running tests, but it is an annoyance when reducing data after a test has run. I can think of a number of "band-aids" to patch up the problem, but I would really like to fix it.

As for other sources of the problem, I've recently run a new wire from the serial port to the meters (about 100') and I put resistors at the meters to reduce electrical reflection. Not sure how else to check for noise or interferance. The PC is old and may be a problem. I may see if I can get my hands on another computer.

Could my LabView program be the problem?


If you have any advice please let me know.

thanks again,
Mike
0 Kudos
Message 6 of 14
(5,449 Views)
Did you try just putting the meter next to the PC and run it?

It almost sounds like you have a noisy environment.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 14
(5,449 Views)
Using the same computer, I attached a short (< 3ft) cable from the RS485 port to the mass flow meter transmitter. I then ran two experiments for a number of hours at 1scan/10 seconds. For previous experiments the line length was over 100 ft. The shorter length should rule out noise effects.

In the first experiment the second meter was connected first meter and the first meter was directly connected to the computer. Therefore, the total wire length was about 25 ft. Data were aquired from both meters during the test. The problem of erroneous data still existed.

In the second experiment the second meter was disconnected from the first. So the first meter was the only meter connected to the RS485 port and the
total wire length was about 3 ft. Data was aquired over night. Erroneous points still showed up in the data.

Any ideas? Experimenting with a newer computer is probably out of the question. Could it be my Labview program. I have a broken out the vi from my larger DAQ program and I've modified it (Labview v.5) so that it can run independantly. If you want to take a look at this program I can send you the files. Let me know.
Thanks again,
Mike
0 Kudos
Message 8 of 14
(5,449 Views)
Cont. from last message:

Also, there were erroneous results from both meters in the first test. When one meter showed an error for a specific scan, the reading on the other was good. So when the meters are running at the same time and one shows a bad result, the other may or may not show a bad result too.
0 Kudos
Message 9 of 14
(5,449 Views)
OK

Sounds like you have done what you could to rule out wiring.

One meter stepping the other also appears to ruled out.

Possiblities appear to be;

1) Old PC, (What kind of adapter are you using? Did you say this already?"

2) TWo funky meters.

3) Less than ideal code.

When you say erroneous readings, what knid of values are you getting and what are you expecting?

What kind of calls are you doing? You said you posted code but i did not notice it. I will look again after this note.

Are there any errors associated with the bad readings?

Have you looked for good grounding between the meters and PC?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 14
(5,449 Views)