07-19-2018 02:16 PM
I am using the Find VISA Resources and it works great except for com ports that do not have a device attached.
In that case I get the following error pop-up.
How do I handle it?
07-19-2018 02:39 PM - edited 07-19-2018 02:40 PM
Clear the error if its a timeout.
07-19-2018 08:43 PM
@RTSLVU wrote:
Clear the error if its a timeout.
Got it. Thanks!
I was thinking I may be missing a better method than that.
What is your opinion of using Bytes At Port?
I have 8 ports. One is unused. One has a device that does not send '\n'
and six others that do send '\n' .
.
07-19-2018 10:47 PM
What does that one device that doesn't use \n do in its protocol to tell you when the message ends?
That's really a different question. This question was about finding the serial ports. It isn't affected by what protocol the devices use to communicate.
07-20-2018 06:07 AM
@nyc_(is_out_of_here) wrote:
What is your opinion of using Bytes At Port?.
It is evil to wire it to the VISA Read. You ONLY good use of the Bytes At Port is to see if any data has come in. Once you see data come in, then you use the protocol of the device to read the entire message. Never depend on the Bytes At Port to state when a message is complete because you will hit the race condition and you will not get all of your data. If the message length is fixed, then just read that number of bytes. If your message uses the termination character, then tell VISA Read to read more bytes than would ever be in the message and let it stop reading when it finds that termination character. If some other weird binary protocol, implement that protocol.
As was said, that is another topic. If you have more questions, start a new thread.
07-20-2018 07:01 AM
@crossrulzAs was said, that is another topic. If you have more questions, start a new thread.
The new thread is https://forums.ni.com/t5/LabVIEW/serial-ports-different-terminating-characters-also-no-device/td-p/3...
.