Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you control when data is written?

I would like to know how to control when data is written to a text file.  Particularly I would like for a data line to be written each time the count changes on my counter/timer (USB6008 DAQ using Labview 7.1.1) rather than each fraction of a second during data collection.  Do I use a case structure?  If so how?  This probably seems quite elemental, but I'm just learning the program and any help would be appreciated.
0 Kudos
Message 1 of 6
(3,125 Views)
Hi,
 
Use a shift register to store your last count value and carry it to your next iteration, compare it with current value and save to file if there is a change in value
Look at pic attached
 
Hope this Helps
Regards,
Dev
0 Kudos
Message 2 of 6
(3,114 Views)
Dev,
The picture was really helpful.  The only thing I can't figure out is what the 0 outside the while loop thats hooked to the shift register is...or rather how to get it on my block diagram. I think thats the key because right now if I try to display the new value and the old value, they're the same.  What do I do?
0 Kudos
Message 3 of 6
(3,093 Views)
To get the 0, use the wiring tool and right click on the shift register terminal and select Create Constant. It should default to 0, if not just type the value in the box.
Or you can use the Numeric functions pallette in the block diagram and choose numeric constant (shown by a 123 surrounded in a blue rectangle)
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 6
(3,086 Views)
I guess its not that I need the 0 but rather that I need for the last value for the counter to be kept and displayed so that it can be continually compared to the value that is being collected so that if they're different the new count will be written to a data file. Right now if I leave the shift register uninitialized (which from I gather is simply not connecting anything to the left side, I get two error message about the case structure.  I've attached the vi please let me know what I should do to fix it.
0 Kudos
Message 5 of 6
(3,076 Views)

Connect the signal originating from your DAQ assistand to signals input in Write to LVM file

Name the case structures as true and false

As shown

Message Edited by devchander on 10-06-2006 01:40 AM

0 Kudos
Message 6 of 6
(3,069 Views)