From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Termination Character on VISA Configure Serial

Hello All,

What exactly is the Termination Character on the VISA Configure suppose to do. I ask this because it seems to behave different on different PC's.

I'm doing work with CCD buses where each message is terminated with a carriage return. So I initialize the com port with the term char for that. I was getting some odd behaviour some PC's, so I wrote a small vi that just reads the port and dumps the data into an array so I could see what each read was doing.

On some machines, it seemed to work fine, each cell in the array had a complete message with the char rtn, on others the messages are split between 2 or 3 cells, or are just not all there.

Is there something about the port hardware that ha
s to able to use the term char? The machines that seem to work OK are newer Pentium 3s, the others that don't work are older Pentium laptops around the 100-150MHz range. The one exception to this is our PXI-8156B's. They show the same problem. All of the ports are setup the same in the OS, which are a mix of Win95, NT4 and 2000.

Any Thoughts?
Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 1 of 3
(2,704 Views)
The termination character is supposed to be pretty straight forward. It simply terminates a read operation when the termination character is read. I'm not sure why it would function differently on different machines. You might want to make sure you are using the same version ov VISA on all the machines, though I really would not expect it to make a difference. You can also use utilities such as NI-SPY to figure out what is going on. You may just have to change some of the VISA attribute settings. In LabVIEW you can do this with a property node or attribute node. Look at serial settings and message-based settings.
0 Kudos
Message 2 of 3
(2,704 Views)
Thanks for the suggestions.

I've done a bit more experimenting with my test vi and have found that the newer PC's also occasionally chop the messages up, though not as much as the older ones.

The one thing that I have found that basically eliminates the problem on all machines is to add a Wait timer in the loop and have the timer multiple adjustable on the front panel. Then by monitoring the number of bytes in the serial buffer, add delay to the timer to keep the buffer from being empty. It seems when the buffer gets completely empty, the read doesn't always wait for the term char, like maybe there's a timeout on the read operation.

I've also added some error corection using a shift register and scanning the messages for the char rnt. This has been wo
rking well for me. But it still seems you should be able to use term char by itself and get good results.

Thanks


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 3
(2,704 Views)