Use angular Encoder position to trigger Digital out

Hi,
I am a beginner labview user, I have access to three modules, two NI9201 and one NI9401.
I have an angular encoder that is used to measure the angular position of a motors crankshaft, what I'm trying to do is use the encoder to trigger a digital out (spark event in the engine) at a certain angular position.  For example, I would like to trigger at top dead center (or 0 degrees on the encoder), then I want to be able to change this to +5 degrees on the encoder, etc. 
So far I am able to read in the angular encoder when the motor is running, I am also able to output digital out signals although I can't find a way to link the two together.  
If anyone has any idea how to do this, it would be greatly appreciated, I have attached my VI.
Thanks in advance,
Nick
Solved!
Go to Solution.
Attachments:
Encoder_Spark.vi ‏40 KB
Encoder_Spark.vi ‏40 KB

Hi Nick,
I hope the attached vi will get you on track.  It's just a general concept.
The while loop will run until you hit the stop button.
   I take it you will need one spark per revoultion.
This VI is really just an If/Then
   If the encoder value is equal to (in this example ) zero,
   Then trigger the digital output.
I know I have a broken wire, but I didn't know how to get the angular position from you DAQmx.
Let me know if this help. (Also let me know if I'm off target)
Good luck,
Bill
Attachments:
Trigger spark concept.vi ‏9 KB

Similar Messages

  • Sample Clock from Numerical Position Output of Digital Encoder

    Hey everyone,
    I'm trying to sample a voltage (pressure inside an engine) with my NI USB-6212 against a rotary encoder position (crankshaft angle). For some brief background, I'm using a producer/consumer structure and my rotary encoder has proprietary VIs from the manufacture to interface. It's from US Digital and it's an HD25A. It makes the most sense to use my rotary encoder as a sample clock so I wind up with a sampled point of pressure data for each crankshaft angle. This makes it far easier to average pressure traces together and work with the data.
    I've found quite a few threads on this (links at the end of my post) but they all rely on having a pulse output from the digital encoder which is then wired into a counter input on their board. I don't have a pulse output, my encoder is outputting a numeric value between 0 and my chosen resolution (currently 3600, so 0 to 3599).
    My question is how can I take this changing numerical output and make a sample clock pulse for each time the value changes? Does this need to be turned into a task to use as a sample clock? I'm essentially using the data acquistion program from the example program Cont Acq&Graph Voltage-Ext Clk.vi.
    Thanks in advance for any help you can lend me and my apologies if I missed a prior thread on this topic. My search-fu wasn't able to turn anything up.
    Some relevant links I found, though I couldn't quite make enough sense of them to get the fog to lift:
    http://forums.ni.com/t5/Counter-Timer/How-to-reset-a-counter-on-external-signal-in-LabView/td-p/1521...
    https://decibel.ni.com/content/docs/DOC-12106
    http://ni.lithium.com/t5/Multifunction-DAQ/Rotary-encoder-data-acquired-simultaneously-with-analog-i...

    I don't think there is anyway you are going to make this work like you think you can.  The US digital encoders I have worked with and their VI's were based on reading the current encoder count through a serial port connection.  To do what you want, you are going to need to read the encoder every time the count changes.  At 216 kHz, a serial connection is not going to be able to do that.  Even if it could, you would essentially still have some latency between when the count changed and when the VI would be able to request a reading and get a response that showed the count had changed.
    You need to use an encoder that has a digital pulse output that you could use as a sample clock on a data acquisition card.

  • No digital out signal from Optical Out

    I have a Pavilion p6250f PC with a ATI Radeon HD 4200 integrated graphics card.  I have it connected to my Onyo receiver through the DVI-D port to the HDMI port on my Onyo receiver.   I get a message saying I need to cable the sound separately, so I am using a optical cable from the PC to the receiver, but am unable to get any sound.
    I have used the Realtek menu to select Digital Out.  Any ideas?

    Hi,
    Where are you connecting your optical cable to on the PC as you have stated?
    Try SPDIF output from the PC using a coaxial cable to a digital input on the receiver. Or, use an analog cable from the back of the PC to the receiver.  Then go back into the Control Panel ---Sound---> Playback Tab and set the default sound out device.
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • Soundblasters with on-board digital out

    i want to upgrade my ancient sbli've and im using speakers that only accept creative digital out for surround sound.
    i looked at the cards currently in the shops within my budget ($00AU) then look at the specs on here and NONE seem to have on-board digital out? is this right? Audigy Value,Audigy 2 Value and Audigy 4 non Pro all do not have on board digital out?Message Edited by spanket on 04-0-20060:36 AM

    If you need digital I/O, or access, there is a add-on module in the
    "Acessories" Category of their Shopping Link that you can plug into the Digital In...which provides both SPDIF (Coaxial) and Optical Connectivity for your and up to the newest X-Fi. Unfortunately, all my excitement as I did order one of these ($4.99, actually cheap for a change) have been deflated. As to being able to finially link up all my digital ouputs to run through my Shuttle system to hear my DVD's Digital Output and Cable TV DTS or Dolby 5., EX, etc. have been dismal at best. For it will not connect in DTS or Dolby, only in a simulated CMMS 3D downmix seems possible. How can this company get away with touting...Dolby DTS, Dolby EX, etc all over their boxes and it does not even handle such capabilities...and if it does...PLEASE PASS IT ON CREATIVE... I have been dealing with your nonesene for years and decided to give it another chance. BUT...as usual, the SOS....different label..that's all.
    PLEASE, if you get this, it just offers a hole to plug it in....doesn't mean your gettting the whole DTS or Dolby EX experience....just a simulated CMSS 3D Garbage, (BTW..if you get nothing with this adapter, enable CMSS...then you will at least get a sound out of this)....with a rediculously FAINT middle channel, for what...OH ONLY THE VOICES of the soundtrack that's all....a joke..
    Please respond if you know better.....
    Thanks....

  • Custom scale with Create Channel CI Position Angular Encoder

    Hi!
    In my application I use angular encoders for position measurement. I programatically create channel (task) using DAQmx Create Virtual Channel, CI Angular Encoder instance. Prior to that I use DAQmx Create Scale to create custom scale for the measurement, to convert from degrees directly to meters. The problem is that when I use the task (Start Task for instance) I get the following error message:
    Error -200378 occurred at DAQmx Start Task.vi:4
    Possible reason(s):
    Measurements: Custom scale specified does not exist.
    Custom Scale: RowCounter
    Task Name: _unnamedTask<66>
    Maybe somebody can help me out with this one.
    I use the same principle to create custom scales for AI measurements, and everything works without any problems. I know the scale is created properly, as I tried saving the custom scale to max after I create it. I then used the scale without a problem when I wired it as a constant to the custom scale input of the DAQmx Create Virtual Channel vi. It only gives me problems when I create it dynamically, using Create Scale vi.
    Some technical info: I use USB-6210 Daq card for signal acquisition.
    I will appreaciate any help!
    Jernej

    Hey!
    The error message I get is as follows:
    Error -200378 occurred at DAQmx Start Task.vi:4
    Possible reason(s):
    Measurements: Custom scale specified does not exist.
    Custom Scale: RowCounter
    Task Name: _unnamedTask<66>
    I use USB-6210 Daq card for signal acquisition. The error occurs right after the DAQmx Start Task.vi on the counter task.
    As I said, the code runs sometimes without problems and then sometimes it returns an error. I noticed that if I run the CustomScaleProblem.vi on its own it runs ok. When I open the project with mine application, from where I extracted CustomScaleProblem.vi part, and then try to run the CustomScaleProblem.vi, it stops working. It looks like when I open the project it allocates some space which is in conflict with the scale part of the code. Then if I close the Labview environment and open CustomScaleProblem.vi and run it, it runs again without any problem. Well, for now I did a work around the problem by saving the scale in the program and then using it. This approach works fine.
    About the arm start trigger. I use it because I dont want the counter to start counting before the AI task starts. I noticed that if I use the AI as a start trigger, and I move the encoder before AI starts, the counter will not start with 0, but will start with a number indicating the encoder movement before the AI start. Is that the right approach if I want the encoder to start
    counting from 0 when AI starts?
    Thanks and kind regards
    Jernej

  • Using a rotary angular encoder to measure period of pendulum

    Hi,
    I'm new to Labview (I hope I've posted this in the correct section) and am trying to measure the period of a physical pendulum. I'm using an Omron rotary angular encoder (E6D-CWZ 2 C) and the SCB-68 NI card. Basically I'm trying to interface my pendulum to the PC in order to analyse the motion.
    I'd appreciate if anyone has any advice or can point me to a tutorial that might help.
    Thanks,
    Sarah

    Hi Sarah,
    Interesting application--I think your best best is to use the counters on the 6024E as follows:
    1.  Configure a Count Edges Task (the E Series cards don't directly support quadrature encoder tasks).
    2.  Use the A output as the edge to count, and the B output as the direction control line.
    3.  Set an initial value such that the bottom of the arc is your "0 reference" (e.g. if you are starting the pendulum 1000 encoder ticks above the bottom of the arc then your initial count should be -1000).
    4.  Every time the counter rolls over it will produce a pulse on its internal output.  This will be every time the pendulum reaches the bottom of the arc.
    5.  You can perform a period measurement using the 2nd counter on the 6024E.  The line that you want to measure will be the other counter's internal output.
    This isn't the most straightforward configuration so you should probably start out by combining shipping examples.  I would start with the following two examples (which can be searched for in the Example Finder by navigating in LabVIEW to Help >> Find Examples...)
    Count Digital Events.vi
    Meas Pulse Width-Buffered-Cont.vi
    I would start out by getting the Count Digital Events example to work so that the value is 0 every time the pendulum reaches the bottom of the arc, then you can try adding in the Meas Pulse Width example to perform the period measurement.
    Best Regards,
    John Passiak

  • Use absolute encoder to get positioning

    Hi all friends, 
    i am relatively new in labview, and sorry in advance if i ask something very silly. 
     i am writing this to seek help for absolute encoder data acquisition. 
    The DAQ set i am using is NI USB-6218 BNC which has 8 digital inputs. 
    The absolute am using is ACE 128, data sheet is http://www.bourns.com/pdfs/ace.pdf
    I am connecting the 8 output pins of the encoder to the 8 digital input pin P0.0-0.8 
    and then i am using  DAQ Assitant 8 times he input and then convert it to decimal numbers and save it to a text file. 
    attached is what i have. 
    it seems that it works well, but however when i look through the text file, i found that there are a lot of errors in the decimal numbers. 
    can anybody help me to figure out why it happens??
    Thank you very much 
    Attachments:
    EIM sem 5.vi ‏447 KB

    melvinfeng wrote:
    Hi all friends, 
    i am relatively new in labview, and sorry in advance if i ask something very silly. 
     i am writing this to seek help for absolute encoder data acquisition. 
    The DAQ set i am using is NI USB-6218 BNC which has 8 digital inputs. 
    The absolute am using is ACE 128, data sheet is http://www.bourns.com/pdfs/ace.pdf
    I am connecting the 8 output pins of the encoder to the 8 digital input pin P0.0-0.8 
    and then i am using  DAQ Assitant 8 times he input and then convert it to decimal numbers and save it to a text file. 
    attached is what i have. 
    it seems that it works well, but however when i look through the text file, i found that there are a lot of errors in the decimal numbers. 
    can anybody help me to figure out why it happens??
    Thank you very much 
    im confused when you say...."I am connecting the 8 output pins of the encoder to the 8 digital input pin P0.0-0.8", thats not truly a correct statement?
    8 inputs is a port( line0:7)....
    look for the example in the \examples\DAQmx\Digital Input\Digital - SW-Timed Input.vi (change the example data format to decimal output)
    and i dont know if you want to write the data continuous or only when changed to the file?
    Attachments:
    Digital - SW-Timed Input.png ‏18 KB

  • What is better to use: digital out or 5 channel speaker level out

    Hi
    Is it better to use digital out on sound card or 5 channel speaker level output?If you could explain it to me...(i'm new so that's why i am asking this)
    Thank you

    First you need to determine what options you have, if you have an amp/decoder
    use digital out because that then frees up the line-outs which you can use for other devices. Quality wise not much difference.

  • Does anyone know why there would be slight latency using a digital out (Toslink w/adaptor) to my amp, where I don't have latency with an analogue cable? Is it the amp that is causing the latency?

    Recenty used a Macbook Pro with analogue out to my amp and there was no latency at all. Bought a new iMac and got a Toslink cable with adaptor and connected to same amp. There is slight latency using the digital out! Can anyone explain why? I don't really want to go back to using the digital cable because I have the surround sound setup that works well with the optical cable.

    error: I don't really want to go back to using the ANALOGUE cable....

  • Servo motor control using CRIO+FPGA and 9477 digital out module

    Hello experts,
    I have a futaba BLS551 brushless motor digital servo (3 wires-+,-, signal). i also have a CRIO+real-time+fpga and 9477 digital out module. how can i generate servo signals using this module
    please help...
    Thanks,

    freemason,
    In order to control your servo motor with the FPGA and or DIO module you will have to write drivers to control your motor and drive.  While this is possible is an extremely complicated and time consuming process.  I would highly recommend you consider using the NI 9514 with soft motion as it will provide full servo functionality and is relatively easy to use.
    Regards,
    Sam K
    Applications Engineer
    National Instruments

  • Aggregate device using digital out and line out

    I am trying to create an aggregate device using the digital out and the line out built into the mac pro. However, I only get sound from the device marked as the clock. Is it possible to aggregate these two outputs? or are they not compatible?

    Hi CristianEC,
    i think the error number was -200022, because the PFI lines for the two PWM counter look all your digital ports.
    You can see this if you look on into the pinout for your device. You need an device with some additional digital ports.
    best regards
    Alexander Glasner
    AE NIE

  • I recently used the computer for I player over the TV, but when removing the external speakers the internal speaker appears to have stopped working and when going on to system preferences and sound I am only given the option of digital out put. Help

    I recently used the computer for I player over the TV, but when removing the external speakers the internal speaker appears to have stopped working and when going on to system preferences and sound I am only given the option of digital out put. Help

    Do you see a red light shining in the headphone port?

  • Conecting MY MD player useing the Digital out jack on A2 ZS H

    Ok i have me a MD Sharp DR7 which has an optical In. on the back of my A2 i have a digital out Jack. so i conect my MD and it says no signal. iam useing a 3.5mm jack optical cable from A2 ZS to MD which is what the instructions say on my MD.
    so why dont i have any digital signal from my A2 ZS, i have checked all the digital outputs in the software and control panel but still its not working.
    Is my sound card at fault?
    I would really like to record useing some of the sound functions my A2 ZS offers but why cant i conect it by digital output!!!!!!!!
    thanks in advance for any awnsers to the problem that bugs my life right now!

    MiniDisc units do not care if its digital input signal comes from optical SPDIF or coax SPDIF. It's all SPDIF. All you need is the correct cable.
    It is possible you are hitting an SCMS restriction, in which case it doesn't matter how the digital signal is fed into the MD unit. I don't know if Creative's drivers respect SCMS or not - I haven't had the card long enough to find out yet.
    But you definitely do not need to use optical connectors to transfer digitally to an MD unit.

  • Digital Out voltage range controled using software

    I am trying to see if we can programatically control the voltage level of the Digital Out. I am using a M Series PXI 6281 board. The specs gives 0-5V output range.
    I am trying to see if we can put out exactly a particular Voltage Level required
    for example 1.5Volts Digital out
    Thanks
    Swam

    Hello Swam. Thank you for contacting National Instruments. The digital outputs on the PXI 6281 use TTL logic, so it can only output 0V and 5V. We do have some Digital Waveform Generators (PXI 6541/6542) that allow 1.8, 2.5, and 3.3 volts.
    If you have not used up all of your analog outputs, I recommend doing a DC voltage. If you have used up all of your outputs, we have the PXI 6704, which has 32 analog outputs. I hope this helps. Have a great day!
    Marni S.
    National Instruments

  • No System Sound when using Digital Out. What the?!

    Hmmm. I've searched and read many of the posts regarding sound problems on the mac mini but none experiencing what i think(?) is my problem. That being that when I use a toslink to connect my mac mini to my an external 5.1 amp the following is disabled:
    - Volume control in menu bar disabled (greyed out)
    - Apple Remote no longer controls volume
    - DVD Player volume does nothing
    - System Sound Preferences show 'Digital Out' but no options
    Can someone confirm that these should still be adjustable? I can't believe that the now I have to use my stereo remote to control my Mac ?! Kind of ruins the 'Mac as a home theatre' experience. Unless I can find a solurion I guess it's back to analogue for me :o(
    Please help!
    Wayne.
    Mac Mini, iBook, Flat Panel Lamp iMac   Mac OS X (10.4.7)  

    I can't believe it! I'm not an audiophile I just wanted to have the clearest quality sound, so for Apple to allow fibre optic connection but disable the ability to change volume just flat out *****. There should at least be the option to treat the connection as stereo. Why should I have to switch back and forward to an analogue cable if i want to use the front row remote? Not very well thought out Apple!
    Thanks for the Remote Buddy suggestion will look in to it.
    Anyone else got any ideas for a work around??

Maybe you are looking for

  • Can't unmount an internal disk that I installed in my tower

    Years ago, I added a supplemental internal hard drive (Maxtor) to increase my storage capacity. It continues to work fine. But... I'd like to be able to do maintenance on it (verify the directory, make any repairs, etc.), and for that, I need to be a

  • Nokia 100 (not enough space for new messages)

    Hi! From time to time i get messages that there is a text message that wants to come through but that there is not enough space. I then delete some inbox messages and then within minutes i get the text. However, recently it has taken much more time f

  • Does the macbook pro have a password protect feature?

    i'm debating whether or not I need the Kensington ComboSaver Notebook Lock for college. if the macbook pro has a password-protect feature... maybe i don't need the lock

  • How do I rid Safari of constant pop-ups?

    I have recently been plagued by something which has attached itself to Safari--annoying pop-ups, GoPhoto.it, and a little green thingy with an arrow inside of a backet.  Please help.  Safari 5.1.10, Mac Snow Leopard

  • Help with small office PBX system.

    Hello all, I'm looking for any help or advice here. We have an old Panasonic PABX, 3 external CO lines and 16 extension lines (only 8 in use). Question 1. We have CO1 connected to the fax/broadband number. C02 and CO3 connected to our other number. H