Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set the device route on 9178 so I can use PFI 0 as a trigger in Ansi C?

Hello,

 

   I have a cDAQ-9178. I would like to use the PFI0 port as a digital edge trigger but I can't get it to work. I've tried dozens of combinations of export and connect terms to try to map the device route shown in the device monitor.  When I try to set the trigger it complains there is no device assoc with the task.

 

   I am using ANSI C.

 

Thank you,

Michael

0 Kudos
Message 1 of 4
(3,998 Views)

Hi Michael,

 

Which DIO card are you using in your setup? There is a default port that the PFI0 exports on to. For example on the NI-9401, the default line that PFI0 is connected to is pin 14. You can find the routing information by right-clicking on the device in Measurement & Automation Explorer and selecting Device Pinouts. If you are still having issues please post your hardware setup and the code you have written so we can troubleshoot further.

Steven K.
National Instruments
Software Engineer
0 Kudos
Message 2 of 4
(3,968 Views)

Hi Steven,

 

Thank you for your reply.  To elaborate on the question, the cDAQ-9178 has 2 BNCs on the chassis labeled PFI 0 and PFI 1.  According to the manual I should be able to assign PFI 0 as a trigger input.  The manual does not say that we need a digital input module to access the PFI 0 line on the chassis.  For a visual of what I'm talking about I have attached an image of the User Manual showing PFI 0 BNC Connector (Figure 1 Item 2). How do I set the device route on BNC Connector TRIG0 (PFI 0) using Ansi C?

0 Kudos
Message 3 of 4
(3,951 Views)

Hi Michael,

 

It should be something like this

 

    DAQmxCfgDigEdgeStartTrig (taskHandle, "/cDAQ1/PFI0", DAQmx_Val_Rising);

 

Where cDAQ1 is the name of your chassis, and PFI0 could be swapped with PFI1 if desired. 

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 4
(3,948 Views)