06-28-2022 09:33 AM
Is there anyway to make a digital read only output true if the signal is true for a certain amount a time, while still looping? I am trying to make it so a sensor reads non-stop and once it reads true for a certain amount of time it will output true. The issue is that the sensor will read true for a very short time randomly throughout the entire code, but if the sensor reads for too long I need the entire code to stop.
Thanks,
Guy who started using labVIEW 3 weeks ago and is sucked in
Solved! Go to Solution.
06-28-2022 09:53 AM
A chattering Digital Input is a hardware problem and should not be obscured by a software workaround.
Tell us more about the system.
06-28-2022 10:02 AM
Basically it is a sorting system that drops an item into a bin, but if it doesn't fall all the way into the bin and gets stuck, the sensor is there to notice it. The sensor is triggered even when the item passes by but I want it to stop the entire code if the sensor is triggered for longer than a second. I am using this in parallel with the main code, I thought of using a timed sequence but the issue is I don't want it to wait everytime the while loop loops, I would rather it read true for a certain amount of time then output true if possible.
Thanks for the help, if more details are needed I can upload the code as well, it is just not finished yet.
06-28-2022 10:30 AM - edited 06-28-2022 10:34 AM
I'll try to advise you now and if you need help implementing it you will need to post some code .
Your DIN is doing two things.
So, if the next reading after any TRUE transition is still TRUE you need to increment a 2nd counter by the time between readings. If the 2nd counter becomes larger than a specific time you need to pause the program and report something like "Error! An Object is stuck in the drop shoot! Safely Clear the Obstruction."
If the Reading ever becomes FALSE reset the 2nd counter.
Then redesign the shoot or lube with suitable materials. You DO have a hardware problem!
06-29-2022 10:08 AM
My question is basically the subject, I am creating a sorting machine and it will do almost all of the first iteration of the while loop, but for some reason my digital write square wave statements are not fully working. The first loop they all but 1 work perfectly, but then the second loop they do not work at all, none of them do for some reason. Just wondering if this is common or if there is a fix for it. If possible I would also like to know if there is anyway for me to fix the one digital write square wave statement that will not work on the first iteration. I have all the pins correct and the time set as well as the frequency but it will not write. Is it possible that a regular digital write statement might be messing with it?
Thanks,
MaccoTaco
06-29-2022 10:17 AM
Hi Macco,
I merged your threads because of the very related questions…
Until now you failed in attaching some/all of your code.
How should we answer questions on problems with your code when you refuse to attach that code?
06-29-2022 10:26 AM
Sorry about that I thought I attached the code. I am having the error in the main while loop, "Move back to middle" will not work at all, "Reset Motors" and "Release probes and record data" work but not after the first iteration.
Thanks for all the help I really appreciate it
06-29-2022 10:28 AM
06-29-2022 10:38 AM
Sorry again, hopefully this is the correct version. Still kind of new to this.
06-29-2022 12:55 PM
Hi Macco,
@MaccoTaco wrote:
Sorry again, hopefully this is the correct version.
Nope, still LV2021. You just changed the filename…
File->Save for previous. Select "LV2020" or "LV2019", then save the file. Attach this newly saved file…