07-07-2014 11:54 AM
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.
07-07-2014 12:11 PM
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
07-07-2014 12:13 PM - edited 07-07-2014 12:17 PM
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..
07-07-2014 01:28 PM - edited 07-07-2014 01:28 PM
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.
07-07-2014 02:15 PM - edited 07-07-2014 02:15 PM
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)
07-08-2014 12:19 PM
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.
07-08-2014 12:58 PM
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).
07-08-2014 05:01 PM
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?
07-08-2014 05:12 PM
@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.
01-04-2018 04:10 AM
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