Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Serial Comunication timing/receiving/buffering problem

I am sending ASCII string from and MCU into a Zigbee transceiver system that is used to receive the information at the PC using Labview's Basic Serial Read and Write vi. I have confirmed with HyperTerminal and the Zigbee utility that the information that I am sending from the MCU is being received correctly and consistently, that is to say I am sending S plus three numbers and E  with ms delays in between each character (e.g. S 1 2 3 E) . This information will later be stripped of the S and the E and the numbers will be used to graph it against time.

Problem I am having is that the vi sometimes eats the S, the E or sometimes one or more of the digits even if I choose I/O Synchronously or I/O Asynchronously. When I run example without additions in continuous mode sometimes it captures the data correctly,but if I stop the program and run it again it is sure to start dropping one or more of the characters.

I have tried increasing the buffer and playing with the read delay or timeout option but still I have the same problem with Labview. I have looked at other posts where people were having serial communication problems, but none of them seem to be addressing this particular problem.

Baud Rate=9600
N=8bits
Parity=None
Stop bit=1
Flow Control=None

o/s=WinXp
1.8Ghz
760MB RAM

I am attaching the modified vi and the capture of hyperterminal for your reference. What am I doing wrong as serial comm is straight forward yet I seem to be having a problem with it.

Message Edited by Mrjazzitup on 08-23-2007 05:52 PM

Download All
0 Kudos
Message 1 of 5
(3,861 Views)
Try it without doing the VISA Configure Serial Port and VISA Close inside the loop. There is no need to do either more than once.
Message 2 of 5
(3,850 Views)
You mean do Visa Configure or Visa Close inside or outside of the loop or do neither inside or outside of the loop?
0 Kudos
Message 3 of 5
(3,843 Views)
Neither VISA Confgure Serial Port or VISA Close should be inside your loop. The VISA Configure should be outside the loop on the left side and the VISA Close should be outside the loop on the right side. If you are confused, look at the shipping example called Advanced Serial Write and Read. It has a loop that just does the Write and Read. This is how your VI should be structured.
Message 4 of 5
(3,840 Views)
Nice, it works now. Thanks a bunch
0 Kudos
Message 5 of 5
(3,836 Views)