From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting clock reference for USB-6001

I am trying to set up a USB-6001 to send a pre-programmed sequence of TTL pulses on software command. I am doing the programming in Python (via nidaqmx library). However, I can't seem to be able to set the rate for the sample clock. I'm able to set up a task and change the state of a pin by command, so I know everything is loaded correctly, at least.

 

 

 

>>> task_do.do_channels.add_do_chan('Dev1/port0/line0')
DOChannel(name=Dev1/port0/line0)

>>> task_do.do_channels.add_do_chan('Dev1/port0/line1')
DOChannel(name=Dev1/port0/line1)

>>> task_do.write([True, True])
1 #I can observe pins turning on

>>> task_do.write([False, False])
1 #I can observe pins turning off

>>> task_do.timing.cfg_samp_clk_timing(rate = 1000)
Traceback (most recent call last):
File "<pyshell#28>", line 1, in <module>
task_do.timing.cfg_samp_clk_timing(rate = 1000)
File "C:\Users\bglebov\Python36\lib\site-packages\nidaqmx\_task_modules\timing.py", line 3007, in cfg_samp_clk_timing
check_for_error(error_code)
File "C:\Users\bglebov\Python36\lib\site-packages\nidaqmx\errors.py", line 127, in check_for_error
raise DaqError(error_buffer.value.decode("utf-8"), error_code)
nidaqmx.errors.DaqError: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: DAQmx_SampTimingType
Requested Value: DAQmx_Val_SampClk
Possible Values: DAQmx_Val_OnDemand

Task Name: DO test

Status Code: -200077

 

 

From what I understand, I need to set the clock before setting up the waveform. For this, I'd like to use the internal clock of the USB-6001. The spec sheet defines the timebase frequency at 80 MHz, and max sample rate at 20 kHz. However, I get the above error for any rate value. (Just for kicks, I also tried passing a string for rate value, and it came back with a different error - so it's not a type error, at least.)

 

Does USB-6001 even have an internal clock reference, or does it have to us an external one? If so, how do I set this up?

 

Also, assuming I can set this up, would the sequence fire off whenever I run task_do.start()? I couldn't find a setting for a software trigger.

0 Kudos
Message 1 of 5
(1,281 Views)

The USB-6001 only supports *static* DIO, not hw-clocked and buffered DIO.  So you can't use a buffer or set a sample rate.  This remains true even if you supply an external clock.  (The 20 kHz max sample rate you found applies to AI).

 

Depending on the sequence, you *might* be able to do it with AO instead.  Max rate there is 5 kHz so your pulse timing would be limited to 2 millisec resolution.

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 5
(1,264 Views)

Hm. Thanks for clearing that up. Well that's rather disappointing. And not entirely clear from either the spec sheet or the manual. Unfortunately, I was already planning to use the analog outputs for something else, so that's a no-go.

 

Do any of the other USB-600x models support clocked and buffered digital outputs? I'm looking for something in this form factor. If I end up using something much bigger (like, a cDAQ module), I might as well use a programmable function generator, which I already have.

0 Kudos
Message 3 of 5
(1,258 Views)

You definitely have to go for something better than USB-600x for dynamic DIO.

 

All USB-600x only support static DIO.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 5
(1,244 Views)

The spec sheet *is* fairly clear about only supporting "static" DIO, but I recognize that while the *meaning* of static DIO is plenty clear to me who's been around NI stuff for 20+ years, it may not be so clear to anyone who isn't already accustomed to the jargon.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 5 of 5
(1,237 Views)