Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

read data from visa byte by byte wihtin time

hi..

 

   I have to read some bytes of data from VISA to interface with  rs485. For each 5 ms i can get one byte of data. if i couldn't get any data with in that time,then i need to grab that captured data and  plot a graph wth respect to time. 

Plz help me ...

Thanks in advance 

0 Kudos
Message 1 of 16
(4,360 Views)

I don't understand your question. You say that you can't get some data but then need to grab the data?

 

What language are you using? What code have you written so far? Can you post the program and show where you are having the difficulty?

0 Kudos
Message 2 of 16
(4,343 Views)

Thanks for quick reply.........

 am sorry i couldn't explain u properly.

   My requirement is ....

        i have to read the data from visa-read byte byte within time.i have to check whether that byte is null or not.

        am able to get whole data at a time,but not byte by byte.

   Thanks once again.

0 Kudos
Message 3 of 16
(4,311 Views)
Am not sure but is this what you are trying to explain?
0 Kudos
Message 4 of 16
(4,300 Views)

Thank you so much for your response.

 

Accroding to my project ....

  one RS485 port sends the data countinously.After every 56 bytes of data it is goning to send a byte of null character.
what i have to do is to get the 56 bytes of data between those null characters.For the first time when i start my application the data might be starts reading from any byte.So after getting the first null character i have to read 56 byte of data.

This is what i want to explian.

 Thank a lot.

 

 

0 Kudos
Message 5 of 16
(4,289 Views)
A NULL character is 0x00 so you just have to read one byte at a time and compare the results to that. Right click on a string constant and select 'Hex Display' and enter 00.
Message 6 of 16
(4,286 Views)

oh! 

 

  Thank you guys ...

0 Kudos
Message 7 of 16
(4,264 Views)

Hi Dennis...

my instrument continuously send out 56 bytes of data for every 0.5ms at 2000000baud rate ,that is  connected to serial port of a NI PXI box.After sending 56 bytes,a gap of 220microseconds will occur to complete 0.5ms(which means one complete transmission of data.One byte of data will sent within 5microseconds).
Then it starts sending data second time.
I want to extract all 56 bytes from every transmission continuously.

So the problems is to identify how to find that gap,and get the data from first byte.Our port would start reading the bytes any palce.

Plz Help me out in this issue.

Thank you.


0 Kudos
Message 8 of 16
(4,245 Views)
Does the instrument send anything out to indicate an end of data transmission? Often, an instrument will terminate the data with a character such as a CR or LF.
0 Kudos
Message 9 of 16
(4,237 Views)

 

No it's not going to send any termination character.

Within 0.5ms it sends 56bytes(in 280microseconds) and a gap of 220micorseconds(Total 500microseconds).We may start reading the bytes at point of time.We have to get the data from first byte to 56th byte,then wait for 220microseconds,again doing the same.

For the first time when we run our application we may leave the first transmission coz ,it may not start from first byte.

 

Thank you so much for your response...

 

0 Kudos
Message 10 of 16
(4,229 Views)