Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

Viewing Continuous Stream of Data

Is it possible to view a continuous stream of data using the Serial When I try to setting the number of bytes to a very large number a framing error occurs. Is there a way around this
0 Kudos
Message 1 of 4

no _single_ CPU can do two or more things in parallel. So strictly said, one cannot view a continuos stream of serial data. BUT, of course, one can though. Just break your data stream in small chunks. Receive one chunk, display it, maybe save it and continue with the next chunk. Repeat this until you are done or an error occurs or no more data where received. If there's more to do with your data you may break down the receiving process and the processing into two independend processes (for instance by putting them into different While loops). Transfer the data chunks and some kommand (e.g. 'stop') by means of queues or so.

HTH and
Greetings from Germany!
0 Kudos
Message 2 of 4
Could you be more specific? I have obtained a snapshot of the input data and created a graph of this but I am wondering how this could be looped to operate over a longer period of time
0 Kudos
Message 3 of 4
Kilyg, hope this attached .jpg helps but you will need to expand on this for your application.

What you need to do is continously pole the serial port checking for bytes to read within a while loop. This loop doesn't have to pole that fast. Prior to this you will need to open a conection to the resource. This will bring in all the data when available from the port unless you terminate the loop and close the resource of course.

What you will need to do as the serial port could be set in the region of K Baud, is to buffer the data as there is too much to display realtime at any one time on the screen. When you have receieved x points you will then want to update the screen only once! This will also save resource as your not accessing the screen (hardware) as much.

Hope this helps.

Kind Regards

Steven Bird
Applications Engineer
Natonal Instruments
0 Kudos
Message 4 of 4