LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Take Data from a hardware and plot on graph

Solved!
Go to solution

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 ???

0 Kudos
Message 1 of 10
(2,964 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(2,956 Views)

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....

0 Kudos
Message 3 of 10
(2,946 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(2,938 Views)

Okay Thanks..

 

Means you are saying that I can set 'dt' of the waveform in 'Build waveform' function ??

0 Kudos
Message 5 of 10
(2,934 Views)

Hi Nayan,

 

yes, you can!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(2,928 Views)

Thanks Buddy..

 

I will try..

0 Kudos
Message 7 of 10
(2,919 Views)

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.

0 Kudos
Message 8 of 10
(2,904 Views)
Solution
Accepted by Nayan

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:

check.png

P.S. using a timeout of 1000s is most often just wrong…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(2,887 Views)

Thak you very much.. It worked Smiley Wink

0 Kudos
Message 10 of 10
(2,865 Views)