LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two synshronized Analog Inputs

Solved!
Go to solution

I need to plot a resulting newWaveform from these two waveforms A and B as follows :

 

newWfm = a*WfmA + b*WfmB

 

where b is a constant (for example '5')

 

'a' varies from 0 to 20 with a step of 1

 

I will have 20 newWaveforms (for each value of 'a')

 

Do you have any idea how to vary 'a' and plot the 20 Waveforms properly ?

 

Thank you !

0 Kudos
Message 11 of 23
(1,282 Views)

Use a for loop.

 

Message 12 of 23
(1,274 Views)

.

0 Kudos
Message 13 of 23
(1,265 Views)

Thank you very much for your answers.

 

Can we increment 'a' of more than 1 ?

 

The exact variation I am looking for is : 'a' varies from 0 to 1000 with a step of 50

0 Kudos
Message 14 of 23
(1,262 Views)

Sure. Instead of wiring to the iteration terminal, use a shift register. It can be initialized to anything you want and instead of the Increment function, use an Add function with a control for the step size. You can also use the Ramp Function with the type set to Ramp by Delta. This creates an array that you wire into the for loop. Then you don't connect anything to the 'N' terminal. Give both a try and see how far you get.

Message 15 of 23
(1,254 Views)

I removed the wiring from the iteration terminal and I added a shift register.

 

However, I can't find neither the "Add function with a control for step size" (for the 1st method), nor the "Ramp Function" (for the 2nd method).

 

Could you please just help me with the palettes or the forms ?

 

Thank you !

0 Kudos
Message 16 of 23
(1,248 Views)

Add is on the Numeric palette. Ramp Pattern is on the Signal Processing>Signal Generation palette. 

 

On your function palette, there is a button called Search. It would have found the functions quicker than posting here.

0 Kudos
Message 17 of 23
(1,244 Views)

Sorry, I was looking for the Signal Processing palette that wasn't in my functions.

 

Please, find attached one of the input channels with the Ramp Function. 

It should be well connected right ? what it the Ramp Pattern in the gray window ? It was on 0 so I adjusted it to 1 and then I marked 21 Samples (I am not sure if I need it).

 

Thank you !

0 Kudos
Message 18 of 23
(1,238 Views)

No, it is not at all 'well connected'. The output called Ramp Pattern is the array of steps and that is what you should be wiring to the for loop. With a delta of 50, an end of 1000, and a start of 0, you will have exactly 21 samples in the array.

0 Kudos
Message 19 of 23
(1,229 Views)

Thanks for having fun of my english ! Smiley LOL

 

 

I still have an error after the 'add' on the wires: the Time record 8 shows an error after the FOR loop.

Do I need to connect it to the output of the shift regiter ?

0 Kudos
Message 20 of 23
(1,222 Views)