10-24-2019 03:40 AM - edited 10-24-2019 03:47 AM
Hi NI Community this is my first time posting on a forum. I have an issue where I implemented a falling edge trigger using a NOT and a NOR gate together. It works fine once but when I press the button again it does not want to detect the falling edge again. What is the issue with it? Is it a logic error? How do I solve it? The equipment I am using is a myRio-1900
10-24-2019 06:05 AM - edited 10-24-2019 06:09 AM
The logic appears to be fine. I think?
I would suggest using a Feedback node rather than two Shift Registers though, especially since it seems that the two Shift Registers are always identical (and so you only need one data source, not two!).
It makes it a bit more compact and easier to understand (hopefully you agree):
Here I right clicked on the FB node and chose to "Change Direction" - this has no change to function, but alters the appearance and makes wires look nicer for this case.
I would guess your problem occurs somewhere between the code you're actually running, and the simplified version you posted for people to test with the button (thanks for that, by the way).
I'm not sure but it looks like you intend to connect C/DIO7 instead of the button, and then it has different cases with different code, perhaps?
10-24-2019 11:56 PM
Thank you for your response. I will try your method out regarding the shift registers seems pretty neat . It is true that the C/DIO7 is to be connected where the button is, however, the function is still the same regardless.
10-25-2019 01:20 AM
@JosiahTham wrote:
Thank you for your response. I will try your method out regarding the shift registers seems pretty neat . It is true that the C/DIO7 is to be connected where the button is, however, the function is still the same regardless.
You have 4 copies of the C/DIO7 node (one per state) by the look of it. 3 of these are seemingly outputs (you're writing a value) but if you use it as a replacement for the button, it's an input.
It might be that this is causing your problem?
10-25-2019 04:27 AM
It should not be a problem as it is supposed to be used to measure the Echo Pulse from the Ultrasonic Sensor. The button was just use to simulate the echo.