Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set PFI pins as input/output

Hi...
I want to set PFIs as input/out but I don't know how to deal with it. I try to find the function but nothing can set in PFIs.

I want to trigger with PFI 1.

Thanks in advance for any kind help!!
0 Kudos
Message 1 of 10
(7,919 Views)
Hi Nok,
I think I found an example where you can trigger with PFI 1 or PFI 0. I hope this solve your problem.

Greetings

Patrick B
NI Germany
0 Kudos
Message 2 of 10
(7,917 Views)
Hi.. Patrickb,

Thanks for ur help. but I have some question that "analog ch(-)&level(0.0)"

What is the meaning of level=0.0 ? I means it wait the trigger with 0 V ?

Thanks in advance
0 Kudos
Message 3 of 10
(7,917 Views)
Hallo Nok,

The analog chan and level parameter determines the source and level conditions for an analog trigger, and edge or slope determines whether to look for a leading or trailing edge for digital triggers, or a leading or trailing slope for analog triggers.

Greetings
Patrick B
NI Germany
0 Kudos
Message 4 of 10
(7,917 Views)
Correct me if I'm wrong but Digtrig.vi is where you can tell the program which PFI pin you want as an input for a trigger signal.  How do I turn the PFI pin into an output signal that outputs a squarewave? 

Thanks.

--
J
0 Kudos
Message 5 of 10
(7,621 Views)

Hello jtanabe,

You are correct.  The example posted above in Traditional DAQ is used to input a trigger signal to the card.  The PFI pins allow you to route signals into and out of your card, they are not capable of directly generating signals.  To generate a square wave you would use either a counter or digital line.  A counter would allow you to generate a square wave with a specific frequency and duty cycle, and a digital line would allow you to do something similar depending on the card you have.  For example with an E Series device you write a single value to a digital port at a time, and therefore it is software timed.  The frequency you can update the digital port/line will completely depend on your software and the speed of your system.


For more information on PFI lines please see a PFI Knowledge Base found here.  If you are just starting out, or if you are using an M Series Board I would recommend (if your hardware supports it) using the DAQmx driver.  It is easier to create applications, and it allows you to use the Data Acquisition Assistant Express VI if you are using LabVIEW.  There are examples that demonstrate how to generate square waves online and in NI Example Finder.  If you are using LabVIEW you can find examples by selecting Help >> Find Examples.  In the window that appears select Hardware Input and Output >> NI-DAQmx >> Generating Digital Pulses.


Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 6 of 10
(7,599 Views)
I'm working with DAQPad-6070E.  Does the DAQmx vi's work with this NI instrument?  Also I was wondering if I can bypass the use of the VI's and trigger the input and output to ready simultaneously using a software trigger?  I'm using the Trigger config and AI start vi's for the DAQpad.

Thanks.

--
Jordan
0 Kudos
Message 7 of 10
(7,595 Views)

Hello Jordan,

The DAQPad-6070E is only supported by Traditional DAQ.  You can find more information on this here.  One way to trigger your application is through a digital line.  Simply write a value of 1 and then 0 to your line (assuming you have it in a low state initially).

Please take a look at the example called Write 1 Pt to Dig Line (E).vi typically located in C:\Program Files\National Instruments\LabVIEW X\examples\daq\digital\E-series.llb\Write 1 Pt to Dig Line (E).vi

This example shows how to use a digital line to send out a logic level.  You can then use this as a digital trigger.  Alternatively, you could use software triggering.  By this I mean that you could start your data acquisition when some software condition is met.  There are no NI-DAQ VIs that allow you to perform software triggering, this is something that you would code. If you look at the AI Start VI, you will see that all the trigger inputs are optional.  If they are not set you do not need a trigger.  If you wanted to use a software trigger you would simply call the start (without the trigger inputs set) and read VIs once some condition is met.

I hope that helps.  If you have any questions about this let us know.

Regards,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 8 of 10
(7,588 Views)
Hello,

I have a NI PCI-6602 daq and I am using Matlab xPC for the programming. In 660x user manual, It is written that  PFI <0..31> can be programmed as DIO. 8 pins (PFI<0..7>) can  be used for simple DIO and the other pins (PFI<8..31>) are shared  with counters. 
In my project, I am using some of counters  and i would like to use other pins for DIO. But only simple DIO pins- STC (PFI<0..7>)
are supported in Matlab xPC. So, i have started to write my own blocks for using <PFI 8..31> as DIO with the help of Register Level Programming Manual. First of all, I have configured I/O connection registers for DO, because it is written that all of the pins can be used as DI without configuration. After configuration  of ports, do i need change anything else (like load registers or other registers)? Or is that enough?

Is there anyone did this before for xPC? If you are working in other platforms, could you please describe simply and step by step what i should do?
0 Kudos
Message 9 of 10
(6,537 Views)

Hi bckr,

Here are some resources for Register-Level Programming:

DAQ Register-Level Programming Resources

Measurement Hardware Driver Development Kit Frequently Asked Questions

I hope this helps you get started.

One final note: In the future, please start a new thread for a new question. It keeps our forums more organized and more members are likely to respond to a new thread than one that is several months old and has several responses. Thanks!

Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 10 of 10
(6,519 Views)