06-29-2021 03:06 PM
Using an industrial weight scale with simple serial communication output. It's configured and talking with labview.
I leveraged the code is from the RS232 calling vi - https://forums.ni.com/t5/Example-Code/Read-status-of-RS232-serial-lines/ta-p/3499317
Now I just need to parse the string and convert it to a numeric value so I can use the signal for other data processing objectives. Any feed back would be much appreciated
Solved! Go to Solution.
06-29-2021 03:24 PM
08-20-2021 02:09 PM
Here's the code that gives reasonable outputs - not sure how to solve the chatter, any thoughts would be great
08-20-2021 02:19 PM
What scale are you using? Do you have a link to the manual? I'm mostly looking for a clear definition of the communication protocol.
Based on the scale putting out ASCII characters, I would almost guarantee that you should NOT be using the Bytes At Port and you should enable the termination character. Then you just tell the VISA Read to read more bytes than you should ever get back in a message. This way you will know you got a complete message. Then you are just parsing a single, full message. As you have it now, you could have part of a message, multiple messages, or any weird mix in between.
08-20-2021 02:23 PM
Your are more than likely correct - I'll give it a go right now and see what happens. Attached is the manual.
08-20-2021 02:40 PM
Thanks for the suggestion, much appreciated, but the Scales data didn't read in however
08-20-2021 05:12 PM - edited 08-20-2021 05:13 PM
It would most likely help if you not only connected the boolean True to the Termination Character Enable to the VISA Serial Port Config (which isn't really necessary since it is the default) but also a constant with the value decimal 13 (or hex 0xD, <carriage return>) to the "termination char" (default is 0xA, <line feed>). This should make sure that you receive with every read exactly one line.