LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA write add null character before each command

Solved!
Go to solution

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

0 Kudos
Message 1 of 10
(2,289 Views)

Hi gege,

 

please show your VI including all information about the configuration of the VISA reference…

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 2 of 10
(2,287 Views)

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

0 Kudos
Message 3 of 10
(2,267 Views)

Hi gege,

 

what happens when you delete this property node?

check.png

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
Message 4 of 10
(2,232 Views)
Solution
Accepted by topic author gege91

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.

Message 5 of 10
(2,214 Views)
Solution
Accepted by topic author gege91

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.


"Should be" isn't "Is" -Jay
Message 6 of 10
(2,212 Views)

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.

0 Kudos
Message 7 of 10
(2,204 Views)

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;) 


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 10
(2,201 Views)
Solution
Accepted by topic author gege91

Yeah, should have guessed.  Sorry.  making me laugh now Smiley Wink

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.

Message 9 of 10
(2,197 Views)

Without VISA CLR it works well.

Thank you all for your help !

 

Best regards

 

gege

0 Kudos
Message 10 of 10
(2,168 Views)