ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
Hello, all,
I'm encountering an error with a VISA Read. The output value(bytes read) of VI(Bytes at Port) is 32 bytes, but I only get 8 back (Return Count)? Anyone know what's happening? VISA Read block oddly enough does not return an error. Any ideas on how to debug this?
Hi, GerdW
You got it, After disabled enable terminate character (VISA configure serial port ), everything is working fine. Thank you.
Sort
So you understand what your current issue is, but I have to state that using the Bytes At Port to determine how many bytes to read is generally a bad practice when the instrument sends out ASCII data. Most instruments use that termination character to state when a message is complete. So you tell the VISA Read to read more bytes than a message will be and it will just return the message. You can then process that message, loop around and read the next message. With the Bytes At Port, you can get multiple messages, partial messages, and who knows what other message synchronizing issues.
Preventing LabVIEW from Continuously Polling the Serial Port,I used an event handling to improve program efficiency. It's looking work well. Share it with everyone. FYI.
While that might work this is the generally accepted way of handling serial communications.
VISA Read will read the serial port until it receives a termination character or times out
@sort897 wrote:
Preventing LabVIEW from Continuously Polling the Serial Port,I used an event handling to improve program efficiency. It's looking work well. Share it with everyone. FYI.
I do not like to use the events for VISA. Depending on how the instrument works, I will either use Bytes At Port to see if any data has come in and then use a Wait or something if there is no data or I will just use the Read and let the timeout tell me that the instrument is not sending anything.
I really need to get those nuggets done...
hello,sort897
I use the bled112
It is occuring a error Service: 1800 and Characteristic 2A00 were not found when connection the device
your help would be very nice.
thank you
I'm sorry, but your message is not very clear. What are "Service:1800" and "Characteristic 2A00"? And "bled112"?
So far, nothing you've posted sounds related to what this thread was originally about.
You should post a new message thread that includes details, and perhaps your VI.