Problem using counter to generate gate signal

Hello,
Is there a way to have a counter output a logical high for n input pulses and a low for the rest of the time? I am running into problems implementing this simple task due to idle-state behavior of CreatePulseChannelTicks and CreateCountEdgesChannel.
The output of the counter is used to gate the device that generates the pulses that are being count. As long as the gate is 'low', no pulses are generated. I run in the following problem:
 When I configure a counter with CreateCountEdgesChannel and use ExportSignals.ExportHardwareSignal to export the 'CounterOutputEvent', the initial state of the output is low. However, I need it to be high to start pulse generation.
 When I configure a counter as a one-shot pulse generator, I have to configure an idle state, delay-, high- and low-count. I tried two combinations:
idle state low, delay 0, in high the pulse count I want, and low-count very high. However, despite the 'delay=0', the initial output state is low. Thus, my device does not start generating pulses.
ide state high, delay set to the number of pulses I want, and low- and high-count very high. This does generate the desired gate signal. However, when I stop the counter task, the gate is set 'high' and my device again starts generating pulses. This is undesirable.
Is there a way to set the IdleState when using CreateCountEdgesChannel? Is there a way to have daqmx to ignore the initial delay and immediately start with the counter output in the inverted IdleState?
Thanks,
Maarten van Kampen

Short update:
I found the method to set the IdleState when using CreateCountEdgesChannel: .ExportSignals.CounterOutputEventIdleState = CounterOutputEventIdleState.High.
Howerver, now I run into the same problem with CreateCountEdgesChannel as with CreatePulseChannelTicks: when stopping the task, the output of the counter is always set high. And I want it to remain low when stopping the counter.
Regards,
Maarten van Kampen

Similar Messages

  • Could I use ni6723 to generate square signal?

    I just want to use the AO port of NI6723 to generate square signal with frequency between 10kHz to 500khz. The duty cycle should be 50%. The maximum voltage will be 10V and I want to change the minmium voltage between 0V to 5V.Is that possible?Could you give me an example?Thanks a lot!
    Best regards!
    Ciyuan Qiu

    For generating periodic waveform, you can look for Regeneration mode. Topic like Glitching might be of interest to you.
    Try below example.
    DAQmx AO Regeneration - Dynamically Updating User Buffer Data
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Elvis: Is It possible to use the Function Generator and the Oscilloscope simultaneously?

    Hi,
     We are using the NI Elvis to output a function or a sine wave at a certain frequency and using the oscilloscope on the same board/elvis to read a modified signal. Is this possible? Can we use both the Function Generator and the oscilloscope at the same time? Please help. The oscilloscope would be reading signal from an accelerometer. Thank you in advance. We have no VI as we do not know which to use and if they are possible.

    Hi,
    There is no problem using the Function Generator and Oscilloscope
    at the same time with NI ELVIS. Using the NI ELVIS soft front panels (Start
    >> Programs >> National Instruments >> NI ELVIS 3.0 >>
    NI ELVIS – see picture attached –‘NI ELVIS soft front panels.JPG’), you can choose
    to open more than one instrument at a time. We do this by opening one
    instrument, allowing it to begin, and then opening another. We can also program
    in LabVIEW using more than one instrument at a time by placing down multiple
    Express VI’s taken from the NI ELVIS pallet on the block diagram (see picture
    attached – ‘ELVIS Express VI's (LabVIEW).JPG’). One note when doing this,
    please see KB 41ODPHX1 
    for an example of how to program in parallel. If you do not wire the ‘stop’
    terminal of the express VI’s, you will get the error described.
    David L.
    Systems Engineering
    National Instruments
    Attachments:
    ELVIS Express VI's (LabVIEW).JPG ‏74 KB
    NI ELVIS soft front panels.JPG ‏56 KB

  • How do I configure a counter to generate pulses using DAQmx?

    How do I configure a counter to generate pulses using DAQmx?
    Is says in the DAQmx C reference help
    "CtrnInternalOutput—The signal at this internal terminal is where the pulsed or toggled output of the counter appears. The output of a counter pulses or toggles when the counter reaches terminal count. When counting down, the counter reaches terminal count when the count reaches zero. When counting up, the counter reaches terminal count when the counter rolls over. To configure the counter to toggle or generate pulses, use the Export Signal function/VI with Counter Output Event as the signal name."
    I've tried this but can't get it to work, I may have the parameters wrong or something. The DAQmxExportSignal() function is very unintuitive to me. Here is my counter config code...
    int ret = 0;
    ret = DAQmxCreateTask("",&task_);
    errorMsg(ret);
    if (ret != 0)
    throw ret;
    // Configure the counter
    ret = DAQmxCreateCOPulseChanTicks( task_, "Dev1/ctr0", "", "/Dev1/PFI8", DAQmx_Val_Low, 0, divider, divider );
    errorMsg(ret);
    ret = DAQmxCfgImplicitTiming( task_, DAQmx_Val_ContSamps, 1000 );
    errorMsg(ret);
    // Change to pulse mode
    ret = DAQmxExportSignal( task_, DAQmx_Val_CounterOutputEvent, "/Dev1/Ctr0InternalOutput" );
    errorMsg(ret);
    // Start the counter
    ret = DAQmxStartTask(task_);
    errorMsg(ret);
    The above code works fine, in toggle mode, if I just comment out the DAQmxExportSignal() part.
    HELP!!!
    Stefan

    The problem is due to the DAQmxExportSignal call.  By default, when you create a counter output pulse train task, the driver will automatically set the output of the counter to toggle when the count for each high ticks and low ticks expire.  The driver also automatically routes the signal present at Ctr0InternalOutput terminal (the output of the counter internal to the device) to the Ctr0Out terminal (the I/O pin available externally).  Using the line
     ret = DAQmxExportSignal( task_, DAQmx_Val_CounterOutputEvent, "/Dev1/Ctr0InternalOutput" );
    will tell the driver to tristate the Ctr0Out terminal and not output the signal to the external I/O pin.  Using the DAQmxExportSignal function is generally only useful if you want to route the signal to some other terminal internal to the board without having the output show up on the external connector, route the signal to some other external pin other than the default pin, or if you want to have the output show up at multiple locations. 
    If you want to change the output behavior from toggle to pulse, you need to use the DAQmxSetExportedCtrOutEventOutputBehavior function.  However, this is generally only useful if all you care about are edges (not the duty cycle of the pulse train), and you want to generate higher frequency signals.  For example, with a 20 MHz timebase as the source of your counter, you can only generate a 5 MHz pulse train by default.  This is because the minimum value for the low and high ticks parameter is 2 (20 MHz / 4 = 5 MHz).  By changing the output behavior form toggle to pulse, you can generate a pulse train at 10 MHz since the output is now pulsing instead of toggling.  However, the width of each pulse is not programmable so you will no longer have a 50% duty cycle signal.  I don't remember exactly what the width of each pulse is, but I believe it's in the neighborhood of 50 - 100 nanoseconds in width.  I hope this information helps.

  • How to generate two signals using NI myDAQ

    Dear Sir:
    I designed a circuit to generate a sine wave successfully using Labview. What I want is using NI myDAQ to generate another 3V DC signal as a power supply. I can do this seperately but when I add them together there is an error:  NI Platform Services:  The specified resource is reserved. The operation could not be completed as specified.
    I would like to use A01 to generate a sine wave and A02 to generate a DC wave, could you please check my file and tell me how to solve this problem. I found a solution which generates two signals together but what I need is to control these two signals seperately and using two channels.
    Kind Regards
    Jeff 
    Attachments:
    signal gen and acquire.vi ‏126 KB

    Thanks very much for your kind reply.
    No. I tried for a long time, change the samples of each simulate signal to the same but the warning also came out. Could you please check my file and tell me how to solve this kind of problem?
    Kind Regards
    Jeff 

  • TTL signal count problem: mistaken counting

    Hello,
    I use a 0.2Hz TTL signal to synchronize two devices. I use a Usb 6210 card to count the TTL pulse. The counter is triggered when it detects rising edges. In my case, the counter was sometimes triggered at low level, which causes a false result (see the attached images, the TTL signal is sampled at 20Hz and the dots represent an increment of counter). How can I resolve this problem?
    In addition, the cable which connects the TTL output was welded by myself, could it be a problem of poor contact?
    Thanks a lot,
    KX
    Solved!
    Go to Solution.
    Attachments:
    pb_ttl1.jpg ‏80 KB
    pb_ttl2.jpg ‏223 KB

    What is the nature of the device producing the TTL trigger signal?  Is it possible, for example, that it could produce a 1-microsecond pulse (that might not be visible on your plot of the signal) that would trigger the counter?  Are you really producing a digital pulse (i.e. is your circuit something that is either "on" or "off", as opposed to "produces an analog voltage in the range 0 to 5 volts")?  Are there other devices around that could be producing pulses that are being "picked up" by your counter?  Is the cable connecting the TTL pulses to the counter shielded?  Is the shield grounded at only one end?
    These questions (and the previous one) suggest that the problem may be "electronics" rather than "LabVIEW" ...

  • I want to use the Function Generator VI to send command signals through the NI 7344 motion controller. This will be a closed loop servo valve system. I want to be able to change from say a square wave to a sine wave on the fly. Idea's?

    I am going to run tests that require an actuator to move using various types of arbitrary waveforms such as sine or square. The NI 7344 is hooked to the UMI that is going through a driver for a servo valve. The loop is analog and it is closed. I have played with some of the examples but can't get it to work. I have used the function generator VI to generate a signal but I think I am using the wrong input VI to the motion control board. When I use what I have it moves the servo and then stops. It doesn't continually generate the signal.
    I would love to use the controls on the function generator vi to control frequency and amplitude ect. Any help or pointer would be helpful. Thank you in advance.

    Hello,
    I'm not clear on exactly how you want to use the generated data but I'm assuming they will be used as your target points.
    There's a built-in example for motion called 'One-Axis Contour Move.vi'. This example demonstrates how to provide your target points as 1-D array. All you need to do is to replace the input array with the output of the function generator. In order to have it run continuously, use a while loop. You can further program your application so that it'll change the waveform on the fly by monitoring the user interface but this might be little little tricky as you will need to reset the move and load the new generated points while keeping track of your current position.
    I hope this helps. Let me know if you have further questions regarding this
    application.
    Best regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • Using excel to generate signal in labview

    Hi there
    I am having a trouble in generating a signal in labview using excel and then plotting it as waveform.
    In excel file, I have 2199 rows and 9 columns with time in second and I want to plot time against other columns except column 1. In rows, I have text in first one.
    Any help much appreciated.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Data File Modified.xlsx ‏554 KB

    smercurio_fc wrote:
    You haven't shown us any code, so we don't know which columns you're using. However, you should be aware that Excel and LabVIEW use different epochs: https://decibel.ni.com/content/docs/DOC-8733.
    Thanks smercurio the link appears to be broken so anyone who tries just remove the "." at the end.
    The best solution is the one you find it by yourself

  • Generating PWM signal using Signal Express

    Hi,
       Would anyone help in generating PWM signal usinf Signal Express 2.5.1.   I am using a cDAQmx and connected NI 9472 to the slot number 6 to output the PWM signal. Also I have connected a NI 9421 to the slot number 5 to acquire the PWM signal, so that I could verify the signal.
       So would you please let me know how could I generate a PWM signal using Signal Express without any LabVIEW Programming. Please help me out.

    HI Aamruth,
    I atached a project, where you can see how to do it. I hope this helps.
    Regards, Mona 
    Attachments:
    PWM.seproj ‏29 KB

  • Im using phone 3GS 32GB, my signal was very poor but whenever i insert my sim to other phone, there's no signal problem.. When i change position, the signal suddenly dropped. my software version now is 4.3.5.

    im using phone 3GS 32GB, my signal was very poor but whenever i insert my sim to other phone, there's no signal problem.. When i change position, the signal suddenly dropped. my software version now is 4.3.5.

    GoodReaderUSB originally worked by transferring files to a special location on a user’s iPhone, which iPhone’s GoodReader app was able to access. However, accessing this location was a violation of Apple’s iPhone SDK Agreement, because the app had to access files outside its own private storage space, which is forbidden by Apple.
    Because of this, your only choice to fix this. at this point, may be to restore your phone as a "new" device in itunes and NOT from backup. Follow this by syncing your content back to your phone. Unfortunately, ALL saved data on your phone will be lost.

  • Pci 6132 digital signal using counter

    Hello,
    I want to give digital short pulse (around 10 us) in frequency of 10 Hz.
    i tried to creat digital waveform and to use the wait(ms) sub vi in labview but it's very inaccurate..
    sombody told me to use counter but i don't know exactly how.. i saw some expamle of accuaring sigital signal using counter but o coudnt understand it completly.
    any help by ver appricieate.
    thanks,
    Etay

    Hello, etay23!
    Were you able to check out the example? Do you have any questions for us about it?
    Will Hilzinger | Switch Product Support Engineer | National Instruments

  • Problems using PDF Generator QPACs

    I have PDF Generator 7.2 running under JBoss on one server and Workflow 7.0.1 on another. I am trying to use the PDF Generator QPACs that came with the Workflow SDK 7.0.3 but when the ConvertPDF QPAC is invoked I get the following error...
    16:42:45,906 ERROR [AWS] stalling action-instance: 1407 with message: javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: com.adobe.native2pdf.api.PDFGAPI7Home (no security manager: RMI class loader disabled)]
    For kicks, I added pdfg-ejb.jar to JBoss's server/all/lib folder on the Workflow machine. That made the above error go away but produced a class not found error for com/adobe/idp/document which I tracked down to adobe-common.jar. When I added that I get an error regarding com/adobe/idp/context which I tracked down to um-client.jar. Adding that gives an error that com/adobe/idp/context violates loader constraints and that's where I'm stuck.
    Any help would be appreciated.

    Hello Deepak.
    LiveCycle PDF Generator is the right tool to use for automating .dwg to PDF conversions and supports 2D CAD drawings. Distiller only handles PostScript to PDF. If you're interested in rendering 3D CAD drawings in PDF, there's a new product, LiveCycle PDF Generator 3D, which can handle that.
    Christy

  • AT-MIO-16E-10 Gate signal,how can i configure it as in input or as an output ?

    Hi there ! I have AT-MIO-16E-10 board and i want to control a counter (the GPCTR0 counter of the bord) to count up depending on the gate signal.Now i have the following missunderstanding.I've read in the AT-MIO-16E-10 manual that the gate signal can be treated eather as an input or as an output.So i want to control my counter (to count up) until a signal that comes on my gate counter's entry changes his states from 1 to 0 (to reset the counter) and then when it changes his states back to 1 form 0 i.e a transition from 0 to 1 to start counting again from zero.Now here i have 2 questions : 1. How can i config the gate signal as an input signal (in the AT-MIO-16E-10 manual it sais that the signa
    l can be treated as an input or output and it's known if i configure the port as an output and if i came with an external signal to the gate i can damage the board if the signal it's set to zero ) 2. What it's the default state of the gate signal ?
    Any vi files would be very usefully,Thank you very much for reading this and i'll be waiting for your answers as quick as possible.

    Antonios,
    The shipping example VI Count Edges does what you describe.
    >Quoted from VI Description
    Count Edges (DAQ-STC).vi
    DESCRIPTION:
    This VI counts rising edges, using an STC based device (e.g.: E-series). The counter increments its event count everytime a pulse comes into its source input. A gate signal can be added such that if a low signal occurs on the gate, then the counter will pause (scroll the front panel left to access the gate settings). The current value of the counter is read continuously in the while loop, until the Stop button is clicked or an error occurs.
    I/O CONNECTIONS:
    Connect the gating signal, if any, to the gate input of the selected counter.
    If you selected the Source Selection to be "PFI line", connect your event count base signal to the PFI line indicated by "Source PFI line number used". (If you selected "Internal Timebase", no source connection is necessary.)
    NOTE: For actual I/O pin numbers, please refer to your hardware user manual.
    INSTRUCTIONS:
    1. Enter the device and counter you want use.
    2. Make your Source selections, as desired.
    3. Optional controls are located on the left side of the front panel. You will have to use your scroll bar to reach these.
    4. Connect your signals as described below in I/O CONNECTIONS.
    5. Run the VI.
    >End quote
    If you look inside the Diagram of the Count Edges VI you will see a subVI, Group Config CTR, that has a constant set to "simple event counting." This configures the gate in the correct manner. You have 17 or so options to choose from (right-click to see the other choices). Each choice configures the counters as needed. No special effort is needed on your part.
    If you really must know more details double-click on the Group Config CTR icon. On the Diagram of that VI is a Call Library function. Right-Click that and see more ugly details that you don't need to know. The functions of the counters are fully implemented by the options already available, so you don't need to know how the details, but it is intersting.
    Hints:
    Keep in mind that the counters require TTL level signals. 0V to 5V. Limit the current to the level the DAQ board can handle. You will false trip the counter if your low is higher than 0.8V. I have had problems with this when using noisy signals.
    Also make sure you debounce any switches you wire to the counters. It is instructive to hook up an unbounced switch to the counter inputs and see just how many false trips they can generate!
    Mike

  • Doing Buffered Event count by using Count Buffered Edges.vi, what is the max buffer size allowed?

    I'm currently using Count Buffered Edges.vi to do Buffered Event count with the following settings,
    Source : Internal timebase, 100Khz, 10usec for each count
    gate : use the function generator to send in a 50Hz signal(for testing purpose only). Period of 0.02sec
    the max internal buffer size that i can allocate is only about 100~300. Whenever i change both the internal buffer size and counts to read to a higher value, this vi don't seem to function well. I need to have a buffer size of at least 2000.
    1. is it possible to have a buffer size of 2000? what is the problem causing the wrong counter value?
    2. also note that the size of max internal buffer varies w
    ith the frequency of signal sent to the gate, why is this so? eg: buffer size get smaller as frequency decrease.
    3. i'll get funny response and counter value when both the internal buffer size and counts to read are not set to the same. Why is this so? is it a must to set both value the same?
    thks and best regards
    lyn

    Hi,
    I have tried the same example, and used a 100Hz signal on the gate. I increased the buffer size to 2000 and I did not get any errors. The buffer size does not get smaller when increasing the frequency of the gate signal; simply, the number of counts gets smaller when the gate frequency becomes larger. The buffer size must be able to contain the number of counts you want to read, otherwise, the VI might not function correctly.
    Regards,
    RamziH.

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

Maybe you are looking for

  • Material number is not populating in PO in tcode ME23N

    Hi, The material number is not populating in PO in transaction ME23N. The coloumns is displaying as blank and supressed(Gray). This problem occured during the upgradation from 4.6C to ECC6.0. We have checked the SPRO configuration for field selection

  • ITunes error with Windows 7

    I have reinstalled iTunes numerous times and checked my windows 7 for bad dll, I keep getting the iTunes.exe-Bad Image error followed by Error 7 (Windows error 193) can anyone actually help? It worked for a while then all of a sudden when I attached

  • Officejet Pro 8600 Plus wont print from Mac 10.5.8

    Hello, I just purchased the Officejet Pro 8600 Plus and I'm running it wired through my router.  I'm able to print with my PC, my IPad and my phone but I cant print with my mac running OS 10.5.8.  When I try to print it puts the document in the print

  • Document on XML date rules and date management

    Hi, Could you Please send a document on XML date rules and date management. I really in need of it. You may send it to [email protected]

  • "show in Library" missing in LR 3

    In LR 2 you was given the option of "show in finder" if you tried to import images already in the catalogue - that was realy handy if you have missed to give some files keyword, but know where they are on the hard drive. this option seems gone now in