04-26-2011 02:40 AM
Hi all,
I an using the serial write vi to send the command to the instrument. the response i get is read usin the read vi. i am using in between read and write the serial bytes at port to accumulate the bytes. bu what i have observed is quite strange. when i run the vi with the debugger on, i could c that the bytes at serial port is 201 and what i get in read buffer is only 133.
can any1 guess out what the prob would b??..
Solved! Go to Solution.
04-26-2011 03:53 AM
Hi,
Try to put a time delay between your read and write modules say 1000ms. You will get the full data i suppose by doing this. Let me know if it works..
Regards,
Nitzz
(Kudos are always Welcome)
04-26-2011 04:05 AM
ya i have already put the delay of 2000 msec. what i m tryin to say is i am expecting 201 bytes from the serial port.. and with the degugger i can c that there are 201 bytes at the port. but what i get in the read buffer is only of 133 bytes. the data i collect in the read buffer, i convert into array using string to byte array.
i am ttaching the snapshot of what happens...
04-26-2011 07:10 AM
You don't show the VISA Configure Serial Port function but I'm guessing you have the termination character enabled. A read will automatically terminate when the character is detected and you should never enable it when you are trying to read hex.
04-26-2011 07:17 AM
Placing a delay is not the solution.
Have a look at the code snippet that I posted here:
http://forums.ni.com/t5/LabVIEW/Reading-time-interval-of-serial-port/m-p/1529140#M568806
The modified code is also attached in that post.
The solution is to place the serial read inside a loop which continues to read until there is no more data in the buffer.