LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa read byte at port

Solved!
Go to solution

On my VISA read, I feed in the bytes at port property node as input for how many bytes to read (it is 4 byte).  However, the output of the visa read only give out 2 byte.  It seesm like some bytes were lost during the read operation?  Why is that?  It there an easy to see what is in the buffer of the serial port?  Thanks!

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 1 of 5
(4,764 Views)
Solution
Accepted by topic author jyang72211

You probable have the VISA session configured to end reads when it sees a termination character, and the VISA Read is seeing the termination character, and ending the read, regardless of how many bytes you told it to read. If you want it to explicitly read that many then you need to turn off the "Enable termination character" option in VISA Configure Serial Port.

Message 2 of 5
(4,759 Views)

Hi Smercurio,

 

That fixed my problem.  Sweet!!!!  Before I use the VISA Configture Serial Port function, I tried to just use a property node to change termination character enable to false for the VISA, but that didn't work.  Why is that?  This change in the program is termporary, right?  So I need to make sure I change the option before I start all my program, correct?  If I change that in MAX, would I be changing it permanantly?  Thanks!

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 5
(4,749 Views)

Configure Serial Port VI does configure the termination character.  So if you tried to do something with it before then ran that VI, you may have just undone whatever you just did.

 

With nothing wired into those connectors of the VISA configure Serial port, the defaults are to enable the termination character and set it to the line feed character.

Message 4 of 5
(4,737 Views)

 


@jyang72211 wrote:

Hi Smercurio,

 

That fixed my problem.  Sweet!!!!  Before I use the VISA Configture Serial Port function, I tried to just use a property node to change termination character enable to false for the VISA, but that didn't work.  Why is that?  This change in the program is termporary, right?  So I need to make sure I change the option before I start all my program, correct?  If I change that in MAX, would I be changing it permanantly?  Thanks!


 

Any property change is in place for as long as the VISA session is active. As Ravens Fan noted, VISA Configure Serial Port sets the termination character and enables/disables its operation. Not to sound too obvious, but please look at the documentation for the VIs you intend to use to see what they actually do.

 

As for MAX, that would have no bearing on it.

Message 5 of 5
(4,731 Views)