09-24-2014 05:35 AM - edited 09-24-2014 05:40 AM
Hello..
I want to take a sample data from a microcontroller based hardware and plot it on a waveform graph.
The hardware is communicating in serial.
If I will send wavform points of a sin wave of 1kHz in 1sec, so I should get 1 complete wave.
But even after increasing the baud rate the wave will not have a perfect time scale.
So I should send time values also.
In which format should I send and recieve the commands to or from the Microcontroller ???
Solved! Go to Solution.
09-24-2014 05:42 AM
Hi Nayan,
that question is to be discussed with the vendor of this "microprocessor based hardware"!
If I will send wavform points of a sin wave of 1kHz in 1sec, so I should get 1 complete wave.
What is a complete wave (aka period) to you? The wave will be complete even with just 10 samples…
09-24-2014 05:54 AM
If I will set sampling frequency as 8k then It will be a complete wave (1k freq).
But if I wil send only the single array of points (not timestamp), it dont know the graph will show the exact wave.
So I need to send timestamp also,
I just want to know in what format (String commands to VISA) should I send and receive the data....
09-24-2014 06:00 AM
Hi Nayan,
timestamp format isn't exactly defined. LabVIEW has it's own format, but your µP will probably use something completely different. You need to define the format on your own - or depend on the capabilities of the µP board.
Why do you thin you need a timestamp? When your DAQ hardware uses a constant sample rate the dt between the samples is fixed and known! The graph will show the "exact wave" in this case!
If I will set sampling frequency as 8k then It will be a complete wave (1k freq).
You will have 8 samples per sine period, when the sine has a frequency of 1kHz and you read samples at 8kS/s…
09-24-2014 06:05 AM
Okay Thanks..
Means you are saying that I can set 'dt' of the waveform in 'Build waveform' function ??
09-24-2014 06:13 AM
09-24-2014 06:26 AM
Thanks Buddy..
I will try..
09-24-2014 09:14 AM - edited 09-24-2014 09:15 AM
Hey..
I tried a little.. I got another problem..
I am setting a sin wave of 10Hz frequency to have 1000 samples..
The sine values before sending is showing the full wave..
Also when I recieve the points by VISA, total points are recieved.
But when I am trying to use Build Waveform function, I am getting only 200 points in a wave.
Please refer the attached vi.
09-24-2014 02:09 PM - edited 09-24-2014 02:10 PM
Hi Nayan,
But when I am trying to use Build Waveform function, I am getting only 200 points in a wave.
That's because you're using the shift register (and the array it holds) wrong!
You made several mistakes:
- your array constant is set to contain just 201 elements. Why did you use that arbitrary value?
- you used the ReplaceArraySubset function. The approach is nice, but with your limited array constant it fails: you want to replace 1000 elements in an array, that only contains 201 elements. This will never work…
You need to learn to use AutoIndexing of loop tunnels!
Possible solution:
P.S. using a timeout of 1000s is most often just wrong…
09-25-2014 12:21 AM
Thak you very much.. It worked