Caro2012 Posted August 13, 2012 Report Share Posted August 13, 2012 Hi all, I want to count the number of digital inputs I am getting. I found the “Toggleincrement” function (see attachment) that is counting inputs controlled by a Boolean Control using an Event Structure. Now, when I change the Boolean Control for my digital input the Event Structure does not work anymore. Could somebody help me please? Thanks! Carola toggleincrement.vi Quote Link to comment
asbo Posted August 13, 2012 Report Share Posted August 13, 2012 If you're leaving the code in the boolean control's Value Change case, the reason the counting doesn't work is because the event will only fire for a Value Change for the boolean control. You can either use DAQmx Read in a loop to poll the input and detect changes or you can check to see if your hardware supports DAQmx Events. Quote Link to comment
KWaris Posted August 13, 2012 Report Share Posted August 13, 2012 The Event Structure are designed and used USUALLY to respond to the user interface actions. You can although use the timeout case for detecting hardware digital inputs. It may not therefore be suitable in this context. Can you detect the hardware in your setup as it stands now. Can you just wire a simple boolean indicator, change the stage of your digital input and see the response. Is so then just wire the simple case structure to the same wire which wires to the boolean indicator showing your digital input, Put an increment function inside the true case and the use shift register to count up to the previous value Quote Link to comment
Caro2012 Posted August 18, 2012 Author Report Share Posted August 18, 2012 Thank you for your replies. I am new with that and I am a little bit lost... So, I learned from the Labview forum that to do what I wanted to do with the event structure was not possible. I am finally trying to use the Count_Digital Events.vi although right now I still cannot use it because it is counting the photodetection events way too fast. Alternatively I wrote something it is working more or less OK. Thank you for your help! Count_Digital_Events.vi CARO_Count_PHOTODETECTION.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.