Variable frequency counter output

I found this example of how to vary the frequency of a counter output, but it appears this is not supported and i receive the following error. Can anyone tell me if there is an alternative method at all? my device is a usb6341 which has 4 COs
thanks
Attachments:
Capture.JPG ‏118 KB

If you found that code in an NI-provided example, it's probably more likely that the operation is not supported by your specific hardware.
What is the range of frequencies you want to create?
How accurate does the clock need to be?
How often will the frequency be changing?
Can the hardware receiving the clock tolerate and "discontinuities" in the pulse train?
You could momentarily stop the clock, change the setting and then restart it.
MIke...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • Continous sound output with variable frequency?

    Hi all!
    I wanted to output a signal via the soundcard with one variable frequency.
    How can I do that?
    Thanks
    ANDY

    Hi Andy
    I'm afraid I've only got access to 7.0 & 7.1.
    SO Set Num Buffers.vi uses a Call Library Function node to access lvsound.dll.
    Hmmm...
    I've had a scan around and you could try checking this link
    It may give you some clues.
    Good luck
    Neil

  • Variable frequency driver control by analog voltage output

    I need to drive a variable frequency inverter to drive a compressor and I am too newbie in this kind of works. The inverter can be controlled by analog voltage input and I have NI9188 and NI9263. I have never used analog output modules before and I have some doubts about them.
    1. how could I drive the motor continuously?
    2. do I have to use device internal clock or software clock?
    3. in some examples, a waveform is generated and sent to the write daqmx vi to generate analog output. do I need to do it? (By the way, I prepared a control subVI to send the required input voltage data to the write daqmx.)
    4. It is talked about pulse with modulation sth like that. What is it exactly? Do I need to concern about it?
    I need to drive the compressor with two temperature feedback so I prepared a huge program by master/slave design pattern. I attached it. Does this program work? I do not want to harm the motor so I could not test it.
    Egemen
    Attachments:
    Control Project.v0.zip ‏2672 KB

    Hi newbieeng,
    I hope you are doing well today!  I can help answer questions, but I can't debug a program and say whether it will work or not.
    A lot of these question depend on your specific application and can't be answered in general.  I would take a look at the specifications document for the NI 9263 and also the specifications for your motor.  I'm including a link below to the specifications document for the NI 9263.  I would highly recommend looking at the current draw of the motor.  The most the NI 9263 can drive is 1 mA per channel.  
    OPERATING INSTRUCTIONS AND SPECIFICATIONS
    NI 9263
    http://www.ni.com/pdf/manuals/373781e.pdf
    As far as hardware timing vs. software timing, it really depends on what you want to do.  Hardware timing provides most more precise control over the timing of the output.
    From one of the subVIs you provided, there seems to be a mention of a relationship between frequency and RPM.  Is this representative of a control signal the motor expects?  Is this the pulse width modulation (PWM) you were talking about?  If your motor requires PWM, then you will need to send it the appropriate signals.  I'm attaching a link below to an example regarding PWM.
    Pulse Width Modulation
    https://decibel.ni.com/content/docs/DOC-17537
    Hopefully some of this is helpful!
    Josh B
    Applications Engineer
    National Instruments

  • How to continuously generate a pulse train with variable frequency

    Dear all,
    I am trying to use NI-USB 6259(BNC) to send Pulse signals to conduct position control of a servo motor with labview. The position control of servo motor follows these rules:
    The number of the pulse train determines how many degrees the motor rotate ;( e.g. the angular position of motor)
    The frequency of pulses determines how fast the motor rotate; (e.g. the speed of motor rotating)
    The digital determines the direction of rotation of motor (e.g. clockwise or counterclockwise)
    My question comes when I need to continuously generate a finite plus train signal in a period of time. Below is a sample:
    Time(s)
    Number of pulses
    Direction of rotation
    (1 is clockwise, 0 is counterclockwise)
    Frequency
    0-1
    923
    1
    923hz
    1-2
    3540
    0
    3540hz
    2-3
    1751
    1
    1751hz
    3-4
    2663
    0
    2663hz
    4-5
    353
    0
    353hz
    5-6
    1017
    1
    1017hz
    6-7
    3436
    1
    3436hz
    7-8
    302
    0
    302hz
    8-9
    1513
    1
    1513hz
    9-10
    570
    1
    570hz
    Here is the explanation of this table, the motor keeps rotating in clockwise direction during 0~1s. When the time reaches 1s, the motor just complete the rotation of 923 pulse signals. And then the motor starts to rotate in counterclockwise direction during 1s~2s. When the time reaches 2s, the motor just complete the rotation of 3540 pulse signals. So we can see that the rotating speed of motor in 0~1s is different from the speed in 1s~2s. Namely, the frequency of pulse signal in 0~1s is different from the frequency in 1s~2s.
    I have already use the counter output of DAQmx, it just can generate pulse signal with certain numbers and certain frequency in one time. The attachment is the vi which can generate a finite digital pulse train from a counter output channel and the frequency, duty cycle, Initial delay, and Idle state are all configurable.
    How can I continuously generate  a series of pulse train with varying numbers and frequencies during a certain period of time.
    Thank you very much for your help!
    Solved!
    Go to Solution.
    Attachments:
    Counter - Finite Output.vi ‏57 KB
    Finite output.png ‏13 KB

    Hi aacuna,
    Thank you for your reply!
    I already checked that  article.  The frequency in that Vi can change dynamically, but the method of adjusting the frequency is ‘manual’ .Below is the front panel of that Vi. When the Vi is running we can change the frequency by press the button.   
    Time(s)
    Frequency
    0-1
    923hz
    1-2
    3540hz
    2-3
    1751hz
    3-4
    2663hz
    4-5
    353hz
    5-6
    1017hz
    6-7
    3436hz
    7-8
    302hz
    8-9
    1513hz
    9-10
    570hz
    Thank you!

  • Frequency counter unreliable using rotary vane anemometer

    I have set up an anemometer to measure air flow speed, with the signal being acquired by a 9402 module in a cDAQ-9174 chassis (4 slot). I am using Signal Express 2011 to program the instrument.
    I have set up a frequency counter task, using a maximum frequency of 1.8 kHz a minimum frequency of 250 mHz, rising edge and 1-counter (low frequency). The output is scaled using y = 0.0111x + 0. This gives 20 m/s when the frequency is 1.8 kHz.
    The readings given by Signal Express give a very noisy signal, at a frequency much higher than the bandwidth of the anemometer. The range is in the order of 20% of the mean. I have attached a PDF of the signal, for two different air flow sources, the seproj file and the tdms file for one of the runs. I have also observed that the counter output is rounded to the nearest multiple of 10, e.g. 490, 470, 480, 480, 470, etc.
    Is this consistent with a digital bounce issue? Is this consistent with an earthing issue? Is this consistent with a sample rate issue? Any other ideas for investigating this issue?
    thanks
    Attachments:
    EXPT 20 - ANEMOMETER NOISE.pdf ‏49 KB
    EXPT 20 Anemometer Noise.seproj ‏637 KB

    I have logged the voltage signal coming from the anemometer, using our 9239, a report of a few cycles is attached as a PDF. The graph clearly shows a small digital bounce. The noise is small compared to the signal, is there any way it can be filtered when acquired by the 9402?
    Other tests that I ran showed a background noise in the order of 50 microVolts and a frequency of 50 Hz, this is very likely a background noise from a power supply (we run at 50 Hz in Aus) but is many orders of magnitude smaller than the signal, I assume it would be ignoredby the 9402.
    Attachments:
    EXPT 20 Anemometer Noise Voltage.seproj ‏261 KB
    EXPT 20 Anemometer Noise Voltage.pdf ‏19 KB

  • Counter Output/Counter Input PXI Signals Behaving Erratically

    Question for all your LabVIEW guru's out there,
    I am running a frequency loopback test using the NI PXI 6229 MIO DAQ card.  I am generating a "Counter Output" pulse train signal which feeds through my device under test and then back out of my device under test and back into the PXI 6229 for a "Counter Input" frequency measurement.  Both the "Counter Output" and the "Counter Input" are assigned different PFI lines using DAQmx in LabVIEW.
    I have 4 lines to test on my DUT.  All four lines run this same frequency measurement but with different PFI lines on the PXI 6229.  Each line is test independently.
    This is my setup for the 4 lines:
    Path 1: P2.0 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.1 (Counter Input - Frequency Measurement)
    Path 2: P2.2 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.3 (Counter Input - Frequency Measurement)
    Path 3: P2.4 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.5 (Counter Input - Frequency Measurement)
    Path 4: P2.6 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.7 (Counter Input - Frequency Measurement)
    where:
    P2.0 = PFI8
    P2.1 = PFI9
    P2.2 = PFI10
    P2.3 = PFI11
    P2.4 = PFI12
    P2.5 = PFI13
    P2.6 = PFI14
    P2.7 = PFI15
    I have a LabVIEW VI which generates the "Counter Output" and reads the "Counter Input" frequency.  I am seeing weird behavior from the PXI 6229 card. I can test "Path 1" and "Path 2" and the frequency I read is what I generated. No issue there. However, when I test "Path 3" and "Path 4" the frequency measurement is erratic.  The readings are two different frequencies repeated over and over again and none of those frequencies are the expected frequency which was generated out of the "Counter Output."  If I reset the card, and start by testing "Path 3" and "Path 4" the frequency readings are correct and the erratic behavior is gone.  However, when I try to then test "Path 2" and "Path 1" now those lines have the erratic frequency issue. I can continue resetting the card and see same issue. The PFI lines that I test first will always pass.
    To summarize:
    Steps Taken:
    1. Test Path 1 = SUCCESS
    2. Test Path 2 = SUCCESS
    3. Test Path 3 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    4. Test Path 4 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    5. Reset the PXI 6229 Card
    6. Test Path 3 = SUCCESS
    7. Test Path 4 = SUCCESS
    8. Test Path 3 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    9. Test Path 4 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    I am wondering if Port 2 (P2.0-P2.7) on the 6229 card has certain dependecies and this is why I am seeing issues.  I am trying to get around this issue so that I don't have to always reset the card.
    Are P2.0-P2.3 (PFI8-PFI11) and P2.4-P2.7 (PFI12-PFI15) treated differently or require different setup?  How do I resolve this issue?
    Thanks so much!

    I have a theory...
    The DAQ card follows a policy called "lazy uncommit" wherein the terminal used for the output will continue to be connected to the counter even after the task has completed (until the terminal is needed for something else).  So as you run more tests, the counter output will end up driving more lines.  This behavior should be easy enough to confirm.
    As the DAQ card drives more lines, I'd imagine this affects the actual signal.  You could scope it to check, but it sounds like either the rise/fall times are becoming longer or some extra noise is being introduced on the line.  
    The readings are two different frequencies repeated over and over again and none of those frequencies are the expected frequency which was generated out of the "Counter Output."
    This implies you are picking up an extra edge during transitions--this isn't too uncommon if the signal is noisy since there is no built-in hysteresis on the DAQ card.  I would expect the measured frequencies to have periods that sum to either the full period or the semi-period of your actual signal (depending on how many duplicate edges are detected).
    Suggestions are as follows:
    To stop the DAQ card from driving multiple PFI lines, it would probably be easiest to just programmatically reset the device in between your tests (using DAQmx Reset Device).  If you can't reset the device (e.g. because you are running some other task that can't be interrupted) then you can instead configure a dummy task that uses the PFI line in question as an input.
    To stop the DAQ card from picking up multiple edges during transitions, you should configure a digital filter on the input terminals.  If you reset the device it sounds like this might not be necessary... it's up to you if you want to configure this or not.
    Best Regards,
    John Passiak

  • How to Immediately Change Counter Output Rate?

    I have a piece of code that largely works like this example: http://zone.ni.com/devzone/cda/epd/p/id/5493
    In other words, I set up the Counter Output with some initial frequency and duty cycle, but then during the main loop of my program I continuously change the frequency to a new value based on other criteria.
    I'm using an M-series PXI card and LabVIEW RT.
    The problem I'm having is that the card waits for the next edge before changing the counter output rate. For instance, lets say it is going at a low frequency and I am upping to a high frequency. If the command arrives in the middle of the current pulse, it will wait to complete the low-rate pulse before starting the high frequency output. Is there a way to make it interrupt the current count and immediately start counting at the new rate?
    Thanks,
    Isaac

    Hi Isaac,
    I posted the code in LV 8.2 so you should be able to open it now (it sometimes takes several minutes to upload).
    There are a few limitations to using the digital lines instead of the counters:
    1.  The digital lines are updated off of a sample clock which will be much slower than a timebase.  For example, on the 6221 the maximum update rate is 1 MHz, while the counter output has a max timebase of 80 MHz. As a result, the number of frequencies you can generate are going to be more restricted (divide down from 1 MHz vs. 80 MHz).
    2.  On M series devices, the digital lines must be clocked from an external source.  This could be generated from a counter
    3.  You have to build the digital waveform, which is a bit tricky (I think the example code should help out with that but I haven't had time to thoroughly test it).
    4.  If you are generating digital lines at fast rates, you will need to write quite a few samples at a time to the output buffer to ensure the data does not underflow.  If the buffer includes multiple periods of the digital signal, you would have the case that using the counter output would still update more immediately.
    Again, to determine the best course of action it would be useful to know what frequencies you want to generate and which exact hardware you are using. I just mentioned the digital lines as an alternative to the counters, but it might not be ideal for your situation.
    -John
    John Passiak

  • Frequency counter

    sir,
    our project is about designing an "eddy current based sensor for contactless measurement of breathing".we had so far designed an colpitts oscillator with 12MHZ of output,this frequency is converted to square pulse using a schmitt trigger.Now we want to know whether it is possible to count this frequency of 12MHZ in lab view?.what is the maximum and minimum frequency counted by lab view?
    Solved!
    Go to Solution.

    Not until you tell me exactly which DAQ hardware you are using (model number) and what you mean by "feeding 12MHz to LabVIEW". Are you trying to measure the frequency, pulses, edges, what?
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

  • Setting the counter output mastertimebase divider?

    Hello
    I want to output single short pulses with varying pauses. My MuFu DAQ card has 20 MHz master clock rate and 24 bit counter (Good ol'6052E). When I try to output 1 µs with a pause duration of more than 839 ms, I get an error due to mismatch of clockrate and counter bit size with short and long duration. This is explained in great detail in the corresponding help:
    2/ counter clock rate <= X <= 2^24 / counter clock rate. with counter clock rate = master clock rate / divider
    0.1 µs               <= X     <=   16777215 / 20Mhz = 839 ms
    I could strech my limits by manually setting the CO.CounterTimebaseMasterTimebaseDivider to 10. But I've searched all property nodes I could find but I have not found this property.
    Does anyone know where it is hidden, and to which values it can be set?
    Thank you
    Michael

    Hi Michael,
    Unfortunately that property doesn't exist.  There are a few "Divisor" properties available for other subsystems (e.g. see Analog Input timing block diagram below).
    However, you'll notice in the above diagram that the valid divisors of the master timebase are only 1 or 200 (which then gives the AI Sample Clock Timebase).  You can get similar behavior on the counter by specifying to use the 20 MHz timebase or 100 kHz timebase for your source.  However, using the 100 kHz (1/10 us) timebase is going to prevent you from properly generating the narrow 1 us pulses that you require.
    So, you can use 20 MHz or 100 kHz without any additional resources, but 100 kHz wouldn't allow you to have a 1 us pulse, and 20 MHz won't let you have a high or low time of greater than ~839 ms.  You could generate frequencies in between these to use as the counter timebase (either use the frequency output or use the second counter to generate the desired frequency, or perhaps configure a dummy analog task) but of course there would always be a tradeoff between the resolution of the pulse and the maximum time between pulses.
    If you do have the 2nd counter available, here is my suggestion to get the best of both worlds:
    1.  Configure a counter output to generate a pulse every N seconds (I suggest configuring the output to generate at 1/N frequency at 50% duty cycle).  When you configure this counter, DAQmx will choose an appropriate timebase for you.  When N is less than ~1.67 seconds, DAQmx will use the 20 MHz timebase (since both the high and low time would be under the 839 ms).  When N is > 1.67 seconds but below ~335 seconds, DAQmx will use the 100 kHz timebase.  If you intend on modifying the rate of the output (to something above 1.67 seconds) after the task has started you would need to make sure to specify to use the 100 kHz timebase rather than relying on the DAQmx default.  You can't use a built-in timebase if you want to generate a delay greater than 335 seconds, but if you wanted to you could handle this case by checking for it and configuring the frequency output to generate an even lower timebase.
    2.  To generate the actual output signal, configure a retriggerable single pulse generation to be triggered off of the signal generated above.  This signal will be based off of the 20 MHz timebase (assuming you configure a pulse width less than ~839 ms) and so will give you a good resolution on the available pulse widths that you can generate.
    In summary, doing this would let you decouple the resolution of your generated pulse width from the resolution of the delay between the pulses.  The downside is that it uses two counters.
    The other option which I previously mentioned (and what you were asking about) would be to find a timebase that meets the two requirements: 1) fast enough to generate a narrow pulse and 2) slow enough to not roll-over between pulses.  You have 100 kHz and 20 MHz available to you, but you can generate intermediate frequencies using the frequency output.  If you plan on using a counter to generate the timebase instead, you should consider the other option which decouples the two counters.
    Of course, using a device with a higher counter resolution (most newer DAQ devices use 32-bit counters) would probably also resolve your issue depending on the full range of  delays that you need.  The downside here is the cost of new hardware.
    Best Regards,
    John Passiak

  • Changing the PXI-6624 Counter Output rate on the fly

    I'm programming an application in VB.net 2005 to set several counter output channels (each with its own task) on the PXI-6624 card. I'd like to know if there is a way to change the frequency of the output without stopping the task, changing the frequency and restarting the task. I'm using the PXI-6624 card to simulate encoders and speed sensors.
    Thank you very much,
    JonS101

    Hi,
    Yes, you can change the frequency on the fly. Here is a knowledgebase that will give you an insight of how you should approach this matter. How Can I Change the Duty Cycle on My Continuous Pulse Train? To find this property node and how to use it refer to the DAQmx .NET reference: Where Can I Find NI-DAQmx Property Node Listings and Help?
    I hope it helps
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • DAQmx gate counter output

    Hello,
       I am trying to convert an existing legacy application developed in LabVIEW 6 (Traditional DAQ) into LabVIEW 2012 (DAQmx). The operation requires generating one counter output that is gated by another counter output. I have attached a fully functional example using Traditional DAQ. In the example you can see the Carrier Frequency output (4550 Hz or 5525 Hz) is generated by Counter 1. The counter Gate Frequency is generated by Counter 0. Counter 1 output is now gated by Counter 0 output in which you end up with bursts of the Carrier Frequency at a rate set by the Gate Frequency (from 3 to 21.5 Hz). This works fine but I cannot replicate this in DAQmx. The DAQ board I am using is an NI DAQCard-6062E (in a PCMCIA Slot).
       Any sugestions are appreciated.
    Thank You,
    Mike Westgate
    Attachments:
    Traditional DAQ Counter Gate Output.zip ‏32 KB

    Hi Mike,
    I wasn't able to properly look at your code since I have not install the Traditional DAQmx (Legacy) driver yet.
    But I do have the following links that can help you in transition from Traditional DAQ to DAQmx:
    Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy)
    Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW
    Ee Lim
    See that button on the left side of this post...
    If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~

  • Counter Output

    Hello
    I am using DAQ PCI 6221 card for analog inputs and outputs, I am using both the counter outputs for controlling temperature, by putting heaters On and Off through the digital pulse train I am getting from counter outputs.
    But I am having a problem with the counters that even if I change the Low time and High Time the pulse I get just dont changes accordingly,
    changes timing effects from next time when I run the VI, I am attaching the VIs(CTR1.vi and CTR0.vi are similar just change the channel name) involved in this, first I am acquiring the temperature and then comparing it with low and high limits and taking an action whether to On or Off heaters.
    High Time and Low time are required because as soon as I reach near to set temperature I increase the Low time and vice versa.
    Could anybody please tell me where I am wrong??
    Attachments:
    Show Alarm SV.vi ‏14 KB
    CTR1.vi ‏37 KB
    Dig Pulses2.vi ‏117 KB

    Are you trying to change these values once the task has started running?  Consult this KB for information on how to do to this:
    "Why Can't I Change the Duty Cycle on My Continuous Pulse Train?" 
    To summarize, you'll need to use DAQmx channel property nodes to set the pulse width and frequency.
    Elijah Kerry
    Senior Product Manager, LabVIEW
    Follow my Software Engineering for LabVIEW Blog

  • Counter output becomes unsnchronized when gated with an other counter

    Dear all
    i'm using a PCI-6602 to generate a range of different pulse trains / retriggered pulses. Ctr0 is running at the experiments base frequency (T0) and is configured like this:
    Error = DAQmxCreateCOPulseChanTicks(T0TaskHandle, "Dev1/ctr0", "", "20MHzTimebase", DAQmx_Val_Low, 0, T0Low, T0High);
    Error = DAQmxCfgImplicitTiming(T0TaskHandle, DAQmx_Val_ContSamps, 0);
    A second counter (Ctr2) produces pulses synchronized with T0 but with n times longer period:
    Error = DAQmxCreateCOPulseChanTicks(BlockTaskHandle, "Dev1/ctr2", "", "20MHzTimebase", DAQmx_Val_High, 0, BlockLow, BlockHigh);
    Error = DAQmxCfgImplicitTiming(BlockTaskHandle, DAQmx_Val_ContSamps, 0);
    Error = DAQmxCfgDigEdgeStartTrig(BlockTaskHandle, "/Dev1/Ctr0InternalOutput", DAQmx_Val_Rising);
    A third counter (Ctr3) produces retriggered pulses from Ctr2 that will serve as a gate for the 4th counter output:
    Error = DAQmxCreateCOPulseChanTicks(BlockEnableTaskHandle, "Dev1/ctr3", "", "20MHzTimebase", DAQmx_Val_Low, 0, BlockEnableLow, BlockEnableHigh);
    Error = DAQmxCfgDigEdgeStartTrig(BlockEnableTaskHandle, "/Dev1/Ctr2InternalOutput", DAQmx_Val_Rising);
    Error = DAQmxCfgImplicitTiming(BlockEnableTaskHandle, DAQmx_Val_FiniteSamps, 1);
    Error = DAQmxSetStartTrigRetriggerable(BlockEnableTaskHandle, true);
    Ctr4 should now output pulses at the frequency of Ctr0 but only when Ctr3Out is high. I tried along the lines of:
    Error = DAQmxCreateCOPulseChanTicks(TriggerTaskHandle, "Dev1/ctr4", "", "20MHzTimebase", DAQmx_Val_Low, 0, TriggerLow, TriggerHigh);
    Error = DAQmxCfgImplicitTiming(TriggerTaskHandle, DAQmx_Val_ContSamps, 0);
    Error = DAQmxSetPauseTrigType(TriggerTaskHandle, DAQmx_Val_DigLvl);
    Error = DAQmxSetDigLvlPauseTrigWhen(TriggerTaskHandle, DAQmx_Val_Low);
    Error = DAQmxSetDigLvlPauseTrigSrc(TriggerTaskHandle, "/Dev1/Ctr3InternalOutput");
    This works in terms of gating, but the gated pulses are no longer synchronized with the Ctr0 (they "move" through the gate when looking at it on an oscilloscope).
    DAQmxCfgDigEdgeStartTrig does not work for Ctr4 as it is not possible to use start and pause in the same task (at least that's what the error message said).
    I tried to synchronize using:
    Error = DAQmxSetArmStartTrigType(TriggerTaskHandle, DAQmx_Val_DigEdge);
    Error = DAQmxSetDigEdgeArmStartTrigSrc(TriggerTaskHandle, "/Dev1/Ctr0InternalOutput");
    Error = DAQmxSetDigEdgeArmStartTrigEdge(TriggerTaskHandle, DAQmx_Val_Rising);
    which works if i uncomment the three PauseTrig lines (no more drifting pulses, but no gating either). Using it all together produces no errors but the gated pulses still walk through the gating window.
    Any help is deeply appreciated
    Best regards
    Christian

    Hello Wolfgang
    thank you for your reply. I finally managed to get the 6602 to do what i want it to. The key was to use
    Error = DAQmxSetDigEdgeArmStartTrigSrc(TriggerTaskHandle, "/Dev1/Ctr2InternalOutput");
    instead of
    Error = DAQmxSetDigEdgeArmStartTrigSrc(TriggerTaskHandle, "/Dev1/Ctr0InternalOutput");
    and to make sure that Ctr4s task was started after the tasks of Ctr0 and Ctr2.
    Now Counter 4 is pulsing at the frequency of Ctr0 (even with selectable delay and pulse width) but only when Ctr3Out is high without the need for an external AND gate or other hardware.
    Best regards
    Christian

  • Two counter outputs with 90deg phaseshift

    Hi,
    I have NI PXI-1042 chassis and two NI PXI-6513 digital output cards in it.
    Task is to create two pulses with 90degrees phaseshift.
    Is there function in labview 7.1 which generates pulses descriped above. I`m meaning that if I tell function to count up, signal A is ahead signal B and if A is 90 degrees behind B it means counting down?
    Is there way to do this by connecting 3 (signal A, signal B and GND) counter wires all in one counter and controlling only one counter to "count output down" or "Count output up"? 
    - Santtu

    Hi Santtu,
    I think I understand what you are trying to do. 
    Essentially you have two counters, but you want to be able to control their
    phase relationship to one another.  This is definitely possible to do;
    however, there are not many examples dealing with it.
    I did find one Traditional DAQ Example (non- M-Series) that
    might help you out with this: Twin
    Pulse Train Generation with Variable Phase Shift Control
    Traditional DAQ uses an older API, so I would recommend you look at the
    attached example over this example.  Just wanted to give you more
    than one option.
    As far as it 'counting' up or down, that really would have
    to be done by a counter input task.  Since the input would be the same as
    that for a quadrature encoder, then you would use the methods described in my
    previous post.  As the output it will simply look like two different
    counters.
    For the best solution though, I went ahead and created an
    example for you.  It shows how to generate 2 different counter pulses that
    are out of phase with one another by a specified amount of time. 
    Hope this helps,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments
    Attachments:
    Gen Dig Pulse Train-Continuous-Dig Start-Phase Shift.vi ‏82 KB

  • Time measurement between counter output my device and analog input

    Hello!
    I'm trying to measure the time to generate a digital pulse train on the counter output, that goes to a frequency converter that controls a motor.  So I think it'd be the best way to wire the output of the frequency converter with an analogue input and make a timestamp before I generate the pulse and a timestamp when I recognize the singal, but I think that wouldn't be a serious measurement ?
    What's the best way to measure the time?
    kind regards peter

    hi there
    well, there a several ways to do this. the problem with the software - timestamps is the minimal resolution of 1ms. i'd suggest:
    - wire a copy of the digital pulse train to an analog input channel
    - wire a copy of the frequency converter to another analog input channel
    - create an analog input task with the two channels (the sampling rate defines the timing resolution,make sure to acquire enough samples to see the response signal) 
    - start this task
    - send the digital pulse train
    to optimize your acquisition you can use another copy of the digital pulse train as a start trigger for your analog acquisition.
    -> then you'll see the digital pulse train on one of the analog channels and the frequency output on the other one. both channels have the same time axis with a resolution defined by your sampling rate (~us depending on your hardware). then you can analyze the data.
    search the example finder for examples of how to create tasks and triggers.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

Maybe you are looking for