LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to turn on Flat Sequence Structure based on a Boolean input?

Solved!
Go to solution

Hello,

 

I trying to write a VI ( attached) that will sample an analog voltage coming through a an analog MUX. I using a flat sequance structure to change the select signals outputs to change the channel being sampled. I am wondering if I can turn on the structure only when my Sample boolean input is TRUE?

Download All
0 Kudos
Message 1 of 10
(4,279 Views)

You can use a case structure with your boolean input as the case selector.

 

http://www.ni.com/getting-started/labview-basics/execution-structures#Case Structures

 

The six hour LabVIEW introduction is a great start if you are just getting into LabVIEW.

 

http://www.ni.com/white-paper/5241/en/

Matt J | National Instruments | CLA
Message 2 of 10
(4,270 Views)
Solution
Accepted by malbaloo
Based on the image (I can't look at the VI itself), there does not seem to be any need for the sequence at all. You are wiring the DAQ assistant data to two scalar indicators which implies you are taking a single sample. Pointless to acquire multiple samples and discard all but one. The second sequence is certainly useless.
0 Kudos
Message 3 of 10
(4,240 Views)

Thanks to your comment, I realized that this VI will not do what I want. What I want is this:

 

if (sample is true)

 

{

 

output=00

 

take a sample

 

then:

 

output=01

 

take a sample

 

then:

 

output=10

 

take a sample

}

 

 

Any Idea on how to implement this?

0 Kudos
Message 4 of 10
(4,218 Views)

@malbaloo wrote:

Thanks to your comment, I realized that this VI will not do what I want. What I want is this:

 

if (sample is true)

 

{

 

output=00

 

take a sample

 

then:

 

output=01

 

take a sample

 

then:

 

output=10

 

take a sample

}

 

 

Any Idea on how to implement this?


Perhaps you should consider studying the online tutorials.  http://www.ni.com/academic/students/learn-labview/

 

There are no shortcuts to actually *knowing* how to program in LabVIEW.

 

 

0 Kudos
Message 5 of 10
(4,211 Views)
What does sample= true supposed to mean? What are you going to do with the samples you take?
0 Kudos
Message 6 of 10
(4,184 Views)

@malbaloo wrote:

Thanks to your comment, I realized that this VI will not do what I want. What I want is this:

 

if (sample is true)

 

{

 

output=00

 

take a sample

 

then:

 

output=01

 

take a sample

 

then:

 

output=10

 

take a sample

}

 

 

Any Idea on how to implement this?


What kind of hardware are you using for your inputs and outputs?

How much time will you need in between sending your outputs and receiving your inputs?

Matt J | National Instruments | CLA
0 Kudos
Message 7 of 10
(4,182 Views)
If you mean the Boolean control, wire it to a case structure or put it inside an event structure.
0 Kudos
Message 8 of 10
(4,167 Views)

@malbaloo wrote:

Thanks to your comment, I realized that this VI will not do what I want. What I want is this:

 

if (sample is true)

 

{

 

output=00

 

take a sample

 

then:

 

output=01

 

take a sample

 

then:

 

output=10

 

take a sample

}

 

 

Any Idea on how to implement this?


That sounds like a simple FOR loop with Set Output and Take Sample inside, autoindexing on the output value.


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 10
(4,055 Views)

Thank you all for your replies.

0 Kudos
Message 10 of 10
(4,000 Views)