09-28-2010 12:53 PM
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
Solved! Go to Solution.
09-28-2010 12:59 PM
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.
09-28-2010 01:22 PM
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
09-28-2010 02:52 PM - edited 09-28-2010 02:54 PM
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.
09-28-2010 03:20 PM
@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.