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.
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..
(Kudos are always Welcome)
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...
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.
Placing a delay is not the solution.
Have a look at the code snippet that I posted here:
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.