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.
08-27-2012 09:56 AM
Hi,
I would like to do a case as enable. So if the button is on I want to pass the signal, ifnot I don't want anything at the output. The problem is when the button is disable, I read all 0, but I don't want anything. Do you know how I can do it?
Solved! Go to Solution.
08-27-2012 10:04 AM
What do you mean by "don't want anything at the output"? Something has to come out of the subVI or else data flow would fall apart. Do you want the indicators to not change values? If so, just put them inside of the case structure.
08-27-2012 10:09 AM
@crossrulz wrote:
[..] If so, just put them inside of the case structure.
Which has a negative performance impact. It is a simple solution though, so it is ok for newcomers.
There are several different ways to implement such requirements, but all are more complex and require more knowledge of LV and the requirements you have to fullfill with your application later on.
Norbert
08-27-2012 10:11 AM
I can't put it inside the case, bescause when the condition is true I want the dada out.
08-27-2012 10:15 AM - edited 08-27-2012 10:15 AM
Try it.
08-27-2012 10:16 AM
I tryied but it doesn't work!
08-27-2012 10:22 AM - edited 08-27-2012 10:24 AM
What doesn't work?
I just tested it myself and you are correct that the element is updated with LV's default value for the datatype (so for string an empty one, deleting e.g. "channel name").
So you would like to retain the previous value of the indicators in case you execute the FALSE case?
Norbert
EDIT: And you shouldn't mark replies as answer if you still dont have a solution. Or is it solved?
08-27-2012 10:26 AM
the problem is not in the channel name, the problem is "Outputdata". I've been using a DAQ to recive voltatge and current values, and I want that the user selects the channel, the systems takes the values, and print it in a file, but when the user doesn't select the channel, I still recive '0' in the channel witch isn't selected.
08-27-2012 10:32 AM
@ATO wrote:
I can't put it inside the case, bescause when the condition is true I want the dada out.
So you only run all of the code if the case is TRUE. The false case should be empty. All of your indicators CAN be in the case structure in the TRUE case.
08-27-2012 10:33 AM
Hm, i think i understand what you are up to.
Taking a look into your code, you do some weird data typecasts with the waveform datatype. You can remove all "To Dynamic Data" and "From Dynamic Data" and instead use a single "Get Waveform Components" to retrieve the data array (1D Double).
Another hint: Waveform is a datatype consisting of t0 (start timestamp), delta t (the time between single samples) and the data array X (the actual measurement values).
If you don't pass an updated waveform, you will not get "no waveform" but an "empty waveform". An "emtpy waveform" has a t0 of 0, a delta t of 0 and an empty data array. I *think* this is what you are seeing.
Norbert