cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Take Data from a hardware and plot on graph

¡Resuelto!
Ir a solución

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
Mensaje 1 de 10
4.454 Vistas

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
Mensaje 2 de 10
4.446 Vistas

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
Mensaje 3 de 10
4.436 Vistas

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
Mensaje 4 de 10
4.428 Vistas

Okay Thanks..

 

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

0 kudos
Mensaje 5 de 10
4.424 Vistas

Hi Nayan,

 

yes, you can!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 kudos
Mensaje 6 de 10
4.418 Vistas

Thanks Buddy..

 

I will try..

0 kudos
Mensaje 7 de 10
4.409 Vistas

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
Mensaje 8 de 10
4.394 Vistas
Solución
Aceptado por el autor del tema 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
Mensaje 9 de 10
4.377 Vistas

Thak you very much.. It worked Guiño

0 kudos
Mensaje 10 de 10
4.355 Vistas