LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send analog signals to multiple output channels with conditional statement for one of them

Hello all,

 

I am having trouble to execute the attached VI -either it is showing the specific channel is reserved Error 50103 or doesn't send any signals out at all (from ao0 - spark). What I am trying to is explained below:

 

False Case (when I haven't clicked on the Trigger camera button):

I am reading two output from a camera - one in SYNC with the frame rate and one in sync with REC pos. The  SYNC displays continuous square waves according to the frame rate and the REC signal remains at 0V until the camera starts recording. 

 

True Case (when I click on trigger camera button):

After a specific delay (2s) I want to send an analog pulse (square wave) from an output channel (ao1) connected to a camera trigger input. The trigger signal starts recording the camera images and makes the REC signal to 5V instantaneously and during the time the camera is recording images. The camera is set to record images for 2s. Now I want to generate another output signal through channel (ao0) that would trigger a spark and the spark should start as soon as the REC signal is 5V and be on for the entire time the camera records images (or REC signal is 5V) and should stop as soon as the REC signal goes below 5V. 

 

The problem is with sending the second trigger to the spark. 

 

I had been trying to solve this issue for past 2 weeks without any luck. Any help is greatly appreciated.

 

I am using Labview 2014 and PCI-6289 for data acquisition. 

 

Thanks,

Roy

Download All
0 Kudos
Message 1 of 6
(4,052 Views)

Roy,

 

Have you taken a look at any of the analog input or analog output examples available in the NI Example Finder (Help>Find Examples)?  Since your application requires specific sequencing and timing, I think you will have much better luck with using the DAQmx API instead of DAQ Assistant.

 

Error 50103 is a resource reservation error, i.e. you're trying to use hardware resources that are already in use.  Remember that you can only have one AI task and one AO task running at a time.  Again, I think you'd have much more explicit control over that with the DAQmx API.

Cody A.
0 Kudos
Message 2 of 6
(3,994 Views)

Hi Cody..

 

Thanks for your response..Yes, I have tried to find out similar examples/cases in Labview help as well as this forum. All I found closer to my case was how to send simultaneous analog output signals to multiple output channels. Majority of them had suggested working with DAQmx tasks instead of DAQ assistant as you said. But I had no luck in finding something similar where one output task (from channel ao1) would be conditional based data acquired from an input channel (ai0) while another output channel (ao0) is already sending out a signal.

 

I am a beginner in Labview and have worked with DAQ assistant only. If someone would share an example of how to implement this logic with DAQmx API it would really be helpful.  

 

THanks again..

Roy

0 Kudos
Message 3 of 6
(3,983 Views)

Roy, 

 

Is there a reason you are not using digital I/O for this application?  It would be easier to use if the signals are TTL.  It's definitely possible with AI and AO though.

 

There likely isn't going to be an example this specific.  Because it is a pretty specific case.  However, the concepts remain the same.  The needs of your application simply require you to change the signal that you are writing to your analog output channels based on what you read from your analog input channels and several other conditions (such as timing).

 

To keep track of the 2s wait after you press the trigger button, used some elapsed time function, such as the Elapsed Time Express VI or a timing FGV (https://decibel.ni.com/content/docs/DOC-35414).  This will keep your loop running at normal speed while you wait.  Then, you can use a function like "In Range and Coerce" to determine if the REC signal is 5V +/- some tolerance.  If it is, output 5V.  Otherwise, output 0V.

 

EDIT: Take a look at this article as well: http://www.ni.com/white-paper/2835/en/.

 

Below is a quick example I drew up to get you started.  However, you'll need to modify it to accomodate for things like output pulse width and amplitude, any specific timing or synchronization requirements (be sure to add a loop timer if using not using hardware timing!), etc. 

 

AI and AO Sync.png

Cody A.
0 Kudos
Message 4 of 6
(3,956 Views)

Thanks a lot for getting me started with your connection diagram. I will try it out and let you know if it works. 

 

I don't have the digital I/O line external ports routed to the connection box. Is there any documentation on how to connect PCI pinouts with SCB 68 and then to an external BNC connector. 

 

Regards,

Roy

0 Kudos
Message 5 of 6
(3,934 Views)

I don't know of any documentation that discusses connections from the SCB-68A to another connector block.  I assume you've already seen the 6289 pinout.  There are several digital lines on each connector.  http://www.ni.com/pdf/manuals/371292g.pdf - See page 21.

Cody A.
0 Kudos
Message 6 of 6
(3,895 Views)