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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog input and Digital output at the same time, NI USB 6003

Hello,

 

I have a YIG filter that its center frequency is determined by 12-bit digital signal. I need to find out the changing frequency response time. My plan is to acquire data from the YIG's output (after connection to a diode) while changing its bit signal.

I have two NI-USB 6003 devices in hand. I understand that this device is not an SIO and cannot do AI and DO at the same time: start acquiring analog input while changing the digital output, and then end acquisition. Has anyone had this experience with USB devices before? Does dedicating one device to AI and theater to DO help?  Naively, how about using two different computers and devices, one for AI and the there for DO, and use one for the other's trigger?

 

Thanks

Saeid

0 Kudos
Message 1 of 12
(4,648 Views)

@Houshmandyar wrote:

Hello,

 

I have a YIG filter that its center frequency is determined by 12-bit digital signal. I need to find out the changing frequency response time. My plan is to acquire data from the YIG's output (after connection to a diode) while changing its bit signal.

I have two NI-USB 6003 devices in hand. I understand that this device is not an SIO and cannot do AI and DO at the same time: start acquiring analog input while changing the digital output, and then end acquisition. Has anyone had this experience with USB devices before? Does dedicating one device to AI and theater to DO help?  Naively, how about using two different computers and devices, one for AI and the there for DO, and use one for the other's trigger?

 


Whew!  I've got a USB-6009 and a USB-6002 ("cousins" of the 6003), so it's a good thing I didn't know you can't do AI and DO at the same time, since that's what I'm doing.

 

The question really is what are the tasks you are trying to do.  I'm assuming you are sampling an analog signal at some reasonable rate, say 1KHz, maybe 1000 points at a time, but it is not clear what the timing issues are for the DO task.  Mine are fairly slow (as in "Make it go High when I push this button on the Front Panel") and are of the "on demand" nature -- there's no problem doing this (with a single USB-600x device).

 

Can you say a bit more about your AI and DO tasks?  I know you are talking about a 12-bit DO (I think my devices have that many ports) -- say more about the timing.

 

Bob Schor

0 Kudos
Message 2 of 12
(4,624 Views)

Bob,

As I understand, NI 6003 does the tasks as it blocks others, meaning that two tasks cannot be done at the same time: data sampling is done before the device get the chance to do digital waveform. I have monitored my code and verified that simultaneous AI/DO is not being done. My case is fast changing the digital signal fast. Can you share your code as you say you are already doing it?

0 Kudos
Message 3 of 12
(4,612 Views)

Hi Houshmandyar,

 

I have monitored my code and verified that simultaneous AI/DO is not being done.

Can you share your code? Please attach a VI, not just an image…

 

My case is fast changing the digital signal fast.

The NI6003 supports hardware-timed DO: do you use this? (Well, if you would attach your VI we could answer that by our own.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(4,594 Views)

Hello,

I have attached my VI. I have also attached the result of a run: I have connected a 1 Hz signal from a signal generator to the AI, just to monitor. As you can see there is a gap between AI and DO, as it is expected that NI 6003 blocks other tasks before finishing one task. The gap is the 100 ms wait, but I want the acquisition continue, even through the wait. This means that not only the analog read stops during the wait, but also it stops before digital write would start. Since changing the digital word affect the analog input, I need to find the time response of this change from the YIG filter. Any suggestion?

Download All
0 Kudos
Message 5 of 12
(4,578 Views)

I don't see a Task wired to the DO set of VIs.  Among other things, this means that the timing and other asepcts of the Task are "ill-defined" (they aren't, strictly speaking, un-defined, as they have some default values, but who knows what those are ...).

 

You do not need a Sequence/Frame structure -- it only clutters up your Block Diagram (you seem to be properly using the Error Line(s) to sequence your operations, as well as LabVIEW's Principle of Data Flow).

 

There appears to be a computation in the first Frame of AI Acquisition Time (Samples to Read / (2*Sampling Rate)) that goes nowhere and is unused, a curiosity that would have been obvious and "removed" without the Frame.

 

Bob Schor

0 Kudos
Message 6 of 12
(4,568 Views)

Just to be clear, why can't this all be on demand?

1) First set the DO lines to the frequency you want (on demand)

2) Do a finite read (on demand)

3) Do some analysis or update parameters.

4) Repeat.

 

It is possible that you can actually trigger the AI to happen at about the same time you do the DO by routing a DO to a PFI line and using a start trigger on the AI. But I'm not sure if there is a benefit to your application. Also, you are using all but one of your DO pins.

0 Kudos
Message 7 of 12
(4,562 Views)

Right there for #1: I cannot to timing for DO for this device!

0 Kudos
Message 8 of 12
(4,553 Views)

Right, that's why I said on demand i.e. software timing. For your application, why do you need to continuously sample AI. Why can't you just set the DOs, do a finite acquisition, analysis, repeat? What's the point of the timing you're trying to achieve?

0 Kudos
Message 9 of 12
(4,547 Views)

It is the time response between two DO setting that I intent to measure.

0 Kudos
Message 10 of 12
(4,545 Views)