Using a counter channel as a DO

Hello,
Could you please tell me if there is any possible way to use a ctr channel of an 6212 OEM as a DO channel.
Thank you in advanced

Many of the signals associated with counters can be routed to I/O using PFI's.  See chapter 7 of the manual for details on which signals can be routed through the PFI.  http://www.ni.com/pdf/manuals/371931e.pdf

Similar Messages

  • How do I use a counter to measure frequency and multiple analog signals in the same VI?

    I have a PCI-6071E, an SC-2345 with multiple modules, and a PXI-8184 (with a PXI-1002 Chassis).
    My goal is to monitor pressures, flows, temperatures, and speed in one VI.
    I am using Measurement and Automation Explorer version 3.1.1.3004 to manage my channels.
    My speed is a PWM signal which I recently rewired through the counter 0 of my board.
    I was hoping to configure this to read frequency directly in measurment
    and automation, have this scale the value to RPM, and then feed it
    directly in to my labView program.
    In labView, it will not except this signal though.
    I get error -200300 from the DAQmx Start Task.vi
    Possible reasons(s):
    Invalid timing type for this channel.
    Property: SampTimingType
    You Have Requested: Sample Clock
    You Can Select: Implicit, On Demand
    After doing some research, it seems that the counter wants "Implicit"
    selected for the DAQmx Start Task.vi, but then I cannot use my other
    channels. Also, counter is included in the "Sample Clock" option
    description, so I do not understand why it is not working.
    Does anyone know how to work around this problem or a way to configure the counter so that it will work in this way?
    All my other channels are Analog.
    Thank you.

    I am working on getting just the counter working by using
    the program posted previously, and I am running into issues. Periodically I get
    the error:
    Error -200141
    occurred at DAQmx Read (Counter DBL 1Chan 1Samp).vi
    Possible reason(s):
    Data was overwritten
    before it could be read by the system.
    If Data Transfer
    Mechanism is Interrupts, try using DMA. Otherwise, divide the input signal
    before taking the measurement.
    It seems to work better if I use cascaded counters, but I need timer 0 for
    analog channels when I run this code along with the program for the other
    measurements.
    I have tried averaging, and selecting different values for the millisecond
    timer, and these did not seem to have an effect.
    I tried different DAQms configurations and "Counter DBL 1Samp" seemed
    to work the best.
    The program will work for a while and then it will give me the above error
    message.
    If I use counter 0 as a cascaded counter input, the program runs fine. If I run
    this with other analog channels, it errors out because the analog channels use
    counter 0.
    If I use counter 1 as a cascaded counter input, it seems to work better than a
    single channel, but it will still error out with the above error.
    If I use only counter 1, I get the error above even faster.
    Also, none of the
    configurations give measurements outside the While Loop.
    The only place I can add a speed dial for the front panel is within the While
    Loop.
    Is there someway to get the signal to continuously send out of the while loop?
    I thought if I could get the signal out of the while loop, I could condition it
    anyway I wanted without the program erroring out.
    Any suggestions would be much appreciated.
    Thank you.
    Attachments:
    Counter_error.jpg ‏45 KB

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

  • Using a counter to create a timing delay

    Hi all,
    I am working on an application where I need to send some digital outputs seperated by precise timing delays.
    So for example, I may want to output a 'high' to channel 1, then have a 20ms delays, then output a 'high' to channel 2, then have a 50ms delay, and so on.
    I want the timing delays to be easily adjustable and I would like them to be precise.
    The program is being set up for hundreds of tests and it will be run once per test. In between tests I will have the opportunity to modify timing delays.
    I already have a cDAQ-9174 chassis and am planning to buy a NI 9401 high speed digital I/O card. It has been suggested to me that I use a counter (which is built into the chassis) to generate the timing delays, which sounds like a good idea to me. However, I don't really understand how to access the counters and configure the 'DAQmx create channel' function because there are so many options for the reference clock which I don't understand.
    I am thinking that I need to implement something like this:
    http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/hwtimedcounter/
    However I'm if this is what I need and I'm not sure how I would go about testing this code. I guess I would need to connect some sort of output to the counter to see if it's working correctly.
    Any help would be much appreciated.

    After a bit of experimenting, now I'm not sure if the hardware time delay has any advantage over the software delay. I can get a constant 5ms delay using the 'wait' function, yet when I use the counter I can normally get a 5ms delay, but sometimes (perhaps one trial out of five) I get a 4 or 6ms delay. I have even seen a 1ms delay using the counter method. Perhaps my method for measuring is flawed though? I have attached some screenshots of my program. If anybody has any comments it would be appreciated.

  • Trouble using the counter on PCI 6025E

    Hello,
    I am facing a problem with the counter on PCI 6025E. I am trying to count the number of pulses generated by the shaft encoder mounted on the shaft of a motor. I am using a channel from the shaft encoder to count the pulses and generate the line state. So, I have wired the channel to pins 25[line state]and 47[counter]on SCB-100. In my application I am using the count events/time vi from DAQ palette. Every time I run my application I have been getting the error NI 10001 saying that the ordering of the strings is not as expected.

    Hi,
    The Count Events & Time.vi is typically used with older counter hardware such as the 9513 chip. Your E Series card (6025E) uses a DAQ-STC chip. The best way to count your edges is to open up the example "Count Edges(DAQ-STC).vi which can be found by selecting Help>>Find Examples... and you will find it under the DAQ Counter examples as an DAQ-STC example. Hope that helps.
    Ron

  • How do I associate a clock (source) with a (or multiple) counter channels

    We are newbies using a 6602 with the SCB-68 interface.
    We are reading 8 different TTL pulse trains. We've determined that we need buffered periodic event counting (BPEC) and that we need a common clock (source).
    We've used the measurement and automation software to confirm that we can see our signal coming into the card. However, we cannot seem to perform functions requiring a clock (e.g. BPEC).
    Question: How do we associate an 80 MHz clock to the source for our counter channels? The the card has clocks, yet our error messages indicate that an external clock had to be used for our task. We may be stuck in the meaning of "external".  Though a clock is in the card, is it considered external to my counter channel? Do I connect it via jumpers in the SCB-68 or are there ways to associate it via commands?

    Hi NHJared,
    There a few examples in the LabVIEW Example finder that will
    help you make these measurements.  (Help
    >> Find Examples >> Hardware Input and Output >> DAQmx
    >> Counter Measurements >> Period or Pulse Width)
    The DAQmx Timing VI should be set to implicit.  This setting will automatically route the appropriate
    clock necessary for your measurements. 
    An external clock is a signal that is created by another device other
    than the PCI-6602 and connected through an external pin on the PCI-6602 (e.g. PFI
    pin) 
    Respectfully,
    Rob F
    Test Engineer
    Condition Measurements
    National Instruments

  • How do you simulate an encoder using a virtual channel?

    I am trying to use MAX to simulate hardware so I can create a program before I purchase the hardware. I will be purchasing a USB-6211,  TTL quadrature encoder, and LVDT.
    I want to simulate a quadrature encoder and a LVDT. I have created a virtual channel for each and a virtual USB-6211.
    The LVDT is simulated by creating a virtual analog input channel. This virtual channel works when I test the vi.
    The encoder is simulated by creating a virtual angle counter. This virtual channel does not work when I test the vi.
    How do I get this virtual angle counter to work?

    Kristen,
    I do not get an error. The problem is that I do not get any action from the virtual channel.
     For
    example, when I created the virtual analog input channel, this channel
    provides a simulated varying voltage when I run the vi. The virtual
    angle counter channel does nothing at all when I run the vi.
    Attachments:
    Simulation Problem.vi ‏124 KB

  • How do I get 12 hardware counter channels?

    Hello,
    I am wanting to count 12 seperate pulse signals. The USB device I am currently using (6501) has only 1 counter channel that works great for one signal, but the extremely short pulses (@5us) makes software programming a nightmare for 12 signals into the digital inputs lines.
    Ideally I would be able to find a dedicated 12 channel usb counter that I can read into labview, but it does not look like an option. It looks like I may have to go with a combination.
    What are cost effective combinations of hardware devices with dedicated counters to supply my total of 12 channel counter needs?

    As always, "it depends."
    What kind of counter measurements do you intend to do?  Occasional on-demand measurements or buffered measurements for transient analysis?
    People's idea of cost-effective varies too.  On the forums, it often means that someone can't spend $1000 on truly suitable hardware, but they *can* spend many extra weeks cobbling together a sub-optimal solution with inadequate hardware.
    3 PCI-express X-series devices would be a very efficient hardware platform for all manner of buffered counter measurements since you get 4 DMA channels per card and you don't share bus bandwidth among cards.
    A single X-series device would let you capture 12 pulses as hardware-clocked digital input signals that you can post-process for pulse analysis.  You could even do neat things like capture based on change detection while using a counter to create timestamps from the change detection event pulse.  In short, it's very likely you can capture all the necessary data but will need to do some software post-processing that's conceptually straightforward but fairly tricky to get completely and exactly correct.
    -Kevin P

  • Counter channels for NI 6343 DAQ

    I have the NI 6343 DAQ using labview 2013.  When I try to create a counter channel it lists channels ctrl0 through ctrl3.  However they are not listed on the pin out for the DAQ - what physical channels are they on the pin out?  I'm assuming they are part of the PFI0-15.  

    Hi jliu317,
    You can use the DAQmx Channel Property node in LabVIEW (or the equivalent in text-based languages) to choose the terminals you want the input or outputs of the counter to appear on. A good example of this can be seen in the Counter - Read Pulse Width and Frequency (Continuous).vi example in the Example Finder. This example is available under Hardware Input and Output»DAQmx»Counter Input.
    If you don't specify the terminals, the counters will use the defaults as shown in the pinouts.
    Best Regards,
    Matthew B.
    Applications Engineer
    National Instruments

  • Counter channels detection through a labview VI

    Hey
    We are having a PCI-6036E card which has 2 counter inputs and this device with counter channels is communicating with the program creadted in Labview.
    We want to upgrade that card with add on counter card of PCI-6624. I even modified the program like increasing the counter channels in the program. Now with functional generator i give frequency as input and that i can read in the MAX through counter channels.
    So when it comes to the program, it is reading only the 0 channel(i mean the first channel) and for the rest of the channels i see NAN. I am messed up and going through the source code but i see no error in the program.
    If i messed up the description i can come back again with better explanation. Can anyone guide me to solve this issue.
    Thank you in advance
    -Kirit

    Hey
    Thank you for the concern.
    I will try to answer ur questions...
    What type of signal are you sending from the function generator to the counter input channels of your PCI-6624?
    Frequency signal with current of 2.5mA. By this i can read the frequency what ever i give in Functional generator through MAX.
    Frequency level is from 100 - 1500 HZ
    Have you tried just verifying the operation in MAX using a counter input test panel for the channels of your PCI-6624
    Above signal i reading it through test panel of PCI-6624 card in MAX
    What type of indicator is it in your program where the NANs show up when you run your program?
    It is numeric indicator i guess. This you can see in to digitals-rpt.VI
    I dont know what else i can do to explain the problem. You can come up with any questions for clarification after going through the llb file.
    I guess, the logic i am missing in adding counter channels in the code is in( to digitals-rpt.vi)
    Pls go through the *.llb file
    Thanks a lot
    -Kirit
    Attachments:
    ver4.33.llb ‏979 KB

  • How do I use a counter for time measurement with NI-DAQmx and C++?

    Hi,
    I need my C++ program to read time (number of elapsed ticks) using the counter on PCI-6229. I had this written and working for the non-MX driver, and now I need to re-write it for NI-DAQmx.
    Here are the steps that I want to accomplish:
    1. Route the 80MHz timebase to the input of "Dev1/ctr0"
    2. Start the counter and let it count the ticks.
    3. After a while, read the number of ticks from the counter.
    Here is how I am trying to do it now (without success):
               DAQmxCreateTask ( "" , &taskHandle ) ;
               DAQmxCreateCICountEdgesChan ( taskHandle , "Dev1/ctr0" , "" , DAQmx_Val_Rising, 0 , DAQmx_Val_CountUp ) ;
               DAQmxConnectTerms ( "/Dev1/80MHzTimebase" ,  "/Dev1/Ctr0Source" , DAQmx_Val_DoNotInvertPolarity ) ;
               DAQmxStartTask ( taskHandle ) ;
               then DAQmxReadCounterScalarU32 ( taskHandle , 0.25 , &curCount , NULL ) ;
               and DAQmxClearTask ( taskHandle ) ;
    No errors are generated, but I do not see the tick count being incremented when I repeatedly read the counter.
    Advice will be greatly appreciated!!

    Hi Peter,
    Welcome to the forums!   I just want to make sure I understand what you are trying to do.  You would like to count the rising edges of the 80 MHz clock using DAQmx in C++.  In order to route the timebase to the counter, you need to use the signal name (PFI8) instead of the counter (Ctr0Source) for the counter source input.  This name is found in Measurement Automation Explorer (MAX) by right-clicking on the device and choosing “Device Pinouts.”  This will physically put the 80 MHz clock on the PFI8 line, so make sure you reset the device or disconnect the terminals after you are done. 
    That being said, may I ask what you are trying to do by reading the number of elapsed ticks?  If you are trying to monitor a hardware timed pulse, it would be better to count the frequency or period of that pulse.  This would provide better accuracy, because you are not relying on how fast DAQmx Read can poll the hardware.  If you are simply looking for a software based timer, I would recommend taking a look at this MSDN forum post. 
    Using the GetTickCount function instead will free up your counter and provide comparable accuracy to counting the edges of the timebase.
    I hope that helps you out, let me know if you have any further questions about this. Good luck with your project.
    Rod T.

  • How to use  the same channel to send a file and messages to the server

    I'm trying to develop a simple program that will send and receive files from the server and in the same time I need to communicate with the server through the messages
    I'm using TCP Socket
    my problem is
    I have only one channel
    so, I have no option, either I can use it for sending the file itself or sending the message .. but not both !
    my question is : How can I use the same channel for sending and receiving (file & message)
    I would appreciate for any clue or hint
    best

    kajbj wrote:
    kmarwani wrote:
    Thanks for reply
    yes, that what I'm thinking to do
    but, in case of sending binary file, if I attached a flag on its header, will it corrupt the file ?
    bestThe other end would of course need to decode the messages that you get, and only write the "data" part to the file.Thanks
    I'm gonna try to hard-code what you suggest and i will post what happen with me here
    even though I'm not sure how can I add header to a binary file and remove it from the file at other end. (coz I read it as stream and send as array without touching its contents)
    this how I'm sending the file
    ConnSocket = CSocket.accept();
    ToClient = new DataOutputStream(ConnSocket.getOutputStream());
    File myFile = new File("abc.jpg");
    FileInputStream myFileInStream = new FileInputStream(myFile);
    BufferedInputStream mybuffInStream = new BufferedInputStream(myFileInStream);
    myBytArray = new byte[(int) myFile.length()];
    mybuffInStream.read(myBytArray, 0, myBytArray.length);
    ToClient.write(myBytArray, 0, myBytArray.length);
    ToClient.flush();
    myFileInStream.close();best

  • How do I use the counter and digital signals of the 6071E while it is connected to SCXI modules?

    I am contemplating using a PCI 6071E with SCXI. We have the boards (6071E), we would need the cable (I suppose SH1006868) and the SCXI system. I would like to know how would you access the counter and digital line capabilities of the board. I will be using a SCXI-1314 with a SCXI-1520 Module for strain measurements but will need to use the counter and digital lines of the board as well. Can this be done? If so, how and/or what else do I need?

    I think this KnowledgeBase will answer the question for you.
    Accessing DAQ Board Counter Pins with an SCXI System
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • I use only two channels, have plenty of memory in my hard disk, and external hard drive, no effects, and still having problems with Garage band. Giving messages as you have too many live channels

    I'm frustrated, I am doing everything you recommend, I use only two channels, have plenty of memory in my hard disk, and external hard drive, no effects, and still having problems with Garage band. Giving messages as you ave too many live channels, the disk is slow prepare...can you help?

    Quote from: Richard on 15-November-07, 20:33:05
    tornado2003,
    What you need to do is boot into Safe Mode. Then delete the VGA Drivers.
    After that boot normally and install the latest nVidia ForceWare Drivers
    Take Care,
    Richard
    i guess you missed that:
    Quote from: tornado2003 on 15-November-07, 17:26:52
    ive tryed booting xp in safe mode but it just freezes after it loads up a couple of needed files .
    ive even formatted my hard drive and tryed installing a fresh xp on it but it just keeps locking up when it gets to the "starting windows setup" .(this is just after it loads all the drivers from the xp cd)

  • How to use a counter to build a Logic Analyzer?

    Hi guys, i have heard that we can use a counter as a Logic Analyzer based on an incoming signal and its clock frequency. Anyone know how this works?
    I am trying to read a set of signals, which I have no knowledge of  except that there would a Clock, reset and a data line; and I want to develop a Logic Analyzer to 'know' these signals.
    Thanks, Anoop
    Solved!
    Go to Solution.

    Lynn,
    I have a PXI-7813R, which along with its FPGA is sufficient I believe for this purpose.
    How many digital signals do you need to examine simultaneously?
    Well, I am not sure, but based on the signals generated by similar devices, I would guess between 4 and 6. I expect there to be a Clk, Rst, Data and some other signals.
    What is the maximum frequency?
    I have no idea or how to even come up with a guess on this one.
    What is the maximum and minimum number of samples per signal that you need to capture?
    Again, not a clue. Would it not depend on the Clk frequency?
    Are any of the signals ever in a high impedance (tri-state) mode?  
    Again, don't know, sorry.
    Is the minimum pulse width for non-clock signals the clock period, half the clock period, or something else?
    Sorry again.
    How would you go about in this situation?

Maybe you are looking for

  • Payload Swap bean not working

    Hi All, We are working on PI 7.11. We are trying to retrieve the attachments from the mails and convert them into files. We have enabled Keep Attachments in sender mail adapter. For swapping the payload we used payload swap bean. We referred the belo

  • How to get rid of spacer.gif?

    Hello there, I have an assignment for class and my teacher hasn't gotten back to me yet. I created a site in fireworks (cs6) and then he says to export it. As I was building it and previewing it in a browser, I see these blank white boxes in certain

  • Wireless data flow

    I have a question about how wireless data traffic flows between 2 wireless clients that are associated with the same AP/WLAN/subnet. It doesn't have to go through the WLC, does it? Is this documented some where on Cisco website that I can find? Thank

  • What is ws_upload, upload and gui_upload?

    while i am doing recording sing fk01   in bdc when i am trying to upload .prn file one message is coming i.e. ws_upload is obsolete use gui_upload? then i used gui_upload but .prn file not uploading?why?

  • No new slideshow features in LR Beta 4???

    While it looks like there have been some great updates in the forthcoming version, I'm surprised to not see mention of any new slideshow functionality. LR3 was very disappointing in this regard only letting you use one song and also no ability to app