reset of incremental encoder

Hello, this is a simulation using Labview 2011 years USB-6009.
the table contains X (angle of encoder incremental counting rising edges) and Y (distance of linear encoder simulated with random numbers).
The wheel is gradual and must be zero so every 360 points (X), the XY graph must be refreshed to show the last values 0-360.

Nickname:
If count > 360 then set I = 0 and turn, write another 0-360 array and record all comparison tables

Question:
Is a function box to use or two nested for loops with 2 counters, one up to 360 and the other until the overall value?

In normal programming, I would divide the total number of 360, if the remainder is zero, then I would reset the meter I have zero, but I don't know how to "translate" in Labview.
Thanks for the suggestions

George

Some points to note:

feanorou wrote:

Nickname:
If count > 360 then set I = 0 and turn, write another 0-360 array and record all comparison tables

Since 360 = 0 the code must be: If count > = 360... 0-359, 9-small but mean difference

The function you're looking for is the

Quotient and remainder function

Have the Palette: Digital features

Request: Basic package

Calculates the whole quotient and the rest of the entries.

Another useful thing is the shift register (see the tutorial of LabVIEW) you can use in your loop to keep a tachometer. Every time that Exchange (increase) you can save the update etc.

Tags: NI Software

Similar Questions

  • I want to simulate linear incremental encoder to Labview FPGA

    Hi all

    I use the card to FPGA OR 7851-R to simulate incremental linear encoder. I want to generate the impetus A and B of the map to simulate the features of linear incremental encoder according to the distance.

    I don't know how to do so please help me for the same thing.

    Have you tried to write any code yet? Why not start by generating just the channel has? It is a question of turning a digital channel on and off at regular intervals - a PWM with duty cycle of 50%. I think you can find examples of generation PWM is included with LabVIEW or on this forum. Then, to generate channel B, you must enter the code, but with the starting point offset by 1/4 of the period. Once it works, simply limit the number of periods of release based on the "journey".

    Look through the examples, write code and see how far you can get. When you get stuck, view the code that you have written on this subject and explain the problem.

  • How to connect incremental encoder to NI9411?

    Hello
     
    I need to connect an incremental encoder to a NOR-9411 digital input on a chassis cRIO module to use for high-speed triggering.  I'm having trouble to know how to connect the wires needed to the encoder until the 9411 correctly.

    The son of transport the following signals:
     
    A red
    B Green
    Z Brown
    + V blue
    OV-Orange

    I'm fairly inexperienced with the connection of the sensors to LabVIEW gear, then please let me know if I can provide more information on my installation.

    In addition, attached is the datasheet for the encoder.

    Thank you very much!

    Alex

    Hi Byrd,

    Thanks for the post and I hope that your well today.

    I'm afraid I'm not totally sure what is your problem.

    The NI 9411 manual can be found here: for additional reading.

    The manual explains how to connect unbalanced devices on the 9411.

    page 12:

    "An example of asymmetrical device is an asymmetrical encoder. Connect each of the encoder signals (phase A, phase B, and)
    the index) to one of the pins in a pair of pins of DI. Figure 5 shows the connections for an asymmetrical encoder. »

    In labVIEW, you can then create a DAQmx task to read all digital lines.

    Hope this helps to get started you,

  • How to find the velocity of an incremental encoder

    I use the RE22I encoder which can give up to 8192 pulses per revolution, I have A, B, Z reports that I use an fpga as a controller Please help me.

    How to find the speed of the encoder using these signals I'm going to have a clock in the fpga sysytem will help.

    Start by looking at the information on Wikipedia on the rotary encoders and a book on encoders OR white.  These articles will give you a basic understanding of the encoder and the signals it produces.

    With proper decoding, you can get the direction and momentum of each of the points on your encoder 8192.  If the tree can reverse (same vibration on one point unique all-in-mnearly stationary), full decoding must be used.  If data are only of interest while the tree turns in a direction and speed will not close to zero, a simple decoding can be used.  Decoding of a quadrature encoder is a good way to learn to use a state machine.  Signals A and B can exist in only four possible combinations, but the possible transitions to do interesting things.

    Define DECODING is a purely logical exercise and it is a simple coding in LabVIEW, such as a state machine.  There are examples, Desing Patterns, or project templates (depending on your version of LV) that come with LV to help you get started.

    By using the channels A and B you can update your calculation of velocity 8192 times per turn.  With the help of Z you get only an update by the revolution. You use depends on your application.  The pulse of Z is also useful to define a reference position for the measurement of phase angle.

    Lynn

  • cDAQ-9178 & NI 9401 - ASM: incremental Rotary encoder works is not beyond a certain frequency

    I use a chassis with a NI 9401 DIO module 9178 cDAQ.  I'm trying to convert the output of a rotary incremental encoder ASM (in radians) to rpm.

    Sensing head (PMIS4-20-50-240kHz-TTL24V-Z0-2M-S)

    Snap ring (PMIR7N-20-50-M-20)

    The encoder outputs 2500 pulses per rev (output 5V TTL).  The maximum speed which will see the encoder is 2800 rpm, which is equivalent to 2800 RPM * 2500ppr/60 = 116,667.67 Hz in terms of frequency.

    Since the NI 9401 of the operations specifications:

    Maximum of the input signal switching frequency by the number of input channels, by channel

    8 input channels... 9 MHz
    4 input channels... 16 MHz
    2 input channels... 30 MHz

    I use only 1 channel, so I'm assuming that the 9401 should be more than capable of handling the 116kHz which the ASM encoder is spit.

    Everything works fine until about 2100 RPM (~ 87, 500 Hz) but then I begin to see a drop in rpm, followed by a flattened behavior, then a slight increase. But never more than 2100 RPM.  Our test unit is inspected for other reasons at the moment so I can't produce a plot of the behavior (I can reupload later).  I think this must be a matter of aliasing with the meter or something of the sort.  I have a digital filter set in place with a minimum of 4.0E pulse width - 6.  It is two times smaller than the width of minimum pulse at a frequency of 116kHz (0.0000085714).  I don't think this should have an impact on the calculation.

    Any suggestions? This value of RPM is essential to our application.

    Thanks in advance,

    -MB

    brown_ktr wrote:

    I have a digital filter set in place with a minimum of 4.0E pulse width - 6.  It is two times smaller than the width of minimum pulse at a frequency of 116kHz (0.0000085714).  I don't think this should have an impact on the calculation.

    A 116 kHz frequency, the period is ~8.57 us, but the pulse width half duty cycle of 50%.  Ascent/descent time factor, and it is quite possible that 4 US is too long for your encoder signal.

    The shape of this graph supports this theory, if we consider that there is variation in the exact pulse of each encoder pulse width.  The shortest pulse is ignored when the filter starts to kick in, and the speed of ROTATION increases pulses longer and longer are ignored then as well.

    Try to decrease the minimum pulse of digital filter (US 2 or even 1 US) width and see how it goes.

    Best regards

  • Pulse/counter of encoder data wrong servo motor

    First of all, I am very new to the use of labview.  I'm trying to complete a project, a former employee was working on that.

    For a quick background on what I'm working with, I use an NI DAQCard-6036E connected to a SC-2345.  SC-2345 is then connected to a load cell, Omron R88D servo driver and an omron servo motor.  The actuator is an incremental encoder with resolution of about 2048 pulses per revolution.  My labview program includes a counter that records the data of the encoder on the servo-motor.  I was able to get accurate data during the test through the program of measurement and automation of the engine manually.  Also when running through the specific DAQ assistant, I use for my counter, I'm getting correct readings by turning manually engine.  Once I run my full program, instead of get 2048 pulses per turn, I'm between 34000 and 36000 pulses per revolution.  The more logical assumption is that I get vibrations in the engine itself or some kind of noise disturbs my signal.  First, I tried to change the possible settings via the omron servo driver that could reduce the vibrations of the engine.  I try to change the stiffness settings, enable, and disable the automatic adjustment feature and a few other parameters specified by the user manual which could cause vibrations.  If turn the settings from rigidity as low as possible, I am able to get around 2000 impulses per turn, but data are very sporadic. In addition, my equipment must be very stiff, and with setting the lower rigidity for the servo driver, I can almost stop the engine with a minimum of force.  My equipment must be able to travel at a near constant speed with fluctuations of up to 200 N force.  Any suggestions on the direction in which I should go in search of a countermeasure?

    Thank you

    Experience with actuators is that they can produce large quantities of electrical noise.  I guess that noise can enter the signal of coders.  Look carefully at your wiring and make sure that you do not have a ground loop between your hardware OR and the actuator.

  • 6009 USB + encoder Lika I41 - how to connect?

    Hello world

    I'm new to this forum and I'm new to Labview so. I started to learn a few weeks ago and I have to solve a few problems. I am not able to come up with my own, and that is why I ask. I went through very simple LabView courses and now I'm in more serious trouble.

    I have first - the NI USB-6009 device and an incremental encoder Lika I41-h-500ZCU46L2. He has 8-cable and is described here: http://www.lika.pl/pliki_do_pobrania/QR%20I28_I40_I41.pdf . And now - I know the basics on the encoders so the description of cables is understandable to me. I don't know how to connect it to the USB-6009? I need to do a VI that will count the pulses and the output of the camera each X impulses. But I want to start by counting pulses.

    Any help will be MUCH appreciated.

    P.

    Hi you can connect power 5V to encode. Connect to the encoder output to PFI0 encoder for the event USB6009 GND GND line do VI count on PFI0 and USB6009.

  • How to wire the NI 9422 module to an encoder?

    Hello

    I want to connect the NI9422 to an encoder.

    The encoder data sheet is:

    http://MDM.KPNO.NOAO.edu/TD/PDFs/bei/H25_Incremental_Encoder.PDF

    Eager to help on this.

    IM using cRIO 9024 and my encoder is BEI H25D-SS-512-ABC-7830-LED-EM16-S

    Pinout for encoder is:

    A > A
    B > B

    C > -.
    D > + 5V

    E > B -.
    F > 0V

    G > matter on the ground.

    Thank you.
    R.H.

    Hello

    I think you should use 9411 (http://sine.ni.com/nips/cds/view/p/lang/en/nid/208812) module because that differential digital inputs. Looks like you have the wrong module to use. Your incremental encoder has A +, A - and B +, B-requiring differential inputs. 9422 is a digital input module 8 channels for 24V to 60V input logic level, that does not meet your needs, and it is also not entered differential.

    If you have the correct module, then perhaps you can visit this page to learn more?

    http://www.NI.com/white-paper/3921/en

    Rando

  • Square wave generation phase offset problems using PXI6602

    Hello

    I'm generating 2 signals using an incremental encoder AB using a PXI6602 to simunlating.

    Signals must be offset square wave, 34,133 Khz, by 90 degrees, which I'll put dividing (1/frequency) into 4 and put the result in the knot of late initial .vi DAQmx create channel (frequency impulse Co generation).

    Resulting signals phase difference however does not consistantly measures 90 degrees. 1 in 5 rounds of the vi has at least a matter of resulting in a test phase angle has failed.

    Can someone suggest a stable solution for this.

    Thank you

    David

    John_P1,

    After posting the previous comment, I went back to play some more with him, and he now runs and returns a positive result every time.

    The change that has had the desired effect was for the type of trigger that I had selected (Advance Digital Edge). Change this to start digital dashboard whose value fall of dash, the error disappeared.

    Feel free to always criticize the vi and suggest / modify to improve stability / efficiency.

    All feedback is voluntarily accepted

    Thank you

    David.

  • Edge of metering using nicaiu.dll

    I am trying to create a counter edge by directly calling functions in VB.NET nicaiu.dll. I am able to read the counter OK value but counties still return to the initial value set when I created the channel. For example, I create the task of counter by using DAQmxCreateCICountEdgesChan and the value of the initial counter 100000. I then read the meter using DAQmxReadCounterScalarU32. The County changes when I turn the encoder cable channel meter but returns to 100000 once the encoder stops.

    The wiring is correct, because it works correctly using the Test i/o counter OR-max Panel. The number increases as I turn the encoder and never resets when the encoder stops.

    Finally, I need to get this working using DAQmxCreateCILinEncoderChan but I see the same behavior when using this type of channel. For now, I use DAQmxCreateCICountEdgesChan because it is easier and mimics the function in the Test NOR-MAX Panel.

    I did this job using the .NET DAQmx API. However, there are errors when my application runs on a computer with a different version of NOR-DAQmx of what was used when the application is compiled. The appeal of the DLL directly seems to eliminate problems with different versions of DAQmx.

    No idea what I'm missing?

    Public Class Form1

    Private Declare Function DAQmxCreateTask Lib "nicaiu.dll" (ByVal TaskName As String, ByRef NITaskHandle As IntPtr) As Integer
    Private Declare Function DAQmxCreateCICountEdgesChan Lib "nicaiu.dll" (ByVal TaskHandle As Integer, ByVal PhysicalChannel As String, ByVal NameToAssignToChannel As String, ByVal edge As Integer, ByVal InitialCount As UInteger, ByVal CountDirection As Integer) As Integer
    Private Declare Function DAQmxReadCounterScalarU32 Lib "nicaiu.dll" (ByVal TaskHandle As Integer, ByVal Timeout As Double, ByRef ReadVal As UInteger, ByVal Reserved As IntPtr) As Integer

    Private Const DAQmx_Val_Rising = 10280
    Private Const DAQmx_Val_Falling = 10171

    Private Const DAQmx_Val_CountUp = 10128
    Private Const DAQmx_Val_CountDown = 10124
    Private Const DAQmx_Val_ExtControlled = 10326

    Private TaskHandle As IntPtr

    Private Const STARTCOUNT = 100000
    Private Const DEVICECHAN = ' DEV1/CTR0.

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    Dim ErrVal As Integer

    ErrVal = DAQmxCreateTask ("ENCODER", TaskHandle)
    Debug.WriteLineIf (ErrVal <> 0, "Error" & ErrVal.ToString)

    ErrVal = DAQmxCreateCICountEdgesChan (TaskHandle, DEVICECHAN, "ENCODER", DAQmx_Val_Rising, STARTCOUNT, DAQmx_Val_CountUp)
    Debug.WriteLineIf (ErrVal <> 0, "Error" & ErrVal.ToString)

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

    Dim ErrVal As Integer
    InVal As UInteger Dim

    ErrVal = DAQmxReadCounterScalarU32 (TaskHandle, 0, InVal, Nothing)
    Debug.WriteLineIf (ErrVal <> 0, "Error" & ErrVal.ToString)

    Label1.text = InVal.ToString

    End Sub

    End Class

    Try to explicitly run your task (DAQmxStartTask) after you have created the channel meter.  If you do not explicitly start your task, the appeal of reading starts the job instead, which would reset the count value.

    As far as I know if only this should once (on the first read call), then maybe it something else.

    Out of curiosity, have you considered using the API of VB.NET DAQmx instead of the dll unmanaged c?

    Best regards

  • Beginner question

    I use an incremental encoder on the NI 9411 DI2b (A) DI4b (Z), DI5b (B) as a differential pin configuration.
    I need to create a virtual channel to access the physical inputs? If Yes, then should I consider using input digital or counter of entry?
    And what would my physical channel for the same thing?
    I want to use the encoder to get Crank Angle of the encoder for the degree of pressure Crank Angle V/S on my installation.


  • simulation of crankshaft

    Has anyone ever used a Hall sensor to measure the speed of the engine and crank angle? I'm trying to understand how to measure the lunatics of angle of a single cylinder engine using any data acquisition system. I just need to know what settings or VI is used to translate the output of a Hall effect sensor data into freaks of angle in degrees. I have a 35 teeth wheel, attached to the motor shaft and the installed sensor just in front of it, so I'm 35pulses / revolution. I guess my question is how to manipulate the impulses that I enter freaks of angle in degrees? Do I go about it as an incremental encoder or can I use your extraction, etc. Any suggestion will be appreciated. Thank you.

    Thank you Rob, but I already found this earlier; I guess I would have deleted the post. I have a speed of 36 teeth removed a tooth to serve as an index (by aligning it with the TDC marker on my wheel engine) so that every time my sensor generates a long pulse corresponding to the 3 valleys (Valley-missing-tooth-Valley), indicating my TDC in any revolution. That, as well as my engine speed data, makes it easy to calculate the interval of angle freaks (which varies according to the engine speed). In addition, the hall effect sensor is not output a digital signal. It's an exit proximity sensor an analogue signal which corresponds to the teeth and valleys on speed, so the signal takes the form of a digital square wave essentially, but is not actually digital. According to your power supply, you get exactly 0 and 5, you get 0.1ish and 4.7ish values that simulate a waveform still, so a module of analog input on the compactrio (which is what I use) would work very well. However, thanks for your response.

  • How can I synchronize two signals in Labview?

    The first signal is a pulse index which gives the position of a reference point of the wheel (= 1 for 0 ° and signal = 0 for 1-360 °), and the second signal gives the total force meeting the wheel. The two signals have different sampling rates high. The first signal is always 360/rotation, but the second signal varies from cycle to cycle based on how fast the force is changing. The signals are in the form of two columns of numbers in an excel spreadsheet.

    I would like to do such as Labview at the exit of the angular position of the reference at the time of the cycle where the wheel knows the maximum strength in degrees. Can anyone suggest a vi or a method that I might be able to use for this task? I am new to Labview, so any help is appreciated.

    Hi Westerman,

    I have a little trouble to understand the basics of what you're trying to do. A little more details would be very helpful pointing you in the right direction. If you want to align the timestamps/reference of the two signals time?

    I've included a link to a document that describes generally how encoders (I guess that your pulse index indicates that you are using an incremental encoder) can be used in LabVIEW.

    http://www.NI.com/white-paper/7109/en

    You should also try the search the forums for questions relating to the use of a rotary encoder in LabVIEW. I was able to find several with the included code example.

    Feel free to provide us with a few details and we'll help guide you.

    Andy C.

    Technical sales engineer

    National Instruments

  • NEITHER 9411 &amp; NI 9402 together does not (error-50103 ("the specified resource is reserved"))

    HI guys,.

    I work on a project where I need to acquire data from a rotary incremental encoder and at the same time generate impulses that will be sent to a camera high speed.

    I have a c9174 chassis or cDAQ and two data acquisition modules connected to the inside.

    NEITHER 9411 to acquire the data of the rotary encoder

    NEITHER 9402 to generate impulses and sent to the camera high speed

    The problem is that when I try to do both tasks at the same time LabView gives me the following error message:

    -50103 ("the specified resource is reserved")

    I made individual screws for both tasks in order to check if the sensor and the DAQ modules work and there is no problem. The generation of pulses program has been verified using a digital oscilloscope and the encoder is giving the desired results.

    However, they do not work when two tasks are performed simultaneously.

    I tried;

    (1) do the two tasks in the same VI

    (2) do both tasks with their screws separate - start them at the same time or start them with a certain time delay, LabView still gives this error.

    I will be highly obliged if there is one any solution to this problem.

    Concerning

    Najat

    Hello MNMQ,

    Normally this should work you can post your code?

    Have you used different counter for the 9411 ctr0 and ctr2 for the 9402?

  • CompactDAQ using to acquire correlated data force-position began with a trigger of digital material?

    Hello

    up to now, I use a PCI NI6221 card to acquire the data of time - correlation of two analog inputs and an encoder (line A and B), i.e. to get two supply voltages and position for each sample. The beginning of the acquisition is hardware-triggered by a digital line of PFI.

    In addition to assessing the encoder inverted /A lines and / b (to eliminate the errors of counting in harsh environments) I want to migrate this task to a CompactDAQ 9172 module with a 9205 (for analog), a 9411 (for incremental encoder signals) and a 9472 (for outputs digital additional static) inside.

    My question: is it possible to use the entry PFI0 of the 9205 as trigger of digital material to make an acquisition described above? Or how should I continue?

    Best regards

    cpschnuffel

    I would like to make a correction to my last post... we have actually supported for triggers the 9205 (analog and digital) to any location in the 9172.  Digital lines has always obey the same rules I mentioned earlier.

    So, you can trigger off the 9205 PFI line in any location, or outside either module in slot 5 or 6.

    I'll be sure to amend article KnowledBase that I've referenced once I have the chance to make it clearer and more thorough.

    -John

Maybe you are looking for

  • Location of the Mini PCI Slot on Satellite P10

    Hi - I have a portable series of P10, PSP10E-0RCJM-EN. It is initially provided without an internal WIFI card but a swith and LED indicator. I hope to fit a suitable Mini PCI card. I am likely to find that an antenna is already installed? That more c

  • Pavilion 15: HP plugged music app no longer works

    Hello My HP plugged music app no longer works on my Pavilion 15.  Whenever I open it, it loads then immediately minimizes itself.  When I maximize, it seems to load a few seconds then is reduced again.  I haven't downloaded anything or modified syste

  • continue to ask an administrator password when you try to open my account.

    What is an administrator password

  • Part numbers

    I know that this is perhaps not the best place to ask this question. Does anyone know how to get a good number of 'catalogue' of old lifestyle site Web of National? Intuitively: "products and Services > software" >?  I want a PN for developers Suite!

  • BlackBerry Smartphones SMS Help

    Hello I was wondering if there is a way to count the messages in text on the BlackBerry? And is it possible to count too the text for each contact? If not is it possible to make it through a blackberry applications? Thank you