04-29-2014 05:20 AM
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).
04-29-2014 06:43 AM
04-29-2014 07:33 AM
@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 '*'.
04-29-2014 07:33 AM
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.
04-29-2014 07:38 AM
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.
04-29-2014 07:50 AM
04-29-2014 07:53 AM
I have tried your suggestion too. But it didn't work. Do I need to change graph/chart settings?
04-29-2014 07:58 AM
To Dennis:
here is the block diagram..
04-29-2014 08:01 AM
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.
04-29-2014 08:04 AM