Armer un compteur (Mserie 6229)

Bonjour,
Je dois, pour mon application (réalisée sous LabWindows/CVI), mesurer la largeur d'une impulsion, dont le front de démarrage est généré par une sortie numérique. Or, le compteur ne commence à compter que lors d'une opération de lecture. Là est mon problème : Si je démarre la tâche de comptage, que j'active ma sortie numérique et que je viens lire la valeur du compteur, celui-ci n'a visiblement pas repéré les ordres et n'a pas démarré...
La carte 6229 n'autorise pas à priori la modification des propriétés StartTrigger ou ArmStartTrig pour les compteurs, donc pas moyen de synchroniser le comptage sur le matériel, tout en autorisant des actions logicielles, quitte à lire la valeur du compteur en différé...
Je peux résoudre ce problème par des modifications de l'électronique, mais cela risque d'être coûteux, en temps comme en argent.
Si vous avez une idée de solution, merci de me répondre.
Cordialement
Moole

Alexandre D wrote:
Bonjour,
pour répondre à votre question je vous invite à consulter le thread suivant:
http://forums.ni.com/ni/board/message?board.id=4170&message.id=1647&query.id=4021#M1647
Ceci m'ammène à vous demandez:
Pourquoi ne pas utiliser votre signal à mesurer comme l'entrée GATE de votre compteur ? La synchronisation ne posera alors plus de problème.
Vous pouvez trouver un exemple de mesure d'impusion sous CVI à l'endroit suivant: sous LabWindows CVI
Menu Help >> Find examples >> Hardware Input and Output >> DAQmx >> Counter Measurements >> Period or Pulse >> PulseWidth.prj
Cordialement
Alexandre D
National Instruments France
Bonjour,
merci de votre réponse,
Je pense que le problème vient de la carte 6229 (les exemples cités ne sont d'ailleurs pas applicables à cette carte-low cost). En effet, même si le signal de déclenchement apparait après l'appel à DAQmxStartTask, le compteur ne se déclenche pas... Celui-ci ne peux se déclencher que pendant l'appel à la fonction de lecture, qui agit alors comme boucle, et dont je ne peux pas sortir pour générer le pulse... les propriétés modifiables pour les entrées de compteur étant assez limitées sur cette carte, je ne vois vraiement pas de solution...
J'ai donc opté par une modification de l'électronique, qui retarde les signaux mesurés par rapport aux à la génération logicielle.
Merci.
M

Similar Messages

  • Digital ı/o problem in mseries 6229 daq card

    In our lab, we have a 6229 M series daq card. We want to send digital output ,
    ( three square waves and their direction values for driving 3 dc motors.
    We will change pulses or frequencies during application). we tried to send the signals from single lines
    (altogether we need 6 lines.)  but we failed. We could only send pulses from counter ports but
    unfortunately there are only  2 counter ports. Can anybody help us about this problem?
    If anybody could also send a labview 7.x program for this application we will be thankful.

    Hi,
    You can use the correlated dio functionality of your M series board to output digital waveforms. However, you will need to construct the waveform before actually outputting the data. Here is the link to another discussion forum with more information on this including links to examples: How do I output a digital waveform?
    Regards,
    Hal L.

  • Trigger in a same step of sequence ...

    Hello.
    I use a PCI-MIO-16E-1 acquisition card with LABView 7.0 on a Celeron 333 MHz with 256 Mo RAM, and I 've a big problem with a trig. I explain.
    I generate a square waveform with a determinated time of emission on DACOUT 1, and this signal (by external hardware) can increase the voltage on PFI0 in less than 1 µs.
    Then, if PFI0 is upper than 0.7 volt, it trigs DACOUT 0 which emit an other signal.
    That's the theory and there's no problem to do this simply, but I must to do it on one step of a "pilled up sequence". Indeed, the time between the 2 events of my step have to be smaller than about 10 microseconds. Actually, it's works at 75% of time (sometimes the trig falls) with a delay of 40 microseconds, and it's to
    o long ! Why the synchronization is so long ?!
    I can't separate the two events because I need to trig DACOUT 0 BEFORE DACOUT 1 finish its emission, and I can't change the structure.
    How can I do with DAQmx or assistant ??
    Thanks a lot.
    (I join too an example of what I try to expose)
    Attachments:
    Example.vi ‏371 KB

    Monsieur,
    Comme vous utilisez une seule et même carte, il ne peut pas y avoir de synchronisation entre vos 2 opérations. L'armement de la génération sur DACOUT0, ne peut s'effectuer que lorsque la génération sur DACOUT1 est terminé. Aisni, vous aurez toujours une latence temporelle entre les 2 générations.
    Si vous voulez vraiment que la génération DACOUT0 soit trigée avant la fin de de DACOUT1, vous n'avez d'autre choix que de travailler avec 2 cartes de générations indépendantes. Ainsi, les 2 cartes pourront être armées en même temps: la première carte génèrera le signal carré, et la seconde carte attendra la condition de trigger pour acquérir.
    Avec une seule carte, vous pouvez envisager de générer votre signal carré (uniquement TTL) avec un compteur de
    la carte (Il existe de nombreux exemple dans Lv permettant de mettre en oeuvre les compteurs dans ce mode). Ainsi, il suffit de configurer la génération de DACOUT0, puis d'armer le compteur qui va générer les pulses qui créeront le bon niveau sur votre matériel externe.
    Raphael TILLET
    NI FRANCE
    Cordialement,
    Raphael T

  • All AI channels have the same value - NI PCI-6221 and NI PCI-6229

    Hello,
    I use the example aiex1.cpp for a multichannel AI read with the mseries devices 6221 and 6229.
    This example works for one channel, but the other channels have the same value (+- 0.001 Volt difference).
    For example: I set 5Volt on the first channel and then the other channel have 5Volt too.
    What should I consider in the configuration?
    Please, can someone help me?
    Best regards,
    Heiko
    Solved!
    Go to Solution.

    Hi Heiko,
    Like Moritz, I'm curious what signals you have connected to your AI channels. What voltage do you expect to read on each channel?
    Tom gave me your initialization code and it looks like you've modified aiex1.cpp. Does the example work without any changes?
    I have some more questions that will help me determine where the problem could be coming from, but these two are the easiest. We'll keep getting more and more specific as we remove possible causes.
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • How can I generate variable frequency in different time with NI USB 6229?!

    Hello,
      I have NI USB 6229, and I want to have VI which;
      in this VI I have to firstly generate a initial frequency togive it to a circuit, after that according to the results that I am reading from circuit I have to make some delay in the same frequency  which I generated before and again give it to circuit to see the results again.actually in other word it is some kind of feedback process.
    I would be thankful if some one can help me to how to make this VI because still I do not have any idea to program it.
    Sorry if I could not explain well because I am as beginner .
    thanks

    Hi worldviol
    I think a great place to start would be for you to have a look at the examples included in LabVIEW (help >> Find Examples..)
    Have a look under 'Hardware Input and Output' > 'DAQmx' and then 'Analog Input' and 'Analog Output' you will also probably find 'Synchronization' useful.
    The next stage would be to pick the most appropriate design pattern, you should read the white-paper here on design patterns.
    I think the producer consumer design pattern would be useful here as you would be reading and writing to the device at different rates.
    Kind Regards
    Chris | Applications Engineer NIUK

  • How do I use a quadrature encoder as an external clock (PCI 6229)

    Hello, ( a similar post has been placed on DAQ forum apologies as I did not know best place)
    I have a PCI 6229 M Series data acquisition card. I want to use a quadrature encoder to be the external clock driving the acquisition of a number of signals. I have set up reading 24 signals each time a clock pulse is received using the DAQ assistant and set my external clock to pin pfi8 (I think) this is then connected to an encoder output. This works well enough until the encoder is run too fast when it appears I am either missing pulses or getting bounce.
    How can I set up to clock using a quadrature encoder? I have seen a number of questions on this forum regarding quadrature encoders and reverse counting but not on using them as an external clock.
    Basically I want to have the stability and "bounceless" nature of using two outputs from a quadrature encoder whilst still using an external clock. Is this just a case of configuring controls to certain pfi's? If so how is it done?
    Any help or pointers would be helpful. So far I have managed very nicely by simply using the DAQ assistant and the interface it has would suggest that if configured for a certain pfi pin I could actually still use it.
    Thanks in advance.
    Kevin

    Hi,
    Well I've had alook into this for you and I'm not quite sure I understand what you are looking for.
    Is it possible for you to phone back in to support?
    The reason you are seeing bounce at high speeds, or indeed loss of points, is due to the sampling rate that you have set up.
    What you will find is that the trigger will start an aquisition of a number of points at a certain rate.  If your sampling rate is too low then you will not finish that sample batch before the next set of samples is recorded.
    It is possible to use an external clock into a trigger or digital line, however this will limit the number of samples you can take to the speed of your encoder.
    If you increase your sampling rates, and then configure a start trigger from a single input from the encoder you will be able to record a number of samples after a rising/falling edge.  (Set the clock as an internal clock)
    Hope this helps
    AdamB
    Applications Engineering Team Leader | National Instruments | UK & Ireland

  • How to generate digital pulses to run stepper motor in a sinusoidal motion profile using NI DAQ 6229 card

    Hi,
             I need to make a stepper motor undergo rotary oscillation with a sinusoidal motion profile. As it nears the extreme points it should decelerate and finally slow down to zero velocity and then it should reverse direction and accelerate until it reaches the other extremity where it should slow down and stop and reverse direction and repeat this motion.
            The hardware is NI DAQ 6229 and the stepper motor can be controlled using digital Hi-Low (1,0) pulses. For each high pulse(1's) the motor turns 1 step. I am able to generate a analog sine wave and convert it to digital data using Analog-to-Digital.vi  But i am not able to convert the digital data to a stream of 1's and 0's in the correct sequence to get the sinusoidal profile with the amplitude and frequency i require.
            The direction of rotation can be changed by giving a pulse to another input of the stepper motor. So only half cycle of sine wave needs to be generated and it can be replayed after changing the direction to get the full sinusoidal profile.
    Any ways of making this approach work or any new approaches to this problem would be helpful. Thank You.
    Regards,
    Prabu.
    Solved!
    Go to Solution.

    Hi,
             I finally figured out a way to do it. The analog sine wave is converted to digital and sampled. Consecutive values are compared and if the least significant bit(LSB) changes then a pulse is sent to the stepper motor to turn one step.
    I have included the sub-VI's that accomplish it for the particular stepper motor and connector block i have. The front panel of both sub-VI's are quite messy but the block diagrams should be much clearer. The sub-VI's get their inputs from a third VI which i have not included. So take a look at the VI connector panel to figure it out. Hope this helps. Kinda messy but worked out fine in the end for my application. 
    Thanks again for all the help. I appreciate it very much.
    Regards,
    Prabu Sellappan
    Graduate Student
    Aerospace and Mechanical Enggineering
    University of Southern California
    Attachments:
    start motor test waveform dtest.vi ‏73 KB
    sine profile generation subVI.vi ‏41 KB

  • How to check 6 digital signals change value at the same time with PCI-6229??

    I am using DAQ card PCI-6229.
    Channel 1 generate a digital signal.
    Channel 2,3,4,5,6,7 acquire digital signals.
    I want to check:
    1. Whether the rising edge of Channel 2,3,4,5,6,7 occures at the same time;
    2. The time delay from the rising edge of Channel 1 to the rising edge of Channel 2,3,4,5,6,7 is within a certain range.
    I know I can use counter to get the two edge seperation time delay. But I only have two counter, it is two time-consuming if I check one by one.
    I don't know how to check the rising edge of 6 different channels occure at the same time.
    Does anyone has any suggestions?
    Thanks

    Hello,
    You can use the DAQ card's digital input change detection circuitry to detect changes in the input, you can then use a counter to measure the relative time between samples. Please read Page 6-9 DI Change Detection Applications for more information. Let me know if this helps
    Christian A
    National Instruments
    Applications Engineer

  • How to route the ctr0 in DAQ MX for PXI 6229?

    Hello,
    The counter ctr0 of the PXI 6229 is internally wired to PFI12.
    How could i change the terminal on which this counter is wired? What is the function in LabWindows CVI 7.1 (NI_DAQ MX 7.3) should be used? Is there any example of this? (in all the CVI example the fact that we have to connect the counter to a terminal is just mentioned)
    Thanks for your help!
    guyom

    You can change the output terminal on M Series devices using the following function:
    int32 __CFUNC DAQmxSetCOPulseTerm(TaskHandle taskHandle, const char channel[], const char *data);
    On M Series devices you can route the output of a counter to any PFI line.
    I hope this helps!
    gus....

  • How can i output a voltage on PCI-6229 port with visual basic 6 ?

    Hello,
    PCI-6229 card is using DAQmx, that not support VB 6 officially.
    However, members of this forum found out a way to write/read on digital port with vb6 and DAQmx.
    This was working well for me indeed.
    Then, i wanted to output a voltage on AO. I followed the same procedure they used for DI/DO but in vain.
    Apparently, the function DAQmxCreateAOVoltageChan()* causes trouble.
    Using the .exe of the program, i get this error :
    "error -200077 : Requested value is not a supported value for this property."
    Thank you for any ideas that can sort this out.
    * Public Declare Function DAQmxCreateAOVoltageChan Lib "nicaiu.dll" (ByVal TaskHandle As Long, ByVal lines As String, ByVal nameToAssignToLines As String, ByVal min As Single, ByVal max As Single, ByVal units As DAQmxUnits, ByVal customScaleName As String) As Long
    call : DAQmxErrChk DAQmxCreateAOVoltageChan(TaskAnalog, txtChanAnalog.Text, "", Min, Max, DAQmx_Val_Volts, 0)

    Hello,
    What is your buffer size ? The buffer should be 0 or greater than 2. You can get this error if your buffer size is equal to 1.
    Regards,
    Isabelle
    National Instruments France
    Isabelle
    Ingénieur d'applications
    National Instruments France

  • How does the PCI-6229 DAQ-card communicate with CB-68LP connector block?

    Hello!
    I want to do a very simple task which is to just turn on/off a LED. I am using LabVIEW 7.1 and I have a DAQ-card PCI-6229. The DAQ-card is then wired to a connector block CB-68LP.
    Now my problem is to figure out how the connector block communicates with the DAQ-card?
    In the file I attached there is a picture of connector block and the device pinouts from the DAQ-card. But how do I know which of pinouts triggers some connector on the connectorblock?
    Which are digital outputs on the DAQ-card?
    Where can I read about this?
    Attachments:
    daqANDconnectorblock.bmp ‏2437 KB

    Hello asc01001:
    The digital pins of the PCI-6229 are labelled as Px.y, where x is the port name while y is the channel name.  For example, pin52 of the NI 6229 is P0.0; which is also port 0, channel 0 of the digital I/O of the DAQ card.
    While "D GND", which are located at pin53, pin18, pin50, etc. are the negative terminal of all digital I/O of the DAQ cards.
    Please advice if this helps.

  • Error 229665 when run ContGen-IntClk.c (example file) pci 6229

    Dear All:
    I try to use pci 6229 to send analog signal by using the given example program, ContGen-IntClk.c, in DAQMX 8.3.
    I use Visual c++ 6 to compile it.
    After I run the exe file, monitor show error
    "DAQmx Error: Internal software Error occureed in MIG software.
    Status code: -229665"
    (Note: the result was the same, when I did with visual basic)
    How should I solve this problem?
    My computer has  operating system: Microsoft XP 2002, CPU p4. 
    Thank you,
    Thongchai Phairoh.

    Hey Thongchai,
    Thanks for contacting National Instruments.  This error is usually associated with Measurement and Automation Explorer having a problem with it's database and is usually fixed with a reinstall of the driver or repair of the driver.
    You could try a few things to attempt to resolve this issue. 
    Attempt to repair the driver from the Control Panle and highlighting National Instruments and click, Change\Remove and highlight NI-DAQmx and click the repair button.
    Reinstall the DAQmx 8.3 driver.
    Upgrade to either 8.3.1, or to the newest version 8.5
    Let me know if you are able to resolve this with any of these options.
    Regards,
    Kenn North
    Senior Product Manager - Search, Product Data
    http://ni.com/search

  • I have the DAQ-6229 pinout sheet, but I need it to be defined.

    I am using the NI DAQ 6229 card.  I have a copy of the pinout off of the website, but I need to know what everything means.  Like,             PFI 11/P2.3, PFI 13 2.5, P0.5, AI 14, etc.  Any help you can give me will be appreciated greatly.

    PFI stands for Programmable Function Interface.  These are general purpose I/O pins which are used for triggering, counter inputs/outputs, and extra digital I/O pins on M Series.
    P0.5, for example is Port 0, line 5.  M Series has three ports with either 8 or 32 lines on port 0 and 8 lines on each of port 1 and 2.  The  PFI 11/P2.3 syntax indicates that PFI 11 shares the same pin as port 2, line 3.
    AI 0 refers to the positive input of Analog Input Channel 2.  The negative side is either AI 8 (Differential mode), AI GND, or AI SENSE.
    As discussed above, all of this is covered in the M Series Help file and the NI-DAQmx Base Help file. Since you are havin issues with the .chm version, you can also download the M Series Help in uncompiled HTML.   http://digital.ni.com/manuals.nsf/websearch/9CD6D8C5C12EB1538625708C00671779

  • Can a counter source be inverted on the 6229

    Can counter a source, for example "Dev1/Ctr0InternalOutput", be inverted on the 6229.  Currently, when I used the following line,
    DAQmxConnectTerms ("/Dev1/Ctr0InternalOutput", "/Dev1/PFI4", DAQmx_Val_InvertPolarity);
    I received an error stating that the hardware thus support inversion.  Thus the problem lies in the source or the destintation terminal?

    Hi cscp,
    The 6229 does not have general purpose inverters available for such
    signal paths, and therefore is not capable of signal inversion as part
    of the DAQmxConnectTerms function call.
    As part of the functionality of the on-board counters, however, the 6229 DOES have the ability to set the polarity of the counter output event.  Use the following function call:
    DAQmxSetExportedCtrOutEventPulsePolarity(TaskHandle taskHandle, int32 data);
    setting the data parameter to DAQmx_Val_ActiveLow (10096).
    Hopefully this helps out.  If not, let me know, and we can keep
    working to get this issue fixed.  Best of luck on the application.
    Have a great day!
    Travis W

  • PCI-6229 Digital I/O sample clock problem

    Hi,
    I am using PCI-6229. I need to use digital output channel to generate 20KHz 30%duty cycle pulses.
    The datasheet shows DO sample clock frequency can be 1M Hz. But in may application, only 100KHzTimebase can work to generate. But acctually I need at least 200K Hz.
    Attached is the Vi I made. Can anyone help me with this problem?
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Digital pulse_DO Channel.vi ‏26 KB

    Hello All,
    I tried to modify the VI posted in this thread in order to aquire a digital signal with the PCI-6229. Sinc the frequency of the signal is below 1k i tried to devide the signal of ctr0 respectively of freqout by 8 or 16 since 6.25k or 12.5k sampling frequency would be more than enough for my purpose. By the way, when I am using the 100k timebase for the timing of the task the programm is working. Since i try to monitor up to 20 channels, the amount of data genereated is too much. Therefore I tried to use the modified VI.
    Sometimes, the VI works, but almost always, the DAQmx - Read VI doesn´t terminate.
    Has anybody an idea what i did wrong?
    Thank you for your assistance.
    Sincerely,
    Mirko
    Attachments:
    Digital pulse_DI Channel-1_mod.vi ‏32 KB

Maybe you are looking for