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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case as enable.

Solved!
Go to solution

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?

0 Kudos
Message 1 of 11
(2,521 Views)

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.


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 11
(2,516 Views)

@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 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 11
(2,509 Views)

I can't put it inside the case, bescause when the condition is true I want the dada out. 

0 Kudos
Message 4 of 11
(2,504 Views)
Solution
Accepted by topic author ATO

Try it. 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 11
(2,501 Views)

I tryied but it doesn't work!

0 Kudos
Message 6 of 11
(2,496 Views)

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? 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 11
(2,488 Views)

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. 

0 Kudos
Message 8 of 11
(2,484 Views)

@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.


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 9 of 11
(2,480 Views)

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 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 11
(2,479 Views)