LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication - VISA Write adding extra characters

Hello 

 

I use LabVIEW 2018.

I do  a simple serial communication to external drive connected on COM port.

I use VISA configure serial port VI, then VISA Write and then VISA Read, then clear VISA and last Close VISA VI.

First time when I run the this program, serial communication works fine no problem.

But second time when I run, I do not get any error but serial Write is not done properly.

I am guessing that along with the VISA write, some other characters are going to port.

Or some characters are hanging in the port.

My termination character is false. The device does not need termination character.

How to clear the memory in device? I used Clear VISA port VI, that is not helping.

 

 

Thank you

 

 

 

0 Kudos
Message 1 of 8
(1,998 Views)

Post your VI

0 Kudos
Message 2 of 8
(1,995 Views)

Please attach your code. What's the port standard (RS232-RS422-RS485)? How do you know about those extra characters (do you have a serial port monitor)?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 8
(1,994 Views)

@hemalathagopal wrote:

Hello 

 

I use LabVIEW 2018.

I do  a simple serial communication to external drive connected on COM port.

I use VISA configure serial port VI, then VISA Write and then VISA Read, then clear VISA and last Close VISA VI.

First time when I run the this program, serial communication works fine no problem.

But second time when I run, I do not get any error but serial Write is not done properly.

I am guessing that along with the VISA write, some other characters are going to port.

Or some characters are hanging in the port.

My termination character is false. The device does not need termination character.

How to clear the memory in device? I used Clear VISA port VI, that is not helping.

 

 

Thank you

 

 

 


When something like this happens, 99% of the time it is a failure of the developer to completely understand the communications protocol.  In addition to the code, it would be very helpful to have a copy of the manual or whatever defines the protocol.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(1,979 Views)

Hi 

 

Problem got solved by adding the VI VISA Flush I/O Buffer.vi in the end before Close VISA ref.vi

 

Thank you 

0 Kudos
Message 5 of 8
(1,932 Views)

Hi 

 

Problem got solved by adding the VI VISA Flush I/O Buffer.vi in the end before Close VISA ref.vi

 

Thank you 

0 Kudos
Message 6 of 8
(1,930 Views)

That's one way to do it, but it's far more likely you are doing something else wrong, if you need buffer flushing in order to run your vi a second time.

0 Kudos
Message 7 of 8
(1,927 Views)

@hemalathagopal wrote:

Hi 

 

Problem got solved by adding the VI VISA Flush I/O Buffer.vi in the end before Close VISA ref.vi

 

Thank you 


It's not solved; it's covered up, just waiting to bite you again when you find out those "extra" characters actually mean something later on down the road.  You don't deal with an issue by ignoring it.  (Usually.)  This is like "solving" your termite problem by painting over the damaged wood.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(1,898 Views)