LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use math formula on waveforms

Hi all,

I'm trying to create a program that can use math scipts, formulas etc on waveforms. I've done it for one signal, but I don't know how to change work on 2 or more signals;/ Let's see exampe: one channel is voltage, the second is current and I want to see both of them and as a third signal power so I'm writting formula ch3=ch1*ch2. Another example: I've signal which represents speed of starting motor (500 points) but I need only few points so the formula will be: ch1(20:120) and I have points from 20 to 120. Is it possible to do it? I can't do it using blocks cause I don't know which signal means what... so ch1 can be voltage, ch2 speed, ch3 current ch4-torqu etc. I know that I can cut a part of signal by subarray or subwaveform but it must be done by formula to use (for example) something like that:

ch1(1:20)=0 <- replace all point from 1 to 20 of ch1 by 0

ch2(50)=40 <-replace point 50 of ch2 by 40

ch3=ch1*2 + ch2 <- do this operation but first do both above this one.

 

Is it possible? or it's to complicated?

I attached my vi which is working for one selected signal (I don't want to select it... but I don't know how to do it;/) and signal that I'm using to check how it's work

 

Thanks

Mike

 

Download All
0 Kudos
Message 1 of 6
(5,167 Views)

I've upgraded it a little and it works with 2 signals but very sensible;/ formula must have this construction: c3= ... , both of signals must be switched on, there's no way to use part of signal (e.g.c1(21:54) ) and I can't use 2 rows (something like this: c3=c1*c2; c3=c1 doesn't work);/ additionally I wanted to have possibility to use all of signals as input and all of them as output

0 Kudos
Message 2 of 6
(5,147 Views)

edit:

I forget to save vi for previous version

Now I attached my vi for LV 8.6, and I hope now someone can help me:)

0 Kudos
Message 3 of 6
(5,130 Views)

Your small express VI that converts the blue dynamic datatype wire is wrong.  You have it set to convert to a single waveform, thus the reason you are only getting one waveform.  Change it to be a 1-D array of waveforms.  Now you can use index array to get at each waveform individuallyk.

0 Kudos
Message 4 of 6
(5,121 Views)

@Ravens Fan wrote:

Your small express VI that converts the blue dynamic datatype wire is wrong.  You have it set to convert to a single waveform, thus the reason you are only getting one waveform.  Change it to be a 1-D array of waveforms.  Now you can use index array to get at each waveform individuallyk.



Yes, but when I change it I can't connect it to "Get Waveform Components" ;/ this problem is just addition to my general problem - how to make formula more advanced etc - my first post in this topic

0 Kudos
Message 5 of 6
(5,105 Views)

Because then you have an array.  As I said, you need to use index array to get each individual waveform out of the array.  Then you can use Get waveform components on the output from the Index array function.

0 Kudos
Message 6 of 6
(5,102 Views)