LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

polymorphic multiply function with waveform problem

I have two VIs that do the same thing: they take an 11 channel task for a DAQ device and send the waveform from the DAQ acquire VI and send the waveform to a few select signals express VIs to select the needed signals  for charts in a for loop. This works well. So I added in a polymorphic add VI  into the waveform wire before the select signals VI and with the waveform input and a waveform constant into the other input. I used a dt of 0 and entered a bunch of constants into the data array, 2 & 1. Upon running the code it did exactly what I thought that it should do.  However, the other, duplicate VI, that uses the split signals and merge signals VIs instead of the express VIs were used the send the appropriate signals to the various charts for signal display. Again all went well and the VI worked exactly as expected. However, upon installing a polymorphic multiply VI into the waveform before the split signals VI , and adding in a waveform constant to the other input of the add VI, and entering constants into the data array just as in the first VI, I had a wierd problem!  The charts show no plot lines, only one value at the very begininng of the chart! Disabling the multiply VI again shows the charts working as expected! This is totally wierd. The probe tool does show the selected values going into the chart and the amplitutes look OK with and without the multiply VI. Any ideas?

0 Kudos
Message 1 of 8
(2,724 Views)

The dt of 0 is a flag to me.  I'll have to play to see exactly what this would do to a waveform.  Other than that, show us some code so we can help debug this thing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(2,715 Views)

Hi hounddog, what is that you are trying to achieve with the multiply function, there may be other ways to make it work?

 

Eric NI

0 Kudos
Message 3 of 8
(2,701 Views)

I've included a code capture of the VIs in question: one front panel and two block diagrams. Both of these worked before I installed the polymorphic multiply functions into both of these VIs.  The express version worked as expected: however, the split and merge VI version does not work. Before I modified both VIs to add the polymorphic multiply VIs they worked,and the problem occured after modifying them. I can't think of anything that I did wrong.

0 Kudos
Message 4 of 8
(2,700 Views)

The signal into the DAQ device was beyond the input range so we cut the signals in half. After retrieving the signals I added in a polymorphic multiply function onto the waveform to chang the signal levels back to where they were.  I know I could have gone into Max and set up a scale of two to fix up the inputs at half scale to begin with, but I didn't think of that until I added in the multiply function.  You can see the other post if you want to see the code.

0 Kudos
Message 5 of 8
(2,696 Views)

Hi cuthbert, what about using probes in the wires before going to the second "merge signals" do you see the correct data? Or maybe even after the "merge signals". By the way I am sure you noticed it too, but the multiply VI is in the "disabled" selection case, rigth?

 

Eric NI

0 Kudos
Message 6 of 8
(2,677 Views)

There are two VIs that do the same thing. The VI with the express select VIs has the multiply enabled because this VI works. If you look at the other VI the enable diagram has a the multiply function in the disabled portion since the VI does not work when this is enabled. And that is the question, why doesn't this VI work when the multiply VI is enabled in this code! The code in both VIs is the same!!

0 Kudos
Message 7 of 8
(2,658 Views)

Since you are dealing with waveforms, there is an error in and error out terminal on the multiply.  Have you checked what the error out is when it doesn't work?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(2,648 Views)