Discussion:
storing digital input
(too old to reply)
felso
2007-05-23 17:40:11 UTC
Permalink
I am fairly new to Labview, and I have a question on receving inputs (maybe trivial).
I am trying to receive an input from a momentary pushbutton switch (SPST). I am running it through an NI 9401 as a digital input. I set up the DAQ assistant and I am receiving an input signal once every second. I would like to store each input (which is a boolean) in an array. I've initialized an array, and I am able to place the input into the array, but my problem is that every time a new signal is recieved, the array is reset, so that the signal I want to store appears but is not stored. Thanks to anyone who can help me.
BrianPack
2007-05-23 19:10:10 UTC
Permalink
Are you re-initializing your array every loop?
If you can post your code it would help in finding the cause of the bug.BrianMessage Edited by BrianPack on 05-23-2007 02:04 PM
felso
2007-05-23 22:40:12 UTC
Permalink
Thanks, Brian.
I've attached the part of my code which is giving me problems. Basically what i am trying to do is save all the inputs in an array, and then sum them and determine whether the sum is even or odd. What happens is the array resets every time the DAQ receives a new input so none of the inputs are stored.
 


digital input code.vi:
http://forums.ni.com/attachments/ni/70/6922/1/digital input code.vi
Continue reading on narkive:
Loading...