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?

Hi Ben,

I've determined the problem to be related to LabView.

After I send a string to the meter it sends back a response in ASCII characters. I then take part of the ASCII character string and convert to a floating-point number, which is the value I'm after. However, when the meter sends a linefeed or carrage return (0A in Hex), which do not have ASCII characters, the actual operation is performed in Labview. This is the problem, because additional data that should follow doesn't show up.

The meter should return 9 bytes of information everytime. However, if a carrage return is sent in byte 6, no bytes after are recognized or shown.

I'm not sure how to deal with this
problem. There must be a similar instance discussed on the LabView Forum. I'm also going to speak with the meter mfg. to see if they can help.

I have attached the vi's for the mass flow meter. There's also an example.txt file. This text file can be used with "Micro Motion_Writing ASCII text as Hex - new.vi". Copy the ASCII code (text file) and paste into the furthest left box (labview), then hit run and the corresponding Hex value is shown. The first example is indicative of when a carrage return is sent. Since there is no character representation, a return has to be manually entered. The second example represents a response with all the bytes.

Let me know what you think. In the mean time, I'm going to see if I can figure it out.

thanks,
Mike
0 Kudos
Message 11 of 14
(1,651 Views)
Quick reply, no time to look at your code!

You want to disable the termination character.

If you are using VISA, the "VISA Configure Serial Ports" has an input at the top you can wire up.

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

Tried just disabling the termination character, but this didn't work. However, disabling the termination character and enabling the "Suppress End" property worked!

Thanks for your help.

Mike
0 Kudos
Message 13 of 14
(1,651 Views)
I tried using the code that was posted to comunicate with a RFT9712 and have not had any luck.  I don't seem to get anything back.  I am using an NI PCI 485 card.  Any help would be apreciated. 
0 Kudos
Message 14 of 14
(1,556 Views)