Measure frequency of Z pulse of an accu coder shaft encoder to measure speed using an 6034 E card

Hi,
I would like to measure the speed of a engine which has an accu coder encoder hooked onto it. It provides 3 pulses A, B, and Z. I am using a 6034 E PXI card. I wanted to know if there are any examples/ideas that could help me with this (I am new to the digital programming in Labview). I have moved to NI Daqmx 9.8 recently from the older version which supported legacy codes and hence in process of updating the code. I also want to know if an external clock source is required to do this. this. 
Solved!
Go to Solution.

Hello,
There are several examples in the NI Example finder (you can get here by going to Help >> Find Examples in a LabVIEW window). You can browse to the encoder examples by going to Hardware Input and Output >> DAQmx >> Counter Input. You should be able to find a few examples that will be helpful. 
Also, this link is a good resources for getting started using DAQmx: http://www.ni.com/white-paper/5438/en
Thanks!
Stephanie S.
Application Engineer
National Instruments

Similar Messages

  • Problem in edge separation measurement by using NI PCI 6251 card

    I am trying to measure time delay between two TTL pulses (rising edge of the first signal and falling edge of 2nd signal) generated by two Photo detectors (APD) . These pulses are random pulses. Pulse width is 20ns and height is 2.5 volt at 50 ohm termination. I am using NI PCI 6251 card (M series card) for this job. I have attached my program and DAQ assist settings using for this job to this mail. Problem is   6251 card couldn't detect the pulses from APD. Exactly error shown is
                                                             "Error 200474: specified operation did not complete because the specified timeout expired".
    I have tried by increasing the waiting time but it didn't solve the problem.  I have tested my program with 20ns pulse width TTL pulses which are generated by a function generator, in this case my program worked well and given expected result.[both the signals are from same  function generator and they are synchronized so edge separation measurement gives width of the pulse ] The height (voltage) of the TTL pulse generated by the function generator is 4v at 50 ohm termination. Is this height difference creating the problem? What can be the reason ? Can anyone suggest a better way to do this job.
                                                                                     Thanks in advance
                                                                                                                                                                                                                          Regards
                                                                                                                                                                                                                           surya
    Research student
    Attachments:
    daqassist.jpg ‏71 KB
    edgeseparatio.jpg ‏26 KB

    Hey JmBone,
    It's possible that you are just suppose to send a 32-bit integer to control the 32 valves. The 'byte offset' is probably just there to allow grouping of 8 valves (8 bits as 1 byte). So instead of sending an 8-bit number with some offset, you just send a 32-bit number and only change the bits corresponding to the valves you want to change. It would be easiest to just have a 32-bit binary array in your code for changine the individual valves and then cast that to a U32 integer before sending it to the Set Attributes VI. Maybe I am misunderstanding the manual, but I don't think 'byte offset' is a parameter you are suppose to specify, and is just there to indicate how the valves can be bundled into a single 32-bit value.
    Regards,
    Ryan

  • 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 measure the frequency of a pulse being generated by a counter

    Hi,
    I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
    Attachments:
    autotrain2.vi ‏19 KB

    You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
    How can I generate a pulse train from shaft encoder? (5/13)
    pulse train from encoder (5/15)
    how to measure rpm (5/20)
    How to measure rpm using shaft encoder and labview (5/23)
    This thread (also 5/23)
    I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
    A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
    For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
    Best Regards,
    John Passiak

  • In NI-DAQmx, how to change the frequency of a pulse train?

    I was using "GPCTR_Change_Parameter()" to change the frequency of my pulse train in Traditional NI-DAQ and Labwindows/CVI; is there any function can do the same thing in NI-DAQmx without restarting the task?

    You can do this in one of two ways, depending on the version of NI-DAQ you are using. If you are using 7.2 or later, you can use the counter write functions (ex: DAQmxWriteCtrFreq()), which are available for each flavor of pulse generation tasks (Freq, Time, Ticks). If you are using NI-DAQ 7.0 or 7.1, you can modify the attributes directly (DAQmx_CO_Pulse_HighTime, DAQmx_CO_Pulse_LowTime, etc). Keep in mind that for each attribute pair, one of the attributes will cause the counter to load the new pair. The attribute that causes the load is LowTime, LowTicks, and Frequency.
    I hope this helps!
    gus....

  • Digital frequency measurement speed in labview

    I am using a USB 6210 device to measure low frequencies of 50 to 1000 Hz. I need to log the frequency every 50ms. I do this in a while loop in labview using a 1 counter low frequency measurement in labview and saving the data using express VI.Each iteration of the loop takes atleast 60 to 100 ms just to read the frequency inside the loop. How do i increase the speed of measurement in Labview ?
    Solved!
    Go to Solution.

    PraveenB,
    Here is a table of the Counter terminals and related PFI lines.  This can be found in the NI DAQmx Help. (http://digital.ni.com/public.nsf/allkb/CCDFC93878BD8781862570FC00559980?OpenDocument)
    Default NI-DAQmx Counter Terminals
    Counter/Timer Signal
    Default Pin Number
    Signal Name
    CTR 0 SRC
    1
    PFI 0
    CTR 0 GATE
    2
    PFI 1
    CTR 0 AUX
    1
    PFI 0
    CTR 0 OUT
    6
    PFI 4
    CTR 0 A
    1
    PFI 0
    CTR 0 Z
    3
    PFI 2
    CTR 0 B
    2
    PFI 1
    CTR 1 SRC
    4
    PFI 3
    CTR 1 GATE
    3
    PFI 2
    CTR 1 AUX
    4
    PFI 3
    CTR 1 OUT
    7
    PFI 5
    CTR 1 A
    4
    PFI 3
    CTR 1 Z
    2
    PFI 1
    CTR 1 B
    3
    PFI 2
    FREQ OUT
    8
    PFI 6
    When you choose counter 1 in the Create channel VI it automatically reserves the gate which is PFI2.  If you use Counter 0 then PFI 2 will work fine.  Likewise if you use Counter 1 you can use anything but PFI 2.
    Message Edited by Jason_D on 10-24-2008 11:43 AM
    Sincerely,
    Jason Daming
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • What sensor should be used to measure speed of motor

    Hi,
    I am using NI PCI-6624 to control the speed of dc motor. I have used "PWM-Counter Output.vi" example to generate PWM pulses to control the input power of motor. I am using "counter output" and "analog input" terminals of PCI-6624. Counter output terminal is used to generate PWM signal and "analog input" terminal will be used as an input from speed sensor.
    Can someone tell me what sensor I can use to measure the speed of motor. Please note that the output of the sensor will be the analog input to PCI6624, so it is essential that speed sensor's output is ANALOG.
    Please help me in this matter and tell me which sensor can be used and from where I can buy it ?
    Thanks

    Ayaz,
    the straight forward low-cost solution for velocity measurements is using a quadrature encoder. With your  DAQ device you could use the second counter of the board to measure the frequency of one phase, but that's jus one option amongst others.
    I haven't come across sensors that output a voltage that is proportional to velocity but expect such a device to be much more expensive and probably less accurate.
    Do you plan to do closed loop velocity control? Are you using Windows or a realtime system?
    Kind regards,
    Jochen Klier
    National Instruments

  • How to measure RPM using digital I/O

    Please tell me how to measure RPM using Digital Input or please give me a code for this.

    You probably aren't going to find anyone to just give you code. Especially because you don't specify the hardware you're using. Doing this on FPGA is different than using DAQmx to do it. With FPGA you count pulses over a specified time. Using boolean logic from the digital DI node is a common way but there are others. (if you are using FPGA I can draw up an example, but I believe there is one on NIs website if you search google for it),. Then, if you want, you can run the data through an IIR filter, especially if you have a low resolution or slow moving encoder. Either of these conditions can result in very large difference of RPM even if the actual speed is not varying much (if you need an example why I can provide more detail, but some simple math calculating RPM should explain this. Obviously lower resolution will giv eyou less accurate results).
    If you use DAQmx you can set up a frequency task and it will return the number of pulses in a specified time frame; then you can convert this to RPM based on your encoder resolution and take the same steps of running it through a filter to smooth it out if need be.
    CLA, LabVIEW Versions 2010-2013

  • Measuring speed with incrementa​l single counter

    Hi,
    I need to measure the rotational speed and acceleration of a wheel that has 3 hall sensors on it. I will use only 1 of them en it gives 24 pulses 0-5V for a 360° rotation. How can I measure the speed with only a pulse train. I dont have the Quadric encoder...
    Now I'd like to measure the rotational speed using a counter of some sort, but the software I tried writing for it isnt working.
    Thank you for your help

    Hey Nitch,
    Concerning the measurements errors:
    As you get error when speeding up, it looks like the pulses coming from the hall sensors are to short to get measured by the counter.
    Following the USB-6008 specifications, the pulse needs to have a minimum lenght of 100ns (both in high and low state).
    As a counter is using edges to count the pulses (for USB-6008 only the falling edge) the edges need to comply with the TTL specifications which means that the rise and fall time of the pulse needs to be within the 50ns range. 
    So please have a look at the pulse lenght at higher speeds (are they at least 100ns?) and make sure the pulse comply with the TTL specifications.
     If not you will have to add some additional electronics to reshape the pulses.
    Looking at your program.
    It's not nescesarry to have two loops.  It's very well possible to have two DAQ tasks within the same look.
    Have a look at the Examples which come with LabVIEW --> Exampled Finder --> Hardware Input/Output --> DAQmx --> Synchronization --> Multi-Function.
    There are some examples which so the combination of analog and digital input.
    Anyhow you will have to remove the right while loop as the DAQ Express VI which apparently gives you the "spanning, stroom, gashendel" values will only start once you have done the counter measurements.  I assume that you would like to have the "spanning", "stroom", "gashendel" and"speed" synchronized measured.
    Then you have the choice to log to file during acquisition or after the acquisition.
    If you would like to log on the fly don't use the express VI's, but use the lower lever "File I/O" functions. These are faster (less processor time usage).
    As you VI is written now, the left while loop will only output the lastest counter value measured to the next loop when you click the stop button for example.
    You have to "Enable Indexing" of the m/s output tunnel.  Right click on the tunnel and you will be able to select "Enable Indexing".
    This way the application will automatically create an array and each loop iteration the measured value will be added.  One the measurements have been done you can do analysis and save the data using the full array instead of point by point.
    Again, also bring your "spanning, stroom and gashendel" inputs to the left loop.
    In your right loop you also have a loop counter.
    You can simply use the loop iteraction counter (the square box in the left bottom corner with the i).  This is also counting from 0 and incrementing by 1 each loop iteration.
    Again, you can do this in the left loop and forget the second loop completely.
    Hopes this will bring you a step further.
    Don't hesitate to post the VI itself.  This is always easier to look at than an image.
    This way we can also make some modications and post it back.
    Best regards,
    Joeri
    National Instruments
    Applications Engineering
    http://www.ni.com/ask
    Make our forums great:
    If you like the answer, don't forget to "Kudos!".
    "Accept the Solution" if your question is answered!

  • I want to measure rpm using 100 ppr incremental encoder via digital input

    i want to measure rpm using 100 ppr incremental encoder  via digital input max speed (4000 rpm)
    am using 9178 c-DAQ chassis and 9426 digital input module
    pl provide me example code for this

    Hi asaccullo.
    The recommended settings for encoders are using the counters in the daq cards. Using digital I/O’s is not recommended, the encoders send digital signals but one of the main differences between using digital IO vs counters is that counters are designed to handle these type of events.
    Here I found several examples in ni.com/code that you might check:
    Imitation Quadrature Encoder with DAQmx Counter Tasks
    Use Counter Frequency to obtain an Encoder Rotational Speed
    An Elvis is a daq device, so this should work for you.
    I also found an example for myDAQ, it uses the DIO but with a counter task in the set up.
    Regards,
    steve.bm
    AE | NI

  • How to measure ripple using DVM

    Hi,
    What's the best way to measure ripple using DVM (PXI-4072)? My customer's limits are Vp-p so I think digitizing it would be the best way, but I also think that measuring true RMS would also be a good way to measure it. With digitizing the signal there's some post-processing required. Would calculating just V peak to peak in acquired signal be sufficient?
    Thanks for any comments,
    CT.

    Hi CT,
    To measure ripple, you should be able to use the digitzer mode of the 4072 to measure signals up to 1.8 MS/s.  As long as your ripple voltage is not a higher frequency than that you will be able measure it.  The Developer Zone article linked here gives some more information about DC power  supplies and some considerations for measureing ripple.
    Regards,
    Jim Schwartz

  • Measuring bioimpedance using FFT

    i Hi to everyone, 
    I am student, and i have to do project "Measuring bioimpedance using FFT" for my college to pass the exam. I got several points (instructions) how to do it but they are poorly explained and I am not enough good programer. Up to now i made some points but I don't know if they are good ..... I will write these instructions, and i please some good programers to help me ...
    1. First task is to configure A/D and D/A conversion of two analog (voltage) channels, with some parameters like: frrequency of generated output samples (100 kHz), frequency of signal( 1kHz), frequency of sampling of input signals...
    2. Second task is connecting analog output directly on the analog inputs and compare input and output signals. 
    3. Calculate the FFT and show the results.
    4. Analysis of the phase shift of the two input signals.
    5. Compensation of the phase shift
    6. I stopped on this point because I don't have the idea how to realize that. I have to calculate the impedance based on informations of amplitude and phase, and the information of referent resistor. I have to calculate the impedance (the real and the imaginary part), reaktance and the C or L. Also i have to calculate the amplitde and phase of these. 
    I attached my project so i please help
    After that i have to measure the bioimpedance, thus i have to replace the components and measure the impedance from several points of my skin... but these are next problems....
    Best regards
    Attachments:
    v5NI_5 2.vi ‏124 KB

    Like I said. I have to calculate the impedance based on the data of impedance and phase. I don't know how to realize that, I have no idea. I guess that i have to know some equation how to do that calculation, because i have to calculate real and imaginary part (reactance and C or L). Aftert that I must connect input and output channel in the configuration for measuring impedance, and I have to connect different resistors, condensators, paralel combinations of resistors and condensators.
    7. The next poing is to measure on the different frequencies and getting the frequency characteristics of unknown  impedance. I have to logarithmically change frequency in the range 100 Hz  - 20 kHz, and show amplitude and phase of the impedance as a function of frequency.
    8. The last point is to measure bioimpedance. Instead of components, i have to connect one massive electrode (or sheet of aluminium foil) on the one of input channels and one pointy electrode on the second input channel. I have to put massive electrode in my arm and measure bioimpedance on the 10 points  (between thumb and forefinger), on the palm, forearm, upper ar, on the nose and on the top of the ear )...
    Pleaaase help me I have only seven days for realisation..
    Best regards

  • Problems on measuring temperature using thermocouples connected to SCB-68 terminal block

    I have problems on measuring temperature using thermocouples connected to SCB-68 terminal block.The thermocouples were connected to the differential channel 1 and a return path for the instrumentation amplifier bias currents and a 4 Hz low pass filter were both developed. But the readings were floating and jumped randomly between 0 and 200 Deg Cel abnormally.The CJC on the terminal block was disabled and a new one was developed by myself. However, the readings for the CJC were accurate and quite stable. So what is the reason for the floating of thermocouple readings? Did I miss anything that I need to do? Thanks.

    Are your TCs floating or grounded? Basically, if your TCs are mounted to a metal test article and the object is grounded to earth, then, the TCs are grounded -- and very likely contaminated with ground loops. You will need to reference the TC inputs accordingly. These ground loops will cause the TC data readings to float - recall that TC readings are in the millivolt level. It does not take much of a ground loop to ruin a TC measurement.
    Also, try this... first, set the filter to 10KHz and sample for a few seconds at 20 KHz (take 32768 data points). Now subtract the mean value from the trace and perform an FFT on the data. Look for the dominant frequency. Is it 60 Hz or some multiple? If yes, the likely cause is a ground reference problem.

  • Unit of measure translation using CUNI

    Hi,
    I am trying to maintain unit of measure translations using CUNI transaction.
    When I save the translation detail system doesn't ask for transport request number.
    What could be the reason? Any idea?
    Thanks,
    Dipak

    Hi Dipak,
    the following SAP Notes might be helpful:
    [1047291|https://service.sap.com/sap/support/notes/1047291] "RBZMETRANS does not transport ISO codes"
    [639459|https://service.sap.com/sap/support/notes/639459] "Error message BM302, BM303, BM304"
    Best regards,
      Andreas

  • Update file properties on existing measurement files using NI Diadem

    Hi,
    I have several TDM measurement files, which has properties such as sample type, test conditions, etc.  I manage all the measurment files using NI Diadem.
    I want to change the properties in each file. How can I modify the properties of the measurement file easily? I realized that I put wrong numbers into the property blank when I did the measurement.
    One more question, I want to add additional properties and values to existing TDM measurement files. How can I do that?
    Thank you,
    Hyunseok

    Hello Hyunseok,
    If you are familiar with the VBScript interface, use the "DataFileHeader" object, which you get returned from the "DataFileHeaderAccess()" function.
    There are some examples in the help system on how to use this ...
    Basically, you would write a short script that opens the TDM header, replaced/adds the property you want to edit, and does that on any number of files.
    Let us know if you have further questions,
         Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

Maybe you are looking for

  • Family Sharing and Itunes ( on WIndows )

    I have Itunes on my windows computer. My wife has an Ipad, Ipad Air,  and Iphone 5 with her own account, we got my son a Ipod Touch, I was able to do the Family Sharing, but had to set it up on my Wifes account, since I do not have my Itunes linked t

  • Can you Share Scenes between projects?

    Can you Share Scenes between projects? I would like to take already created scenes and share them between files and projects so multiple people can use them as a resource. Can it be done?

  • ERP application and multiple tablespaces

    Hi All, I am trying to build a ERP style application in my company...modules are Accounting, Purchase, Sales, Export, Payroll & HR. So far I have finished Accounting..What I did is. 1. Created one table space called ERPShared and created tables in it

  • Add UDF Category through DI

    Hi all, How can  I add a Category of UDF in a system form ? (eg Business Partner) The functionality is in Tools-->Customization Tools --> Settings Thanks in Advance, Vangelis

  • How to make personal Hotspot at iPhone 4

    Ive installed 4.3 & can' find where and how to establish Personal Hotspot.... Does anyone could help???? Thanks ahead!