10-10-2013 05:45 PM - edited 10-10-2013 05:46 PM
Thanks, I can see your VI now.
The example I posted was more of a way to show how the hardware might be configured to do what you needed. Figuring out how to architect your application around these hardware calls is a little more open-ended. From what I gather, you need to be able to:
Writing good user interface code can be tricky--I'd suggest incorporating a queued event handler (and using DAQmx Events), but it will likely be difficult to get started if you haven't done something like this before. I might have some time tomorrow to post an example.
Best Regards,
10-11-2013 02:09 PM
I had some time to write a simple state machine example that should get you started:
I realized you'll probably end up polling the inputs anyway--getting the USB device to work with events can be frustrating (samples left on the hardware buffer, etc.).
Best Regards,
10-13-2013 01:53 PM
Thank you a lot John
There are so many things to learn on Labview! As what I see in the VI, the DAQmx Timing is set as '2 samples per channel'. Does that mean the buffer only save 1 sample from each counter, or save first 2 samples no matter which counter they come from (may be the 2 from the ctr0). I am a bit confused about that.
Sorry for taking your time.
Cheers
Daisy
10-14-2013 01:29 AM
The minimum buffer size is 2 samples per channel (it's a DAQmx peculiarity). Each task has its own 2 sample buffer, but you really only care about the first sample. The "Read Relative To" property is set to "First Sample", so you will always read the first sample in the buffer. Once you have acquired from both channels, the tasks will restart which will clear the buffers.
Best Regards,
10-14-2013 12:37 PM
OK, now I understand! Thank you a lot, John.
Best Regards
Daisy
10-31-2013 05:39 AM
John...
Sorry to bother you again and again. I have a tiny question about the button state. Is it possible if I want to change the button state programmatically, i.e. can I change start button to 'pause' state if both channels get data? So that I can click start button manually rather than the restart automatically.
Cheers
Daisy
10-31-2013 08:01 AM
Hi John
I have solved my problem.
Cheers
Daisy
04-20-2016 08:24 AM
Hi,
Can anyone help me in this situations. I am also using two counters for measure pulse width.
Thank you,