12-06-2016 03:01 PM
Hello,
I am using LabView 2010 and serial communication with VISA vi.
When using VISA write, every sent commands start with a null character. And I cannot avoid it?
What can I do to discard this unwanted null character?
Thank you in advance for your help
Solved! Go to Solution.
12-06-2016 03:03 PM
12-06-2016 03:19 PM
Hi GerdW,
Thank you for your reply.
Here is an example of what I did.
The issue is that doing this, my device receives the string with a null character before.
Best regards
12-06-2016 03:56 PM
12-06-2016 04:21 PM
Hi, your problem is the VISA CLR node. Visa Clear sends a break character which your device is seeing as a null. Use Flush Buffer instead if you need to, it will not send the break.
Hope this helps,
Michael.
12-06-2016 04:26 PM
Remove the VISA CLR. It writes a NUL charater. Go figure.
Technically it writes an empty string after changeing the end mode to "Break", which is a start bit no data, for 250mSec and a stop bit but that would be a NUL.
12-06-2016 04:34 PM
Are you telling me to go figure? are you tellling me i am ignorant and stupid? maybe i was not 100% accurate but im trying to help.
It is late at night and i am posting from mobile without LabVIEW open.
12-06-2016 04:44 PM
Michael, we cross posted. I was writing my response at the same time you arrived at the exact same correct answer. No insult intended! Heck, I didn't even know you were chiming in;)
12-06-2016 05:02 PM
Yeah, should have guessed. Sorry. making me laugh now
Back to the subject in hand. We can't see the rest of the program, but it is worth mentioning that it would be very bad practice to call this VI frequently. keep the port open rather than continuously reinitialising it. Close the end at the end of the execution. Clear buffers whenever you need to , but sometimes clearing buffers is just masking another problem where not all characters are being correctly sent/received from previous commands.
I hope this is helpful too
Michael.
12-07-2016 03:16 AM
Without VISA CLR it works well.
Thank you all for your help !
Best regards
gege