Using reference counter with 6602 board

I want to control a 6602 card in a Labview application so that I can count events in channels 1-6 depending on a reference counter in channel 0. I've set up channel 0 to count from a fixed value down to 0, and I am using hardware triggering to start all counters. Now I need something like a stop trigger to stop my event counters simultaneously when counter 0 reaches zero.
I tried to use counter 0 output as a gate for the others, but without success. Unfortunately, the help files for the TIO counter VI's are pretty lousy (nudge, nudge), so I'd be grateful if someone could give me a hint how to solve this problem.
Sebastian

Hi Sebastian (whatthehellamithinking),
Nice name I think your idea about using counter 0 output as the gate signal is the right idea. However, I would make sure to configure a couple things. The first thing I would do is configure counter 0 output for toggle mode. This means when the counter rolls beyond zero it will toggle it's output. I would alsoe configure the output to be configured as high-to-low logic. Then I would connect it to the gate of all the other counters (make sure to configure a gate on each counter). The gate should initially be high on each counter since the output of counter zero should be high. Then when it rolls or reaches terminal count it will toggle the output which will gate each of the other counters.
Anyway, not sure i
f you tried it that way but I think it shoud work. Hope that helps. Have a good day.
Ron

Similar Messages

  • Using timer/counter with PCI-6221/USB-6210 to control timed-loop VI

    Dear all,
    I need to ask about two devices and one of their functionalities, PCI-6221 and USB-6210. For our NI-based system, we need to control some timings in a Timed-Loop vi, for that currently we are using PCI-6221 and we give external TTL signal (at 1 kHz) to it,
    recenntly we need to make some changes and for that we found USB 6210 DAQ to be more suitable, but we need to clear ourselves on some specific things.
    Can the counter/timers functions available in the either PCI 6221 or USB 6210 can be used to control the Timed-loop VI by giving external clock or by using their own internal clock source?
    Although we are using external clock with the PCI 6221 but we want to know about the usage of their internal clock, also are controlling timed-loop also possible for USB-6210
    Also... What if we use the RTOS, are they still able to control the timed-loop VI  without giving any 'EXTERNAL CLOCK' and using the internal clock sources of the DAQs
    Waiting for reply,
    Bests,
    RaJaf
    Solved!
    Go to Solution.

    Ben,
    I having read previous email which I send earlier with general overview, we discussed in more detail within our team and I am giviing the specific answers.
    Please check in RED the most recent answers. Blue are the questions/suggestions by your side.
    1.    Using Internal hardware clock of PCI-6221 would enable us get rid of external clock, but how to divert the internal hardware clock to the current settings. Any idea  (can you provide us with some reference manul for otherwise). I mean is there some flag-bit etc. or VI
    2.       Is it also meant that with the installation of RTOS the timed-loop can directly get the timing source from the internal hardware clock PCI-6221? --- How???
    3.       In order to make desktop to work as RT system, what is the hardware (motherboard, processor, etc..) requirement? What are the LabVIEW modules (specific name) that needed to be installed? Our platform is LabVIEW 8.6. (Currently we have windows-7 with i7 core processor)
    What kind of application are you intending for this system? ---- high-speed laser scanning system.
    Are you most concerned about accuracy, speed, or responsiveness? To control the laser mirror scanner to move at 1 kHz or 2 kHz speed. On the other hands, using PCI-5105 (128 MB memory) as a DAQ for real-time/on-the-fly data processing.
    Bests,
    RAJAF

  • Using one counter with FiniteSamps and another with ContSamps

    I am trying to use 2 counters on the USB-6229 (or USB-6259), where one counter is set up for FiniteSamps and another for ContSamps. I have the following MeasurementStudio code:
    ErrChk DAQmxCreateCOPulseChanTicks(hCnt0, "Dev1/ctr0", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
    ErrChk DAQmxCfgImplicitTiming(hCnt0, DAQmx_Val_FiniteSamps, 100);
    ErrChk DAQmxStartTask(hCnt0);
    ErrChk DAQmxCreateCOPulseChanTicks(hCnt1, "Dev1/ctr1", "", "20MHzTimebase", DAQmx_Val_Low, 0, 400, 400);
    ErrChk DAQmxCfgImplicitTiming(hCnt1, DAQmx_Val_ContSamps, 2);
    ErrChk DAQmxStartTask(hCnt1);
    When I run it, I get a run-error 50103 "The specified resource is reserved". If I change the FiniteSamps to ContSamps on the first counter, everything works fine.
    If I use only one counter with FiniteSamps, everything also works fine.
    Is this a bug in DAQmx or the dual counter use on M-series devices is limited to ContSamps?
    Vic
    Solved!
    Go to Solution.

    Hi Vic,
    This is actually expected on an M Series device.  Here's a timing diagram from the M Series User Manual that might make this a bit more clear:
    The device actually uses one counter to gate the other so the result is a finite pulse generation.  If you can provide the gate from another source, you may configure a continuous pulse generation on both counters and gate them (DAQmx calls this a "Pause Trigger") from this external signal. 
    You might also want to look into using Correlated Digital I/O to generate multiple finite pulses (up to 32 lines on your 6229 and 6259).  You could use one of the counters to generate a timebase for the digital lines, and build the waveform accordingly.
    One thing to note is that our new X Series boards can generate a finite pulse generation on a "single" counter (there is actually a paired internal counter that allows for this).  There are four user-accessible counters on X Series devices, meaning you could generate four finite pulse trains.
    Best Regards,
    John
    John Passiak

  • Increase Registry Reference Count with Labview Installer

    I am trying to create an installer that is using an ActiveX control.  There are instructions on what files need to be installed and registered (See attached pdf).  I think I have the files going to the proper destinations and the ones that require registration I have checked the register COM in the source file settings section.  However I am unsure about two items.
    1.  There is a file (IAT_YUV.ax that needs to be registered, how do I go about doing that?
    2. There is a statement in the instructions as follows:
    All files marked with *) must be registered using regsvr32.exe. It is very important to copy all files to the target computer, before registering these files. Most setup toolkits have an option to automate this task.
    For all files marked with **), you have increase their reference counts in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr​entVersion\SharedDLLs. Most setup toolkits have options to perform this step automatically.
    I am not sure how to accomplish this in the Installer?
    Regards
    Terry.
    Attachments:
    IC Image Control Deployment.pdf ‏34 KB

    Hi Terry,
    The answer to your question is quite involved. We have this knowledge base article that you can follow for registering (IAT_YUV.ax and similar files. You will write a LabVIEW executable that uses the System Exec VI to register the ActiveX dll. To include them in the installer, under the Installer Properties»Advanced..., select Run executable after installation and add the above executable. Therefore when the installer is finished your executable that registers the dll will automatically run. While this process is pretty involved that should be all you need to do.  Hope this helps!
    Regards,
    Travis Ann
    Customer Education Product Marketing Manager
    National Instruments

  • Synchronize sampling of rpm using frequency counter with force (voltage) signals

    I have a VI attached which converts the voltage values measured from the ATI force/torque senosr to force values. I would like to integrate the measuring of TTL pulses from an RPM senosr. There is a bug with my current program, as the RPM value only updates once. If I put the read VI in a while loop, the program returns an error. How should I modify my code to solve this, and as well as to synchronize the recording of data from both sensors?
    I have no prior labview experience, and really appreciate any help.
    Attachments:
    atidaqft-mx.llb ‏93 KB

    Dear Jochen,
    (1) Principally, I'd like to use PCI-6602 to be a motion encoder also be a counter (Is it possible? Due to the manual, it is possible). I expect to have all information, such as position, time, velocity, etc. from that motion encoder (or at least the position and time). It is also expected of using PCI-6602 to do all measurements that I mentioned before . My meaning is, after having a signal from the counter, that 'count' will be converted to desire units under other programs. So, in this case, PCI-6602 is only used to get the 'count'.
    Simplified, the voltage command will send to the system (linear motor) through PCI-6052E (-10V to 10V). The actual position or other actual information will be catched (read) by using PCI-6602 (as a motion encoder, also as a counter). Then, this actual position will be used as a feedback, that will be compared to desired position.
    Is that also possible to use PCI-6602 be a motion controller + a counter + a frequency measurement in a same time parallely?
    I don't decide yet (I don't know) which acquisition rate will be needed/required, higher is better.
    (2) I'd like to apply an adaptive robust controller (yes, it is a closed loop system) under matlab with their feature called Real-Time-Workshop instead of using LV.
    (3) Power drive for the linear system will be driven by AC servo drive.
    Thanks for your help before,
    Warmly regards,
    hendro

  • Using reference monitor with master clip

    I love the ability to color correct the master source rather than each timeline clip! I love it so much that I want to color correct my master clips independently of the editing process but the problem is that I cannot get the reference monitor to display a scope that is synchronized to the master source clip.
    In working around this the old way, edit-first, I still find often that other parts of the master clip (not chosen for a sequence) are much better for color correction (like a good face or a color calibration card.) Thus I assume there is a way to do this that I do not understand? (Or, alternately, am I thinking about it wrong?)
    Thank you!

    I have identical real time TC for all 3 cameras, and two cams are continually recording. the third is roaming.
    Here's a link to a past project: News & Events :: PCC's Christmas Lights Spectacular :: Pensacola Christian College
    As you can see, one is locked, one is on a tripod getting closeups, zooms, and pans, and the third is moving around getting various angles. The two on a tripos are left continually recording, but the roamer starts and stops (it's handheld, so it's easier to just start/stop).
    @shooternz, could you elaborate on your method a bit? You seem to indicate that you can just drop the third camera's clips in the sequence based on Time Code. I'm not familiar with TC Panels or TC Markers.
    As for not all of them being used... I do have several dozen clips left over the course of a half-hour concert... :/

  • String reference count

    Hi,
    is copy a string to another string a real copy or is it just an increment of the reference count to it. For example if used like this:
    private void foo()
         String data = getFooData();
         lastData = data;
         if (someThingTodo) {
              // do something
              lastData = null;
    }If it is a question of reference count, then this code only increment, and eventually decrement it, right ?

    Assigning to a reference type--String, Object, List, MyClas, etc.--never copies the object. It always just causes the reference on the left side to point at the same object that the reference on the right side points to.
    Java doesn't use reference counting for its memory management. But if your question about decrementing is in the vein, "Will the VM automatically detect when an object can no longer be reached and make its memory available for use by other objects?" then then answer is yes, that's taken care of for you.

  • How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO?

    How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO? It appears as if the Digital I/O modules for CompactRIO are much slower than this.
    Thank you,
    --Ray

    Hi Ray,
    The highest frequency input we offer for C Series modules is 20 MHz if you are doing LVTTL and 10 MHz for 5 V TTL.  These modules are the 9402 and 9401, respectively.  Unfortunately, there is no 80 MHz input on this form-factor.
    Regards,
    Chris E.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • 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;      

  • How do I set a PFI to High on a 6602 Board with DAQ Traditional

    Dear All,
    I am using LabVIEW 8.5 on 32-bit Windows XP with an NI 6602 DAQ board. In the past I've used DAQmx but for compatability with older software I need to do a few simple things using Traditional DAQ, which I have never used. Specifically I would like to make a simple VI that sets PFI 5 to high when the user presses a button and then low when they press the button a second time. How do I set PFI 5 for output and then write true to it?
    Thanks,
    Ed
    Solved!
    Go to Solution.

    Dear All,
    Apparently its as simple as using the Write to Digital Line VI. However, the non obvious thing is the port width of the 6602 board is 32 not the default 8. Buried in the LabVIEW help files is a list of physical port widths that one must stumble upon. Like the bat cave. In the attached image of the super simple VI I've made the 16 refers to PFI 16. Good to know.
    Best,
    Ed
    Attachments:
    write_low.JPG ‏5 KB

  • Count digital events on a Counter with pci-6602 with callback on CVI

    Hi,
    I'm using a PCI-6602 card with CVI 8.5 and I need to trig on event.
    On every pulse I received, I need to do some actions like increasing a counter, send a message on Rs232 etc.. I don't want to do any loop checking that the counter value has changed. I would like to use a callback to execute this code only on the edge or counter value event.
    My problem is that I don't know which function can do this. Is there any way to get an event on a pci-6602? 
     Thanks 
    James 
    Solved!
    Go to Solution.

    Hello.
    It's completely possible to create a callback that will allow you to do what you want when a edge will occur on an external signal you define.
    To do this, you can for exemple create a counting edges task that will use one of the 6602 counters,and the set your external signal to be the source of your sample clock.You'll then be able to register a callback with the function DAQmxRegisterSignalEvent, and your callback will be called each time an edge will occur on your specified sample clock source.
    Here's 2 links that explain the events in DAQmx and how to handle them in CVI. The example ReadDigChan-ChangeDetectionEvent.pr that ships with DAQmx examples (Hardware Input and Output<<DAQmx<<Digital measurements) can be very useful to understand how to do. This example creates a signal event callback to detect change detection for digital inputs.
    Regards.

  • "reference count underflow" printing NSDocument using "Save as PDF"

    Hello, I'm getting a "reference count underflow" error trying to do a "Save as PDF" in a NSDocument class using the printOperationWithSettings method. There are no errors sending to the printer or viewing the output in preview. I found the post http://discussions.apple.com/thread.jspa?messageID=8708986&tstart=0 which was posted a year ago showing a 10 line program with the same error. I've got garbage collection turned on.
    Is this still a know problem?
    Thanks

    Oh I do get the "reference count underflow" when compiling and running the above 10-line program.
    If I create a new "Document-based" project and setting "Garbage Collection" to required, add an IBOutlet variable to reference the NSTextField generated, and add the following required method for printing:
    - (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings error:(NSError **)outError
    NSPrintInfo *tempPrintInfo = [self printInfo];
    if ([printSettings count]) {
    tempPrintInfo = [[tempPrintInfo copy] autorelease];
    [[tempPrintInfo dictionary] addEntriesFromDictionary:printSettings];
    // textField is an IBOutlet variable
    NSPrintOperation *op = [NSPrintOperation printOperationWithView:textField printInfo:tempPrintInfo];
    return op;
    I can print and "Open PDF in Preview" without errors, but get the "reference count underflow" with the "Save as PDF".
    The sample application "SimpleStickies" created in 2009-10-14 and has by default Garbage Collection required, gets the same errors.
    Is there a simple solution to creating a document-based project that allows "Save as PDF" to work.
    This is a common function. I know I'm missing something obvious.
    Thanks!

  • How to create counter with charcteristic values  using exception aggregatio

    Dear Experts,
    Can some one help me on the below issue
    Requirement : Creating a counter with char ( accounting doucment number) in the query by using exception aggregation & summarize on totals with CKF.
    Note : i dont have any keyfigure called counter in my infoprovider
    Please let me know how to create it.
    I came to know  that  create  new  CKF  & FV with replacemtn path with IO(Account document number)  & use FV in CKF. is this true & works??
    Please let me know how i should  proceed ahead??
    Thanks
    Surendra

    I have resoloved by own
    By  createin zckf--> fv choosing replacement path with IO as reference and key.
    then excepetion aggreation chosen : counter for all detailed values & check the checkbox calucate after aggreagation.
    Thanks

  • Reset 6602 Counter with Software

    How can I reset a 6602 counter through software (using DAQmx functionality i assume) while a counter task is running?  I would like to be able to reset the counter at any point while the task is running without restarting the task itself.
    Message Edited by MREDAY on 06-08-2009 02:46 PM
    Message Edited by MREDAY on 06-08-2009 02:47 PM

    Sam,
    This sounds like a very strange problem, and difficult to diagnose without more information.  Is it consistent about how many times you can stop and restart the task before running into this problem?  Can you go into MAX and start and stop the Test Panels repeatedly without any issues?   What about running the example programs, do they work fine?  Also, does it give you any kind of error message when it crashes and/or the next time you open your program?  (What are you using to communicate with your cDAQ?  LabVIEW?)  
    Also, which version of the DAQmx drivers do you have?  If you don't already have the latest version (9.0.2), I would recommend upgrading.  You can download the latest ones here.   Do you have any other computers that you could try this on?  It would be interesting to see if you see the same behavior there.  
    -Christina

  • 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.

Maybe you are looking for

  • Windows 7 Ultimate 64bit upgrade to Windows 8 Pro RTM 64bit hangs

    I am trying to upgrade Windows 7 Ultimate 64bit on a Dell Alienware Aurora R3 desktop PC via DVD to Windows 8 Pro 64bit (RTM) and it freezes on the Windows Splash Screen after the installation and then after the restart. It looks like it has put the

  • Pop up text boxes on mouseovers

    I'm looking for an easy way (and the easiest tool to use between Dreamweaver, Fireworks, and Flash [and I'm guessing 'Fireworks']...or maybe Flash---I have Studio MX2004) to create not a 'pop-menu', but 'a Pop-Up TEXT box' on a mouseover event. For e

  • How do I sync my email between my iPhone and iPad?

    How do I sync my email between my iPhone and iPad?

  • Tax calculation on down payment

    Hi all, At the time of progress billing- there is no tax calculation for down payment for Service Invoice. so tax calculation on down payment will be FI step through(F-29). For e.g total contract value is 1000 and 10% is down payment..for this tax wi

  • Any reason to scan PXI-2575 and SCXI-1127 in a particular order?

    Hello- Is there any reason to prefer one scan-list order over any other? specifically is it better to scan through ch0, ch1, ch2, etc rather than randomly? It doesnt seem like it would matter.. but many DAQ devices behave strangely if you scan them i