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

So, when you use Hyperterminal, the data bytes keep getting appended to the one line?

 

I don't have any ideas right now. Maybe setting someone else has a good idea.

0 Kudos
Message 11 of 16
(1,387 Views)

If you can plz go through this...

 

From one vi am sending 56 byte of data with time delay of 0.0005s.
From second vi am receiving the data byte byte with time delay of 0.000005s.

What i just need is to get the exact 56 byte's of data atleast for one time.

Am attaching the two vi's if you can plz go through that and give me a direction.

Thanks you for your support

Download All
0 Kudos
Message 12 of 16
(1,380 Views)

There's not much use in running either of those if you are attempting to emulate the instrument. In the first VI, you should not be configuring the port with each iteration and second, it both loops you are attempting delays much smaller than what windows will resolve. Don't expect anything better than 1msec resolution and don't be surprised by 5-10 msecs.

 

I asked earlier how the data appears in Hyperterminal. Have you actually done that with the real instrument and not simulated in LabVIEW?

0 Kudos
Message 13 of 16
(1,376 Views)

First of all i jst want to say am a new user for Labview.I may not explain you properly.Plz cooperate with me.

 

First vi is nothing but the data that what comes from real instrument.I just looped the sending port with my com port for testing purpose.
I dont know how the data will be there at real system.Accroding to the specifications i gave the query to you.

But the communication is at 2000000/baudrate,for one transmission it takes 0.5ms.

 

Plz let me know how to identify, wihtin some time dealy any data is coming from visa port or not.

 

Thank you.
0 Kudos
Message 14 of 16
(1,370 Views)

I'm still a little confused. Are you saying that you do not have the actual instrument yet? If that's the case, do you have a manual that you could attach?

 

At the baud rate you have and as I have already stated, I don't have a good idea on how to synchronize your data. From your description and VIs, there is no termination character or handshaking. One or the other would be typically used.

 

And please stop repeating the baud rate, etc. Once is enough.

0 Kudos
Message 15 of 16
(1,365 Views)

Dennis is right, it is almost impossible to synchronize serial data as you are explaining without either large time gaps or something identifying the start or the end of the packet. This is just one of the weaknesses of serial communication--everything is just one long run-on stream of data.

 

Since you have said that you are running at 2 MBaud, I am assuming that you are using a PXI-8431 serial board? I do have one idea that may help, although I don't think it will be foolproof. You can set the Rx Trigger level of your FIFO (On the Advanced tab in MAX) to 56. This will cause the 8431 board to transfer data back to the PC only after it has received a chunk of 56 bytes, or after a time gap of 20 microseconds (4 byte-times). In order to find the start of your data, you could test the number of bytes at the port, and discard all the data until you start receiving data in multiples of 56.

 

This makes a couple assumptions about your instruments:

 

1. Once the instrument starts sending these 56 byte packets, nothing else is inserted between them.

2. When your instrument transmits, the 56 bytes all get sent continuously with no gaps between bytes. If your instrument pauses during the transmission to reload a FIFO or anything, you could actually hit the "four byte-time" trigger instead of the "56 byte" trigger, and this approach would not help at all. 

 

Hopefully there will be something you can identify in the data. Didn't you mention some NULL characters earlier? If your data is surrounded by NULL characters (With a guarantee that no nulls exist within the data), then you should be able to locate your position with those.

 

-Jason S. 

 

0 Kudos
Message 16 of 16
(1,341 Views)