Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AFPIO trigger

Solved!
Go to solution

My guess is I could search extensively and find something, but it seems like there should be a simple solution.

 

I had a LabVIEW code that worked.  It used an old VI ("Acquire N Scans Analog Hardware Trig.vi").  I upgraded to 8.2 and of course can't get that vi to load properly.  Now, I'm trying to use the "DAQ Assistant" to do the job.  But it appears the triggering is not working properly.  I am reading analog channel 1 triggering off AFPIO.  I know that the 'trigger' is working (i.e. if I look at the signal I send to AFPIO on an analog channel in the test panel I see the 'trigger').  But the DAQ Assistant won't start a scan when the trigger goes by and times out with an error.

 

Is there something simple I could be missing here?

Thanks,

0 Kudos
Message 1 of 6
(4,235 Views)

Hi bkoch27,

 

First of all, what type of hardware are you using for your acquisition?  What version of the DAQmx driver are you using?

 

Taking a look into the DAQ Assistant, when you configure a Start Trigger, you can choose Analog Edge or Analog Window with the APFI0 as the source, which one of these did you choose?  If you used the edge triggering, what level did you configure?

 

It seems that the way it is configured, that you aren't reaching the level voltage required for the trigger to fire, and thus the assistant is timing out because it doesn't detect the trigger.  I would make sure to have the trigger level somewhere midway between the voltages you are using for your low state and high state for your trigger.  So a 0-5V trigger would be triggering off a rising edge at 2.5V, so on and so forth.   A good example you can look at in Example Finder in LabVIEW would be the Acq&Graph Voltage-Int Clk-HW Trig Restarts.  I would try running this with your APFI0 as the trigger and see if you get the same result.

 

If you have any other questions feel free to ask, thank you!

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 6
(4,220 Views)

I am using a USB-6251 with a BNC-2090.  I'm not sure if this is the proper way to check for DAQmx drivers, but I opened up the   All Programs --> National Instruments --> NI-DAQ --> NI-DAQ Readme and it appears I have NI-DAQ 8.5.

 

I tried hard to make sure I had the same settings under the Assistant, so yes I use Analog Edge, I select the APFIO channel to trigger off of, and set the level at 2V.  All this was the same as I used with the DAQ vi used previously.  I know that I am reaching this level becuase if I connect my trigger signal to an analog channel and use the test panel (with the same DAQ system) I see the 660usec pulse (goes to >3.5V) as described in my instrument manual.  Also, the 2V should work fine because that is the same trigger level I used with the previous vi.  But, in any case, I have reduced the trigger level all the way down to 0.5V and get the same result.  When I have some time next week I will also try the Acq Graph & Voltage etc routine you suggest to see what happens.

Thanks,

Barry

0 Kudos
Message 3 of 6
(4,212 Views)

OK, I did not find the 'example' that you mentioned, but I did find the example "Cont Acq&Graph Voltage-Int Clk-Analog Start.vi" which based on the user interface looks like it should do what I want.  Anyway, I tried the following parameters:

Channel Parameters: Physical Channel = Dev1/ai1; Minimum Value = -1.00; Maximum Value = 10.00

Timing Parameters: Rate = 500; Samples to Read = 10000

Trigger Parameters: Trigger Source = APFIO; Slope = Rising; Trigger Level = 0.50

I also upped the 'timeout' in the block diagram to 30 seconds, so that I should have up to 3 tries (the way my source was setup I get a pulse about once every 10 seconds).  It still timed out.

0 Kudos
Message 4 of 6
(4,202 Views)
Solution
Accepted by topic author bkoch27

Hi Barry,

 

It sounds like you were using NI-DAQ 6.9.x (or Traditional NI-DAQ 7.x) before, which means you must have been using E Series. When you switched from E Series to M Series, did you change your wiring?

 

On E Series, PFI0 could be used as either an analog trigger or a digital trigger. On M Series and X Series, APFI0 is a separate pin, which uses the same pin number as EXTREF did on E Series:

  • APFI0 is for analog triggering. It can also be used as an external DAC reference for analog output (which is what EXTREF was for on E Series).
  • PFI0 is only for digital triggering and digital I/O.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 5 of 6
(4,197 Views)

I switched the trigger signal from the PFIO pin to the EXTREF pin on the BNC-2090 and now the example vi "Cont Acq&Graph Voltage-IntClk-Analog Start.vi" works.  Not sure what happened.  I haven't actually used this LabVIEW code in a long, long time, but looks like this should solve the problem.

Thanks much,

Barry

0 Kudos
Message 6 of 6
(4,195 Views)