From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-09-2015 12:44 PM
Hello NI Community,
I am new to LabView and was hoping someone might be able to help with a question I have. Right now, I am using a DAQ unit to sample an externally generated sinusoid and I would like to alter that signal by adding to it another signal that I could control using the front panel. Whenever I try to just connect the input with something like the sine waveform vi and put a subtraction sign between them it doesn't work (I get an empty waveform graph). To get around this, I have resorted to sending out a signal (through an analog output) and then reading the signal on the Daq, and then finally I add the two together. Doing it that way works, but it wastes two channels and I imagine there is a better way. I have attached my VI, and I labelled the location of interest "Where the Signals Get Subtracted", which is currently shown using the two inputs.
Thanks,
Leo
Solved! Go to Solution.
07-09-2015 03:06 PM - edited 07-09-2015 03:31 PM
Make two generators, with one phase=30, use the IN PLACE ELEMENT structure with the subtract inside. Add In Place In/Out Element for channel 1. Just tunnel channel 2 into the structure. Subtract the two and wire the waveform out from the structure to a waveform graph. If you want to see the original signals and the subracted version use a build array to put all three into the waveform graph.
07-09-2015 03:50 PM
Dear Regulator,
Please do not attach pictures -- it is very hard to execute a picture (though one might be tempted to execute those who post pictures), unless, of course, it is a Snippet (which yours were not).
Bob Schor
07-09-2015 03:57 PM
What a mess. I have no idea where you are trying to do the subtraction. Can you make a very small VI (one whose Block Diagram fits on a single screen) that shows what you are trying to do? Include the Sine Wave Generator, and you can include a "Black Box" that says "From DAQ". But thank you, at least, for posting code, not a picture.
Here's a suggestion that may help make things less messy -- do you know about the Diagram Cleanup tool? See the icons at the top? The right-most one looks like a broom next to a VI. Save your VI first (in case you don't like what it does), Select All (Ctrl-A), then click this button -- you may like the result.
Bob Schor
07-10-2015 10:03 AM
Thank you for the quick response. I have used the Diagram Cleanup Tool in the past but I don't generally like the result. I have attached a cleaned version of the VI that should be more straight forward. Essentially, I cannot subtract the simulated signal from the signal I sample using the DAQ. By subtract I mean that if both signals had the same frequency, phase, etc. but had opposite amplitudes (ex. -1 and 1), I would expect the "Processed Signal" to be what appears to be a DC siganl of zero volts.
07-10-2015 10:11 AM
Actually I meant they would add to a zero volt DC signal, my mistake.
07-10-2015 10:21 AM
You need to make sure your sample rate and number of samples are exactly the same. It looks like your sample rates (with the default values) are the same (1kHz), but your number of samples is different (100 in the simulated waveform vs 1000 in the acquisition).