07-30-2013 03:30 PM
Hi,
Could I ask for some help, I'm getting bogged down in a simple DAQ VI. I am using a flowmeter outputting a series of NPN pulses through the counter line on my USB-6501. I have set the DAQ Assistant within a For Loop that counts the pulses within each iteration but naturally after each iteration the count resets to zero so
my indicator (gauge in this case) appears erratic despite a steady flow through the meter. How would I go about creating a VI that can output a steady reading on
the indicator but still be senstive to changes in flow? Thank you very much for any help.
08-01-2013 06:46 AM
Hi Evan
Thanks for posting.
I've attached a modified version of your code which uses shift registers to remember the value from the previous loop iteration.
Please let me know if this is what you needed, or if you need help understanding what I've done.
Kind Regards
08-01-2013 07:16 AM
--> Why FOR loop and why noy WHILE loop??
--> Why DAQ assistant, and why not low level DAQmx functions (if you've difficulty using/understanding low level DAQmx functions then after you've configured DAQ assistant, just right click it and select 'Generate NI-DAQmx Code'. As DAQ assistant creates and closes the task everytime it runs, the counter value will be reset to 0, on the other hand if you choose to use low level functions, probably you can create the task once and then read the counts in loop (WHILE loop) and before existing the application you can clear the task.
08-01-2013 05:10 PM
Thank you both for your help, but unfortunately both VI's do not seem provide a solution,
the first VI thanks to Chris using shift registers does output the pulse count per iteration but
the gauge still returns to zero (erratic gauge). Moderartor1983's solution does not give flow, but a total pulse
count. Sorry moderator1983 I am using DAQ assistant as I am very new to LV and I find it very
easy to use the assistant. Is there a method of acquiring the value after one iteration/reading,
keeping this reading until the next is taken which then replaces the previous. So instead of the output
showing 0-75-0-100-0-120-0 etc it will show 0-75-100-120, thanks again, very grateful for your
help on this.
08-02-2013 01:16 AM
@Evan117 wrote:
Is there a method of acquiring the value after one iteration/reading, keeping this reading until the next is taken which then replaces the previous. So instead of the output showing 0-75-0-100-0-120-0 etc it will show 0-75-100-120, thanks again, very grateful for your help on this.
I suppose, with the code that I shared in previous reply, should work for your experimental application and also it should never come to zero (if you can see the pulse counts on the front panel, the pulse rate is really slow)...
@Evan117 wrote:
Moderartor1983's solution does not give flow, but a total pulse count.
I'm using the same convesion factor what you were using in the VI that you attached. So you should be able to see both, Pulse counts and Flow.