LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean crossing question

Solved!
Go to solution

Highlight execution is a good tool to play with this.  If you are really just trying to figure out the function, I recommend taking hardware out of it.  Just use a button that you can toggle.  With your current setting, the function will give you a TRUE only when you toggle the button to TRUE.


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 21 of 32
(2,575 Views)

That's exactly what I did. this is what I have done independently of the VI image that showed a moment ago.

 

Initialize: I put a boolean control

input: I put a boolean control

direction:   0   either

                   1   false-true

                   2   true false

croosing: I put a LED to display the output status

 

this is how I do to test this feature but never managed a 1 to the output

0 Kudos
Message 22 of 32
(2,566 Views)

Attach an expanded snippet of your code..you could be dealing with an input issue. Timing could be a factor.

 

Correct me if I'm wrong...but I don't think you need to use the initalize connector in this case...just wire the output of your >0 to the input on the crossing VI..

0 Kudos
Message 23 of 32
(2,565 Views)

Works fine for me.

 

Again, are you sure the value that you read from the device goes to a 1 (or something greater than 0)?  You never answered.

 


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 24 of 32
(2,540 Views)

block.PNG

 

You need to run your program with highlight execution on to find out what's going on with your input. It's on the block diagram menu(circled red)

 

Run your program and watch the data flow...If you have a 0 value coming from your Digital Read, then you need to take a look at that part of your code (which we cannot see)

0 Kudos
Message 25 of 32
(2,526 Views)

Thank you very much crossrulz. hears a favor? could you please check my code? although the part where this block "croosing boolean" and if you can verify that I sent it mal.Te part in the picture below. Everything works as I want except block "croosing boolean". EL program is to detect a pulse in the digital input once leida is compared to 0 the result is a Boolean state (0 or 1) output of the comparator. Once done this enters the block "boolean croosing". After that the output of that block should give (T or F) but only get F.

 

 

0 Kudos
Message 26 of 32
(2,484 Views)

As long out the output of the Greater Than? is goin to the "input" of the Boolean Crossing function, it looks fine to me.  It is hard to tell by the picture since it is going backwards and then who knows where.

 

You have yet to tell me if you verified that your digital read ever output a high (which is likely your problem).


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 27 of 32
(2,475 Views)

I've actually checked and never gives me a high output. this is how I did the test

 

Initialize: I put a boolean control

input: I put a boolean control

direction:   0   either

                   1   false-true

                   2   true false

croosing: I put a LED to display the output status

 

following the same principle. How do you do?

 

could you help me understand each of the elements of the "boolean croosing" block?

 

0 Kudos
Message 28 of 32
(2,458 Views)

@alda wrote:

I've actually checked and never gives me a high output. this is how I did the test


 

It is all in the help.

 

If your test VI does not work, then please show us your code.

 

Could it be that you loop spins so fast that the LED only light for a nanosecond and you don't see it?

Make sure that the loop rate is slow enough.

0 Kudos
Message 29 of 32
(2,453 Views)

To illustrate, here are a few examples of detecting a boolean transition. They all come down to the same logic eventually, but clearly using the feedback node is the most compact. 

 

 

 

Graham

0 Kudos
Message 30 of 32
(2,263 Views)