LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I communicate with this unique instrument?

Solved!
Go to solution

I have this gaussmeter from a vendor that doesn't do scpi, does some proprietary output. I have a huge file with some example output that I have to figure out but first, I would like to start just accepting data from it. I have a Prolific Usb-to-Serial com4 bus setup I just need some guidance on how to setup the VISA connection. I saw in another similar post about needing to use a serial settings object among some other things. I'm told it uses RS232 standard protocol it's just the data is not SCPI. If anyone could give me a small hand I would appreciate it. I've posted the small bit of code I have so far but I know I need a few other pieces like setting the baud rate and all that, pretty simple.

0 Kudos
Message 1 of 8
(2,390 Views)
Solution
Accepted by topic author crash_override

I'd start with an example- Continuous Serial Write and Read has a lot of stuff in it, but once you figure out what your particular device needs you can go from there.

 

The vendor will have to tell you what the baud rate, packet setup, and flow control is. Typical settings are 8 data bits, no parity, 1 stop bits, and no flow control. Common baud rates are 9600 for very old stuff and 115200 for newer stuff. You can always just iterate through and guess at settings but it's going to be a crapshoot to stumble upon the right settings.

 

Hopefully the instrument communicates via ASCII, or you'll need to figure out a way to encode and decode the binary commands it's trying to send.

 

Your code is fine as it is, though I'd include some error wires. You just need to wire up the settings to VISA Configure Serial Port.

0 Kudos
Message 2 of 8
(2,376 Views)

Your VISA resource name should be formatted as "ASRLx", where 'x' is the comm port number. You should check with the manufacture of the device to see if they have documented the protocol used to communicate with the device.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 8
(2,372 Views)

I have the info on the baud rate and all that thankfully so I'm not in the dark there. I will try and find that template example, I don't think I have it. As for the "ASRLx" format, how do I do that? The protocol is not really documented but I have an output of what it sends and I will link it here. I added the line spacing to separate the lines for reading but everything else is exact. It has somewhat unpredictable behavior but all I really need to do is do an equivalent of a strncat() function from the C language on some of the lines that contain the AC measurements. The main thing is just to start getting this data stream so I can run some string functions on it.

0 Kudos
Message 4 of 8
(2,342 Views)
Solution
Accepted by topic author crash_override

The LabVIEW examples can be located by going to the help int he menu bar and click find examples. Type in the example referenced above and you should be all set.

 

Looking at the text file it looks like building the interpreter should be straight forward.

Tim
GHSP
0 Kudos
Message 5 of 8
(2,327 Views)

Thanks very much, I did not know bout that section of the program. Thanks to that, I found it.

0 Kudos
Message 6 of 8
(2,318 Views)

In your example text your serial port is formatted as COM1 or COM3 or something, not ASRLx. It's just a different way different instruments show up, and I think you can set the formatting in the control you use to specify an input.

0 Kudos
Message 7 of 8
(2,314 Views)

Since the data looks fairly well behaved, you may be able to use Unflatten From JSON with the proper cluster definition to decode the JSON data.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 8
(2,302 Views)