Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6008 digital i/o and counter sequence problem

Hi Benson,

What do you mean when you say, "But the problem is higher frequency (>100KHz) I measure less accuracy result I read"?

Are you trying to write to your digital line at 100 kHz?  Keep in mind that digital output for the USB-6008 is software timed.  You cannot run your while loop at 100 kHz.  The smallest time increment you can wait in the while loop is 1 ms.  In fact, it takes about 10 ms for each iteration of this while loop to run on my computer.  This corresponds to a digital update rate of 100 Hz.

Regards,
Sean C.

0 Kudos
Message 11 of 15
(1,333 Views)

Hi Sean,

The function of my vi is to use DIO to select the different frequency from Function Generator and output frequency to the counter. Then counter compute the frequency and display on the indicator. 

During vi is running, DIO is able to select manually and let counter to computer whatever frequency coming from F.G.(Maximum input frequency to the counter is 5 MHz as I check the specification).

I put DIO selector in the while loop(counter loop). The problem I have is when counter is trying to compute higher frequency i.e 100KHz the actually result will be 96KHz(Mabye DIO will share the hardware resource with counter). Without DIO in the counter loop is result can be good but then DIO can be called only once per run.

I hope you can understand what I post, sorry about my English 

 

Thanks

Benson

 

0 Kudos
Message 12 of 15
(1,325 Views)

Hi Benson,

I think I understand what you are doing now.  I just ran your code with slight modifications (I created the tasks dynamically and linked the error clusters of the two tasks) and was able to read 100 kHz from a function generator.

Do you have an oscilloscope that you could use to ensure that the signal is, in fact, 100 kHz?
 
Try running the attached VI and see if this helps any.
 
Regards,
Sean C.
0 Kudos
Message 13 of 15
(1,315 Views)
Thanks Sean,
Using error in, error out as flow I can see tasks are working separately and measurements are accurate up to 2MHz.
 
UPDATE:
I use counter to determine frequency from channel 0 to channel 7 and display on a numeric indicator automatically.

Now I try to display values in the table. All example I see are using multiple elements to build array before plot to the table. Different from my case is I have only one element (numeric indicator) that displays 8 measurements sequentially and try to plot in the table step by stpe correspondingly. 
 
Can you point me in the right direction on how to enter frequency value in the corresponding row and column position?
 
Thanks
0 Kudos
Message 14 of 15
(1,302 Views)

Hello,
Your table question has been addressed in this thread.
-Alan A.

0 Kudos
Message 15 of 15
(1,287 Views)