LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merging signal from serial communication with simulate signal

Hey everyone! I'm having trouble merging a signal I get through serial communication from arduino with a simulated sine wave.. I'm using a simple Merge Signals function. I will want to use these 2 waveforms to find the phase difference.. But I'm unable to merge these two signal to either a waveform graph or chart.

 

 

The signal I get from serial communication outputs to a waveform chart and I was actually thinking whether it is possible to display it on a waveform graph? Because, I can't display the signal to a waveform graph.. If I can display the signal on a waveform graph, I can get the 2 waveforms to display on the waveform graph.

How can I solve this?

0 Kudos
Message 1 of 12
(4,674 Views)

Hi lamela,

 

from your other thread you should have learned to provide not just FP images, but also exmple code as VI or snippet!

 

What kind of help do you expect, when you just show an image of a graph (left) and chart (right) with an empty graph in between?

 

The signal I get from serial communication outputs to a waveform chart

No, it does not output a chart! You are the one who uses a chart to display that signal!

Please use correct wording!

 

I was actually thinking whether it is possible to display it on a waveform graph?

Yes, that's possible.

LabVIEW comes with a lot of example VIs. And there are also examples showing how to use charts and graphs!

Best regards,
GerdW


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

Hi! Thanks for your reply!

But if I use a waveform graph for the input signal, it won't show anything on the graph.

0 Kudos
Message 3 of 12
(4,592 Views)

Hi lamela,

 

I think I already recommended NOT to use DDT for such simple VIs…

 

Easy solution for your problem: change the plot properties of your 2nd graph to show points and lines. Then you will see you are already displaying two plots in this graph!

Example:

check.png

(I replaced your whole loop by a RND() function.)

 

More advanced (and probably wanted) solution: build a "real" plot by collecting your data in an array in the loop.

 

Again: please use the example finder in LabVIEW to learn about such basic stuff!

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(4,568 Views)

Ok, but it does not show both the waveform on the graph? I was thinking to use like strings to waveform but I could not find a way to do it. 

What other alternatives can be use to merge both the signals?

Thank you!

0 Kudos
Message 5 of 12
(4,495 Views)

Hi lamela,

 

as has been said before: collect your data in an array.

As is shown in the example VIs coming with LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(4,480 Views)

Hmm.. I've tried a couple of conversion to array like string to byte array and etc.. I want to store the changing numeric to array so it won't just keep updating the array, then I can display it on the waveform graph. Do you think this will work? What should I do?

0 Kudos
Message 7 of 12
(4,394 Views)

Hi lamela,

 

I've tried a couple of conversion to array like string to byte array and etc.

How are these conversions related to any "data storage issue"?

 

What should I do?

At first you should NOT post just images of your front panel.

Nobody can tell you what's wrong, when you don't show your BD or VI!

 

Attach your current VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(4,327 Views)

Ok, I built the array from the string conversion but it doesn't store the value in the array, it just keeps changing. Also if I use string to byte array conversion, how do I change it to numeric value to plot on the waveform graph?

0 Kudos
Message 9 of 12
(4,321 Views)

Hi lamela,

 

you still don't be able to build an array and store data from previous iterations!

 

I built the array from the string conversion

Yes, you built an array from your string conversion.

BUT: you built it from just one value of the current iteration. Where do you store those values to keep them for next iterations?

 

Learn about using shift registers: This is explained in the beginner courses offered for FREE on NIs website!

Learn about using autoindexing: This is explained in the beginner courses offered for FREE on NIs website!

(And get rid of that DDT wire.)

 

but it doesn't store the value in the array, it just keeps changing.

Yes, that's how you programmed it!

 

Also if I use string to byte array conversion, how do I change it to numeric value to plot on the waveform graph?

I don't see the point in this question. When you have a byte array you can immediately show it on your graph…

Best regards,
GerdW


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