I'm trying to use DAQmx for simple event counting using PFI8

Hi,
I am presently using Traditional DAQ (Legacy) drivers in my software, however I'm in the process of switching over to DAQmx drivers.  Our systems use an E Series DAQ card: PCI-MIO-16XE-10.
I use PFI8 along with Counter 0 to do simple event counting.  The signal is connected to PFI8 and as it changes, my counter output either increase or decreases in value.  The attached vi shows how I've done it in the past using the Legacy drivers (top portion of the vi) and how I'm attempting to do it using the DAQmx drivers.  I've combined both versions on the single vi just for illustration purposes - when I do my testing they are on separate vi's.
I'd appreciate it if anyone could help me to figure out why my DAQmx version isn't working properly.  Thank you very much!
Steve
Attachments:
PFI8_DAQ_Comparison.vi ‏36 KB

Hey Steve,
The DAQmx driver installs several examples into LabVIEW that
demonstrate how to implement various event counting applications.  I
recommend you look over these and see if any of them accomplish what
you're trying to do.  They're usually very simple to understand and
well documented, but I'd be happy to help you out with any of them if
you had a particular question. 
You can find them in the Example Finder (Help >> Find Examples)
in LabVIEW.  Drill down to the following location in the directories:
Hardware Input and Output >> DAQmx >> Counter Measurements >> Count Digital Events
You'll see a number of examples, but I recommend starting with 'Count Digital Events.vi'
Since PFI8 corresponds to CTR0 SRC, make sure you set it to use counter 0.  This should work correctly.
Elijah Kerry
Senior Product Manager, LabVIEW
Follow my Software Engineering for LabVIEW Blog

Similar Messages

  • I want to open a txt file and output data through an AO-using DAQmx for PXI

    I have a PXI running a 8145RT CPU. I have a PX6040E Multifunction DAQ card installed in the PXI. I want to program an application where I open a txt file (existing in one of the the RT machines' folders), read the first row, and output its data through an AO channel. The drivers I should use is DAQmx v7.1, and the Labview RT v.7
    Any idea?

    What exactly are you having problems with? Reading a text file can be done a number of ways. Look at the File I/O palette and check out Read Lines From File or Read Characters From File. There are string to number conversion functions on the string palette (i.e. Scan From String). There are also numberous shipping examples on using DAQmx for analog out. If you have a specific problem or question, please post back with additional details.

  • Can't get counter 2/3 working in simple event counting mode for NI6601

    I have been successfully been able to get counter 0 and 1 working in a simple event counting mode. But when I read Software Save register for counter2/3 it gives me garbage values. I am doing register level programming in C.
    This is the algorithm that I follow
    In initialization:
    -> Reset the Counter
    -> Write32( Clock_Config_Reg, 0x00)
    -> Write Load A and LoadB registers
    -> Write to Input Select Register with appropriate values
    -> Write16( Command_Reg, 0x0125);
    Then when I need to read the SW save register value
    -> Write to Command Register  setting the  gi_Arm bit
    -> Reading the SW save register twice
    -> If not equal ,read again
    -> Write to Command Register  disabling the  gi_Arm bit
    This works just fine for counter 0 and 1. But I can't get it working for counter 2 and 3. Are there any other registers I need to set up correctly for counter2/3. Is the default reset values of registers different for counter 2 and 3?
    Any help would be very appreciated
    Thanks

    Hello manisha,
    Is there a particular reason for using register level programming to interact with your DAQ card, rather than the DAQmx driver?  The reason I ask is because we don't support RLP at NI.  There are some manuals that have been developed, such as this one which corresponds to your card, but I am unable to offer any support after that.  If it is necessary that you must use RLP then you should post your question to the DDK forum, as they have more experience in this area.
    Regards,

  • What Acrobat do I need for simple at-home use?

    HELP! I just now bought the Acrobat XPro for simple home use. When I tried to download it, I was told I didn't have the proper system requirements - I don't even know what I have, or what I was missing. I have an old computer, but used to run Acrobat on it all the time. All I want to be able to do it manipulate documents, save pdfs as jpeg, etc. - nothing fancy. Is there another simpler acrobat version that would work for me? I would appreciate any thoughts/suggestions. Thank you!

    if you're online when you need to do your edits, you could try this, http://www.pdfescape.com/what/

  • How to create desktop application for simple server program using netbeans?

    Hi,can anyone help me on this one??
    I'm am very new to java,and I already trying different example program to create desktop applications
    for simple server program but it's not working.
    This is the main program for the simple server.
    import java.io.*;
    import java.net.*;
    public class Server {
    * @param args the command line arguments
    public static void main(String[] args) {
    try{
    ServerSocket serverSocket = new ServerSocket(4488);
    System.out.println("Server is waiting for an incoming connection on port 4488");
    Socket socket = serverSocket.accept();
    System.out.println(socket.getInetAddress() + "connected");
    PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
    BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null){
    out.println(inputLine);
    System.out.println("Connection will be cut");
    out.close();
    in.close();
    socket.close();
    serverSocket.close();
    }catch(IOException e){
    e.printStackTrace();
    // TODO code application logic here
    }

    and this is the Main Processing :
    import java.awt.*;
    import java.awt.event.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.*;
    import java.text.*;
    import java.util.*;
    import java.net.*;
    import java.io.*;
    public class MainProcessing {
    private static final long serialVersionUID = 1L;
    static private boolean isApplet_ = true;
    static private InetAddress argIp_ = null;
    static private int argPort_ = 0;
    public TCPIP TCPIP_ = null;
    private InetAddress ip_ = null;
    private int port_ = 10001;
    static private boolean conectFlag = false;
    private BufferedWriter bw;
    FileOutputStream fos;
    OutputStreamWriter osw;
    public int[] current = new int[400];
    public int[] volt = new int[400];
    public int[] revolution = new int[400];
    public void init() {
    public void start() {
    if (isApplet_) {
    try {
    ip_ = InetAddress.getByName(getCodeBase().getHost());
    } catch (UnknownHostException e) {
    } else {
    ip_ = argIp_;
    if (argPort_ != 0) {
    port_ = argPort_;
    // IPアドレスが不明なら何もしない
    if (ip_ != null) {
    // コネクションが成立していないなら、接続
    if (TCPIP_ == null) {
    TCPIP_ = new TCPIP(ip_, port_);
    if (TCPIP_.getSocket_() == null) {
    System.out.println("ミス1");
    // エラーメッセージを表示
    return;
    if (TCPIP_ == null) {
    System.out.println("ミス2");
    return;
    System.out.println("成功");
    conectFlag = true;
    try {
    TCPIP_.sendF();
    } catch (IOException ex) {
    Logger.getLogger(MainProcessing.class.getName()).log(Level.SEVERE, null, ex);
    System.out.println("" + conectFlag);
    return;
    public void receive() {
    try {
    // Calendar cal1 = Calendar.getInstance(); //(1)オブジェクトの生成
    // int year = cal1.get(Calendar.YEAR); //(2)現在の年を取得
    // int month = cal1.get(Calendar.MONTH) + 1; //(3)現在の月を取得
    // int day = cal1.get(Calendar.DATE); //(4)現在の日を取得
    // int hour = cal1.get(Calendar.HOUR_OF_DAY); //(5)現在の時を取得
    // int min = cal1.get(Calendar.MINUTE); //(6)現在の分を取得
    // int sec = cal1.get(Calendar.SECOND); //(7)現在の秒を取得
    byte[] rev = TCPIP_.receive();
    // System.out.println("受信");
    if (rev != null) {
    byte[] Change = new byte[1];
    int j = 0;
    for (int i = 0; i < 1200; i++) {
    Change[0] = rev;
    current[j] = decimalChange(Change);
    i++;
    Change[0] = rev[i];
    volt[j] = decimalChange(Change);
    i++;
    Change[0] = rev[i];
    revolution[j] = decimalChange(Change);
    } catch (NullPointerException e) {
    public int decimalChange(byte[] byteData) {
    int bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7;
    int bit = 0;
    for (int i = 0; i < 8; i++) {
    int a = (byteData[0] >> i) & 1;
    System.out.print(a);
    System.out.println();
    return 1;
    public void destroy() {
    // &#20999;&#26029;
    if (TCPIP_ != null) {
    TCPIP_.disconnect();
    if (TCPIP_.getSocket_() != null) {
    try {
    System.out.println("\ndisconnect:" + TCPIP_.getSocket_().getInetAddress().getHostAddress() + " " + TCPIP_.getSocket_().getPort());
    } catch (Exception e) {
    TCPIP_ = null;
    public boolean conect(int IP) {
    conectFlag = false;
    String address = "192.168.1." + IP;
    System.out.println(address);
    try {
    argIp_ = InetAddress.getByName(address);
    } catch (UnknownHostException e) {
    // xp.init();
    isApplet_ = false;
    start();
    return (conectFlag);
    public void send(String command, int value, int sendData[][], int i) {
    int j = 0;
    Integer value_ = new Integer(value);
    byte values = value_.byteValue();
    Integer progNum = new Integer(i);
    byte progNums = progNum.byteValue();
    try {
    TCPIP_.send(command, values, progNums);
    for (j = 1; j <= i; j++) {
    Integer time = new Integer(sendData[j][0]);
    byte times = time.byteValue();
    Integer power = new Integer(sendData[j][1]);
    byte powers = power.byteValue();
    TCPIP_.send(times, powers);
    TCPIP_.flush();
    } catch (IOException ex) {
    Logger.getLogger(MainProcessing.class.getName()).log(Level.SEVERE, null, ex);
    public void file(String name) {
    ublic void fileclose(String name, String command, int value, int sendData[][], int i) {
    try {
    fos = new FileOutputStream("" + name + ".csv");
    osw = new OutputStreamWriter(fos, "MS932");
    bw = new BufferedWriter(osw);
    String msg = "" + command + "," + value + "";
    bw.write(msg);
    bw.newLine();
    for (int j = 1; j <= i; j++) {
    msg = "" + j + "," + sendData[i][0] + "," + sendData[i][1];
    bw.write(msg);
    bw.newLine();
    bw.close();
    } catch (IOException ex) {
    Logger.getLogger(MainProcessing.class.getName()).log(Level.SEVERE, null, ex);

  • I have 2 auxillary disk drives for my MacBokk Pro. Time Machine uses one for backup and I use the other for storage, but I am unable to create a new folder or drag and drop files or folders to the aux drive.

    I am unable to create a new folder on either of my auxillary disk drives.  I can access the files and folders that were there when I transferred one of the drives from a PC.  Time machine uses one for backup and I want to use the other to store photos which are large files.  An help would be appreciated.

    Thanks for the reply.  If I reformat the drive will I be able to access the files on it from the MAC.  I do not share the drive with a PC.  The files were originally created on a PC which I no longer use.  I do want to continue to access the files put there by the PC.  I would like to not have to copy them over to the MAC hard drive just to use them.  The second aux drive is new and works fine because it was formatted by the MAC.  I can drag and drop files there and work with just as if they were on the internal drive.

  • Using CSS for Struts JSP presentation using tiles

    hi all,
    i want to use CSS instead of table TRs ,TDs,TABLE in my jsps.
    can anyone help me how can i achieve that?
    i want to use css with struts presentation using tiles
    i couldn't find much information about using CSS for jsps on the web can anyone guide me with proper information in this regard?
    regards and thanks in advance

    Actually, I just realized it's the exact same syntax as regular html (which I was thinking, but for some reason it didn't work the night I posted):
    <head>
      <link rel="stylesheet" href="yourstylesheet.css"/>
    </head>I'm not sure why it didn't work for me the first time.
    theAmerican

  • Event counter using USB-6210 analog

    Hi,
    Any suggestions or directions where to look to generate a VI that would record event from a magnetic counter of a mouse wheel. I would like to record up to 16 wheels using the USB-6210 device. Thanks!
    VO2max

    Thanks for the extra information.
    The 6210 actually has two counters, so you could count the edges (on two of the wheels) if the signals are TTL compatible.  You can use the Count Digital Events.vi example to help you get started.  From LabVIEW, it can be found at:
    Help » Find Examples... » Hardware Input and Output » DAQmx » Counter Measurements » Count Digital Events
    If your signals are TTL compatible, I would highly recommend purchasing a PCI-6602 and using this method for all 8 channels.  You could modify the example code by increasing the delay (software-timed sample rate) to a larger value (say 1 minute), and logging the results to a file as you run.  Doing this would log the value of the event counter every minute, and would keep the file size relatively small (about 15kB if you run for 8 hours).
    If you must use a single 6210 and require all 8 channels, the only option would be to use continuous analog inputs.  You would have to sample at a high enough rate to not skip the pulses (I am not sure what that is without knowing more about the signal), and then process the digitized signal in software to determine the information that you need.  I would use the Producer/Consumer design template in conjunction with a continuous analog input example to get started.  In the consumer loop, you would have to implement the functionality of the counter in software.
    Using a hardware counter would be preferrable to using analog inputs.  The counter is made for exactly this type of task, and implementing it in software can be complicated as well as processor intensive.  If you have any questions let me know, I'm happy to help you out.  You can always try out the counter task on the 6210 for two wheels to see how it will work before deciding whether or not to purchase a new board.
    -John 
    P.S. After your first post I had assumed that you were testing computer peripherals, but it looks like you actually have eight rodents.  We had a good laugh over here over my confusion.
    John Passiak

  • Gated-event counting using analog triggers?

    I'd like to software trigger gated-event counting with analog signals. eg. Use a comparison to check analog input levels to a 6024E card, once a trigger level is reached send a digital out from the 6024E to a 6601 gate to commence and terminate a counter of the 6601 card.
    I have found that the counter on the 6024E card is not stable enough for this application, but the NI-TIO cards work reliably.
    Any tips greatly appreciated,
    Alan

    Alan;
    In case you want to trigger a finite pulse train generation of an analog hardware trigger, you can still accomplish that with an e-series board only.
    You will need to use both general purpose counters available on the DAQ device though. The first counter needs to be configured as retriggerable pulse generation, having its gate being routed to the AI Start Trigger pulse of the Analog Input task. With that done, the counter will generate a pulse at its output at every time the Analog Trigger level is met. You, then, configure the second counter to execute a continuous pulse train and route the first counter output to the second counter gate input. That will make the second counter to generate a pulse train that will be "enabled" by the first counter. The p
    ulse train will be generated while the output of the first counter is on its high state level.
    Knowing that, you can configure the pulse width of the first counter to be as wide as you need the second counter to generate the pulse train.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • When does a clock signal appear on a RTSI bus using DAQmx for a PCI NI-4472 DSA?

    Hello,
    I am trying to synchronize several PCI NI-4472 DSA boards over a RTSI cable using MATLAB. I have read that with DAQmx it is not necessary to use DAQmxExportSignal to put the clock signal on a RTSI line provided that the RTSI cable is registered in MAX and that the DSA cards are listed as being connected to the RTSI device. Apparently, the DAQmx drivers are supposed to route the clock signal between the cards as required….
    So I have done the above and see in MAX, in the device routes tab for Dev1, that
    /Dev1/ai/SampleClock uses RTSI6
    /Dev1/ai/SampleClockTimebase uses RTSI8
    Right now I am monitoring the RTSI lines on an oscilloscope in the hopes of detecting a clock signal on one of the three boards in the system while one board (the eventual master) is acquiring data using the Test Panels in MAX. I am getting nothing on the ‘scope (may be monitoring the wrong line – have just posted a request for RTSI pinouts for this DSA) and am wondering under what circumstances is the clock present on the RTSI bus.
    My real problem is that MATLAB R14SP3 does not yet support a master card in a synchronization application but, oddly enough, seems to allow one to setup slave cards. I would like to continue using the MATLAB data acquisition toolbox to manage the DSA cards and the application and would rather avoid using calls the DAQmx dll library. (It's not clear how to integrate the functionality of the data acquisition toolbox with direct calls to the DAQmx library.) So I am looking for a workaround to get the clock signal on the RTSI bus so that I may try out the slaves.
    Thanks,
    Sebulba

    Hi
    Both ports of a two port CAN board are handled by one processor and they use the same memory for alocating the necessary queues.
    But, both ports if connected to different CAN buses have their own handle, own queues and error handling. That means if one Bus enters to BUS OFF, the second bus can still communicate. And you can stop and restart communication independently on both ports. Even the ncaction reset works  on a single port at a time.
    DirkW

  • Looking for simple search example using SELECT

    Can anyone link me to an example of how to create a basic search page where the search criteria is selected in a drop-down list (<SELECT> in HTML)?
    Here's where I'm coming from so you have a better idea of what I'm trying to do. I've created a search page by creating a method in my App Module java class using setWhereClause(), then dropped my view onto my web page as a read-only table, and finally dropped the method and parameter as a command button and input text field, respectively. This works fine, but I'd like to replace the input text field with a select box so that the users will not have to type in their search criteria. I'd like to populate the drop-down with data from a table, which will then be sent as the argument for the method.
    I can create a ViewObject that contains the data I need, but I'm not sure where to go from there. I don't know how to create the drop-down list or connect the command button to the list. (Ultimately, I'd like to have the search text submitted when the drop-down changes, but I'll settle for pressing the button for now). I've fooled with using the LOV component, but without any luck.
    Step-by-step would be great, but if you can point me to an example, some documentation, etc., that would be great too.
    Thanks,
    Andy

    Excellent - Thanks for the link to the sample code page. I thought I had seen all the tutorials, etc. but for some reason never came across this page. The example you cited looks like it's just what I'm looking for.
    (Edit - For anyone who's interested, here's a step-by-step for creating a databound drop down list:
    http://www.oracle.com/technology/products/jdev/tips/mills/databound_lists.html )
    Andy

  • Guide for simple program development using screens

    Hi guys!
    I want to learn development in ABAP using screens. Can you advise me some links or send some documents on this? The best would be Simple examples..
    I can develop FMs already..
    Thank you!
    Olian

    Hi,
    Can you check out the links below it will help you in learning module pool programs
    http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    http://www.geocities.com/ZSAPcHAT
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
    http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
    http://www.sap-img.com/
    http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
    http://www.sapgenie.com/links/abap.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
    <b>Reward points for helpful answers,</b>
    Satish

  • Using iDVD for simple presentation

    I've produced two iMovies that I'm sending to a 3rd party to be used during an awards presentation. I'd like a simple "cue #1" & "cue #2" menu set up. What is the simplest way to go about doing that?
    Thanks,
    Gee

    My problem, or rather the problem that I want to avoid is that I don't need a theme. I imagine the person running the program would like to be able to simply start the cues one at a time without having to go to a menu page. What I've done is I've put the two iMovies together into one iMovie file, and added a chapter marker at the top of the second cue. I imagine that the presenter will be able to pause after the first movie, and then go to the next chapter for the second.
    If you use one of those simple themes, e.g. "Transparent Blue" which has no animation, no sound, all you get is a rather plain 2-tone background, the 2 movies you add to the theme would be 2 text labelled buttons. You have the choice of having a title or not as well. This gives the presenter quite easy to just pick one of the buttons to start one of the movies. When the 1st movie finishes, or hit the stop button, you return back to the menu, then you can select the next movie.

  • Is it possible to use Citrix for home-use and for free, Only one use?

    Hi
    I am a .Net developer so i need to have Microsoft Visual Studio and Microsoft Windows for my Work, but i like iPad 2 in Tablets so that i bought one, Now in a video i have seen that Citrix is such a professional Desktop and App Virtualization that it seems Microsoft Windows is running on iOS, so i want to use it but not for business and just for home use, is it possible to set it up for free?
    Best Regards,
    PK DEVELOPER

    Citrix does not allow iOS to run Windows. Citrix products are one of several ways to connect an iOS device to a system that does run Windows and allow the iOS device to take control of that Windows system. Citrix, to the best of my knowledge, does not make their back-end products (i.e. the software that runs on the system to which you want to connect) available for free; it's usually quite expensive as it's intended for enterprise use.
    Citrix for home use would almost certainly be vast overkill, though. Just do a web search for "VNC". VNC is a solution for Windows and iOS that would allow you to take control of your Windows system.
    Regards.

  • 6601 output counter when use Simple event Counting Mode

    I want to put the ouput counter in a high, while I count event. How to do that with set attribute?
    Attachments:
    Consulta.vi ‏78 KB

    It looks like you want this vi to count events until you reach some specified target value ('Pulsos'), then stop the counter. It sounds like you'd like the counter's output to toggle high the instant you start counting and toggle low as soon as a certain count is reached.
    First off, I'm pretty sure you can't get hardware-timed behavior quite like that. That being said, your posted example appears to rely on software timing anyway -- attempting to call 'Counter Set Attribute' to toggle the output. Soooooo.... why not simply use a digital bit that you can also software time to turn on and off?
    Here's a small modification of your example that toggles a digital bit high when the counter is started and toggles low when your target count is re
    ached. In your real application, some of the config should probably be done outside this vi, but this'll give you the general idea.
    -Kevin P.
    Attachments:
    Consulta_ver2.vi ‏99 KB

Maybe you are looking for

  • How to set filter criteria for month and year using in timestamp input field?

    Hi, I am using jdev 11.1.2.3, I have one problem with Report generation,,,,,,I have one report table which is in the form of VO(query based) and i want to search this table as month and year basis but in this table(query) that field having timestamp

  • HT201209 i have credit in my account but i can not figure out how to buy a song

    I am new at the Itunes store.   I bought a prepaid card.  Bought 1 song. I don't remember how I did that.  Now I have a balance available and I would like to buy other songs.  But I can not figure out how to do it at all.  I have been trying for 2 ho

  • Deploying .ear files

    How can I deploy an .ear file if I want to use another Web Server(like iPlanet) to handle static content?? Do I have to separate .html, .gif, etc from .jsp files?? If this is true, .ear files are useful only in developing mode. Thanks, Austre

  • Emoji pictures not showing in received messages??

    How do I get other people's emoticons to show as pictures rather than punctuation symbols?? I have Emoji and they show as pictures when I send them but not when I receive them from other iPhones. Please help its driving me nuts!

  • Imports not recognised

    I'm new to using Sun One Studio 5. Having problems with import statements in example source I've mounted to the file system. All are showing as not existing, i.e. when I compile the MIDlet, I get compilation errors: package javax.microedition.lcdui d