LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Outputting analog w/DAQ at different times?

I have a dual-output DAQ (NI-6120) and I would like to output data on each channel as soon as it is ready. Right now, using the DAQ Assistant block, I have to use a merge before the input which causes the DAQ block to not to generate the analog until both signals have arrived. With the below, I would expect to see a phase shift on my scope, but I don't.

 

TryingForPhaseShift.png

 

Thanks!

Ben

0 Kudos
Message 1 of 8
(3,025 Views)
You simply don't understand data flow. You are pausing the entire VI for 5 msec. The DAQ Assistant simply does not execute until all of the data is present. If you want to introduce a phase delay, you have to modify the actual data to the second channel. Since you are already using Express VIs, a simple way would be to use another simulate signal function and specify phase there.
0 Kudos
Message 2 of 8
(3,010 Views)

No doubt about that - I have a lot to learn.

 

I can't simply use a second Simulate block. In my actual application, the Wait will be replaced with the second signal going out and back to a UDP echoer. It takes about 2msec for the round-trip, and I want this to be reflected in the phase shift I see after the DAQ conversion.

 

Ben

0 Kudos
Message 3 of 8
(3,005 Views)

So how many DAQmx reads and writes will be in the actual application? I'll admit to being confused as to the exact system you are trying to emulate here. Is the simulate signal is supposed to represent a DAQmx Write to two separate channels? Will you follow that by a DAQmx Read and then another DAQmx Write?

0 Kudos
Message 4 of 8
(2,995 Views)

The below pseudo-code is almost exactly I need (except for the not-working part!) Like I said, the problem is the merge waits for both signals to get there before passing them both to the analog output. Seems like the solution would be to use two analog output blocks, one for each signal input. But it won't let me do for the same hardware device.

 

 

TryingForPhaseShift 2.png

0 Kudos
Message 5 of 8
(2,988 Views)
It still looks like the TCP/IP write and read could be simulated by another Simulate Signal so many degrees out of phase. It would not simulate the amount of time it takes to do that. Adding the delay in series would do though 2msec is not something I would rely on. Be sure to wire the error out of the output DAQ Assistant to the Error in of the input DAQ Assistant.
0 Kudos
Message 6 of 8
(2,983 Views)

Okay, thanks. I'm still looking for a solution to this, then. My objective is actually to measure the time it takes to do the UDP round-trip via measuring the phase shift. Sort of a funny way of doing it, but that's what this test calls for.

 

0 Kudos
Message 7 of 8
(2,974 Views)
Yes, that is funny.  Why wouldn't you use just some timer functions if what you are trying to do is measure network time.
0 Kudos
Message 8 of 8
(2,962 Views)