LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DAQmx with a USB6212 and BNC2110, New to DAQmx communication

Solved!
Go to solution

Hey all, I am new to using DAQmx communication protocol and I am having trouble figuring out how to complete my task.

I can trigger a digital output, and I can trigger the counter for timing  (externally, I want to use it internally) (I am assuming implicit timing means the clock internal to the USB6212),  but I can't figure out how to use the internal timing to trigger the digital input. Yes, I did piece together bits from the standard LabVIEW examples.

 

My goal short-term goal is to use the internal clock on the USB-6212 to trigger a square wave on the digital channel so the timing is consistent. My long-term goal is to use the internal clock to trigger a set of digital inputs in a user variable sequence.   

sstats_0-1641568407777.png

Any help would be appreciated! I am sure there are more efficient ways to do what I am doing.

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

First, what you're describing is considered a "sample clock" in DAQmx.  Samples are acquired or generated on every sample clock active edge.  Triggers are a distinct thing, used to denote a single reference point (often the start) for an acquisition task.

 

Second, I'd recommend you start by pairing up 2 shipping examples.  Let one of them be a Counter Output example for continuous pulses (not the buffered one) where you select a specific PFI pin as the output terminal.  The other one should be a continuous digital input or output where you select the same PFI pin as your "sample clock source".

    If you run both at the same time, the sample clocking action for the DIO task will be provided by the counter pulse output task.

 

That'll at least get you started with how it *can* work.

 

 

-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).
Message 2 of 5
(1,074 Views)

Thanks for the reply Kevin! I don't know why I didn't look at the counter examples, I really had my head stuck in the digital examples. I see where you're trying to direct me and it makes sense to use the counter on a digital pin, then you can do all your timing off that digital pin.

I think I am missing something about the sample clock source though. I am unable to get the sample clock to work with a digital pin as its channel in. 

sstats_0-1641585618924.png

 

I may be able to eek out a solution purely using a base off the counter continuous output example, but I don't think it would be a very elegant solution. The sample clock definitely seems like the right route, but I just don't see what I am missing with its setup. When I have been working through this on my own, issues with the sample clock on a digital pin are what I keep on running into. 

0 Kudos
Message 3 of 5
(1,053 Views)
Solution
Accepted by topic author sstats

Bad news.  The error text says it all.   Unlike *most* of NI's 62xx series of devices, the 6212 does *not* support hardware-timed DIO.   

 

I didn't look up the specs until now because almost every other device in the 62xx family *does* support a version of hardware clocing known as "correlated DIO".   (Meaning, hardware clocking is possible, but the DI/DO subsystems of the device don't have timing engines of their own.   So they need something else to generate a sample clock for them.)

 

Bottom line:  you can't get there from here with DI and DO.  You could probably wire your DI signals into AI channels and then do some simple thresholding to resolve them into low / high states.  You might be able to similarly use AO for your DO signals if you don't need more than 2 of them.  Otherwise you'd need a different device.

 

 

-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).
Message 4 of 5
(1,036 Views)

Thanks a bunch for the help. It took me a while poking around in the datasheets to even figure out what you were referencing.  Now I see under external digital triggers DI/DO with sample clock on some of the NI devices.

 

I would be looking to control up to 8 different channels, so I guess this device just won't cut it for my application. I was using some older hardware, I guess I will have to purchase something specifically for this application. Thankfully, now I know what to look for and pick out a piece of hardware that will suit my needs.

 

Cheers!

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