Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Real Time data From VISA and plot on graph

Hello.

 

I have a hardware which contonuously sends Sine wave data seperated by character (*)

e.g. -0.9999*0.0000*-1.0000 etc. (attacheed Hyperterminal snap)..

 

The Sine wave has sampling rate 16 kHz.

 

I want to Read these readings and plot them over a graph which would be a Sine wave of 16 kHz sampling rate.

(An Oscilloscope like structure).

0 Kudos
Message 1 of 23
(7,130 Views)
What programming language? If LabVIEW, you can set the termination character to the + sign and do a VISA Read inside a while loop, convert the string to a numeric, and wire that to a chart.
0 Kudos
Message 2 of 23
(7,113 Views)

@Dennis_Knutson wrote:
What programming language? If LabVIEW, you can set the termination character to the + sign and do a VISA Read inside a while loop, convert the string to a numeric, and wire that to a chart.

I think Dennis means the '*'.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 23
(7,109 Views)

Thanks Dennis for the fast reply..

 

Yes, its LabVIEW.

I have tried doing the same that you have suggested.

The hardware has generated a sin wave of 1kHz frequency is sampled @ 16 ksps. It should be showing 1000 samples in 1 sec, but it isn't showing the same.

I am attaching the VI here. Please have a look.

0 Kudos
Message 4 of 23
(7,108 Views)

Try setting your bytes to read to something much larger than the data you expect.  I would recommend something like 15.

 

You should also be closing your VISA session after your WHILE loop.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 23
(7,106 Views)
Sorry about the typo.

Posting from phone. Can you attach image of the block diagram?
0 Kudos
Message 6 of 23
(7,102 Views)

I have tried your suggestion too. But it didn't work. Do I need to change graph/chart settings?

0 Kudos
Message 7 of 23
(7,100 Views)

To Dennis:

 

here is the block diagram..

0 Kudos
Message 8 of 23
(7,098 Views)

Ah, just noticed you are using a chart!  Really simple fix here.  You don't need to build the array.  The chart has its own history.  So just wire the output of the string to number function directly to the chart.

 

If you were using a graph, then you would need to build the array on your own.  The chart is the better option in this situation.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 23
(7,093 Views)
Crossrulz beat me to it.

p.s. The history length of the chart is a right click option. Default is 1024.
0 Kudos
Message 10 of 23
(7,090 Views)