Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB 6210 / adding a second digital input

Solved!
Go to solution

Hello,

 

I'm using a NI USB 6210 to record angles from a sensor. The sensor has 3 cables which are connected to the following ports:

 

  • PFI 0 / P0.0 (In) = port 1
  • PFI 2 / P0.2 (In) = port 3
  • D GND = port 5

pinout available here: https://www.ni.com/documentation/en/multifunction-io-device/latest/usb-6210/pinout/ 

 

I'd like to add a second sensor to record another angle signal at the same time. Is this even possible with the NI USB 6210? When I try to setup the second sensor using PFI 1 and PFI 3 I get an error message in SignalExpress that the same physical device can't be used for multiple virtual ones. Could PFI 4 - PFI 7 (which are shown as outputs in the pinout) be used as inputs?

 

If it's not possible to use the NI USB 6210 for this, what would be an alternative device? Apart from the two angle sensors, there is a third sensor that would need to be connected to 2 analog ports.

 

Thank you.

 

 

0 Kudos
Message 1 of 11
(1,986 Views)

From my reading of the spec sheet, no, PFI4-7 are designated for output signals only.

 

The error msg makes it sound like you configured 2 different tasks with different PFI pairs but both assigned to the same counter.  Make sure one of them uses ctr0 and the other uses ctr1.   (Maybe you already did, it just doesn't sound that way.)

 

I'm guessing these are incremental quadrature encoders?   The USB-6210 has 2 counters and I would expect it to support 2 encoders.  I haven't used that model though, so I don't have first-hand knowledge of its limitations.

 

If the 6210 really won't work out, will you need the replacement DAQ device to be USB-based?   Either way, you'll need a more full-featured MIO device.  I'd be inclined to point you toward the X-series family (models in the 63xx range) -- they're newer and have a significantly enhanced feature set compared to M-series (the 62xx range).

 

 

-Kevin P

 

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 11
(1,966 Views)

Thanks Kevin for the fast and helpful answer.

 

I think I forgot to mention some important information: Actually I'm using ctr1 for "DAQmx - Create" to create a sample clock and ctr0 for "DAQmx - Record" to record the angle. The NI USB 6210 only has two timers/clocks - I think the problem is that I would need 4 of them.

 

I tried setting the sample clock to "internal" and deleting the "DAQmx - Create" but this way the angle won't start recording. Also I need to continuously record the angle.

 

Yes, the angle sensor are incremental quadrature encoders.

 

USB-based would be preferred since I have to connect it to a laptop. Would you recommend using some kind of PCIe-to-USB adapter?

0 Kudos
Message 3 of 11
(1,953 Views)

I do LabVIEW and am not familiar with the range of options available under SignalExpress.

 

Under LabVIEW, I could configure the encoder tasks to "borrow" the AI sample clock as their own.  It's designated similarly to: "/Dev1/ai/SampleClock".  Then it would be important to start the encoder tasks first before starting AI so that all the samples would be in sync.

 

I don't know whether this kind of configurability is supported by SignalExpress though.

 

If you have text language programming experience, such things would also be supported using one of the text-based DAQmx API's such as C or Python.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 11
(1,946 Views)

Thanks again Kevin and sorry for the late answer.

 

I have no experience with LabVIEW but did watch some videos and tried to get used to it.

 

Could I use this example to start with? I think this should take care of starting the encoder task before the analog task ....

0 Kudos
Message 5 of 11
(1,879 Views)
Solution
Accepted by abc123456789

- your linked example *does* illustrate how to enforce sequencing using the error cluster and normal LabVIEW dataflow principles.

- Maybe you can use a single AO task to generate the sample clock your encoder tasks need?   You could configure a hardware-clocked AO task that generates a buffer full of 0.0 Volts and then have two encoder tasks that "borrow" the AO sample clock.  In the encoder tasks' calls to DAQmx timing, set the 'source' input to something like "/Dev1/ao/SampleClock" and follow the dataflow sequencing shown in the example you linked to make sure the AO task starts *last*.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
Message 6 of 11
(1,863 Views)

Hello again,

 

I'm currently trying to solve a similar problem with an analog and digital signal: This time I'd like to use a task in NI MAX for the analog signal (I'd like to use the calibration menu there). The channel creation and the timing settings for the digital signal are done in Labview. The digital task is then started before the analog task (which was defined in NI MAX). The problem now is that both signals aren't in sync. How can I sync them while still using the analog task from NI MAX?

 

Thank you.

0 Kudos
Message 7 of 11
(1,553 Views)

Did you configure the digital task to use the AO sample clock as its own, similar to what was suggested above?

 

Please post your actual code -- but also please first use "Save for Previous Version..." back to about LabVIEW 2018 or so.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 8 of 11
(1,536 Views)

I used "/Dev1/ai/SampleClock" for "Source" on the DAQmx Timing VI for the digital task. The NI USB-6210 doesn't have a AO so I can't use that sample clock.

 

I works perfectly fine when I do everything in Labview like you explained above. But when I create the task for analog input in NI MAX and then just start this task without creating the virtual channel and using a sample clock for it in Labview, the analog and digital tasks will be out of sync.

 

Unfortunately I can't post the code because it's part of a bigger program. I can try to create a minimal example to demonstrate the problem though.

0 Kudos
Message 9 of 11
(1,528 Views)

Does the MAX task for AI configure a sample clock?   Or is it just left in software-timed "on demand" mode?

 

Also, are you sure you've used dataflow sequencing to make sure you start your digital task *before* you start the AI task?

 

A minimal example should be enough, but also include any info (at least screenshots) of all the config options in MAX for the AI task.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 10 of 11
(1,520 Views)