01-22-2020 01:47 PM
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.
Solved! Go to Solution.
01-22-2020 02:05 PM
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.
01-22-2020 02:07 PM
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.
01-22-2020 02:52 PM
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.
01-22-2020 03:15 PM
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.
01-22-2020 03:29 PM
Thanks very much, I did not know bout that section of the program. Thanks to that, I found it.
01-22-2020 03:36 PM
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.
01-22-2020 05:05 PM
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.