NI 6501/9 - Knowing state of Digital Out pins... (in C#)

Hi,
I'm trying to work on a "driver" for an NI 6501 (and down the road, 6509) DIO device.  We've got a method that sets the state of a pin and creates all the necessary digital out channel calls.  It appears that the command works fine, by having LED's connected up to the pins.
However, when I run this code:
public virtual byte ReadLineInput(int channel)
if (IsSimulated)
return 0;
var readTask = (Task) taskChannels.GetValue(channel);
var reader = new DigitalSingleChannelReader(readTask.Stream);
var data = reader.ReadSingleSamplePortByte();
CheckForErrors();
return data;
where "taskChannels" is where we stored the tasks set up for 3 8 bit ports to be Digital Outputs...
I don't get the values I'd expect.  I'm reading from a Digital Output, so I'd expect it just to tell me what pins are on and off.  However, I have noticed it's actually switching them to Digital Inputs, and then it is setting all the pins to high (which I'd expect with the pullup resistor and nothing hooked to the pins) except for the pins which are connect via LED's... They go low (because they're connected to ground) and I get 0's.
How do I view the state of Digital Output pins without storing them in the driver?  For all intents and purposes, this device will be all digital out....  there are no commands to change the channels to Digital In...  so the "read" is doing that on it's own... Is there a "Peek" or "View" on the digital outputs?
Thanks,
Rich

Hey Jonathan - 
Driver may be a strong word... We're creating a functional "layer" so that we can send in an int value to a channel (8 pins) and the pins would be set appropriately for that value to control a device attached to those 8 pins of the NI-6501/9.
We're using the 9.8.40.45 version of the NationalInstruments.DAQmx.dll and 13.0.40.190 version of the NationalInstruments.Common.dll.  I realize this puts us a version behind the newest, so we have that on our plate as a possible change to get what we're looking for....
I looked within the Digital Out Channel functionality and didn't find anything that didn't swap functionality (as I mentioned above)... Doing a read on an output channel acted like it changed the channel into an input channel (due to the LED connections showing values, where it should have been showing what pins it had previously set high..)
If code was added to the 9.9 version of NationalInstruments.DAQmx.dll, then I can hunt that down...   It just seemed odd you couldn't read what you had set pins to...
Thanks.
Rich

Similar Messages

  • 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....

  • Audio output changed to 'Digital Out' and speakers don't work! Please help!

    I'm not exactly sure what's happened, but after starting up my macbook pro, my speakers/audio haven't worked.
    The volume control in the menu bar is inactive (looks light grey) and in the Sound menu, I have no option for output devices except for 'Digital Out' - there is no other option for 'external speakers' (as per usual) or anything!
    I can plug earphones in, and sound comes out fine... I don't know what may have happened, but I'm really worried - I use my MBP for home & work; I need my speakers to work!!
    If anyone can offer any advice, I'd be really grateful. Thank you in advance.

    Talked to Tech Support about this when my machine locked up in this same fashion. There's a little "door" inside the headphone jack that can get stuck in the open position and keep the audio from switching back to the internal speakers / stuck in the digital (optical) output position...
    The solution: the iPick... It's a toothpick, but if you use it to poke around inside the headphone jack until the little door gets unstuck, it becomes an iPick, and a box of them are very expensive, but they come in lovely colors and are very intuitive to use...
    I'm not kidding... Stick a toothpick (or other non-conductive small stick) in the headphone jack and joog it around until it releases the little door...

  • 2009 Mac Pro no audio out from Line Out and/or Digital Out.

    Hey guys, I recently bought a new tv which has an optical input and thought I'd buy an optical cable to connect it to my Mac Pro's (4.1 model 2009 I believe) digital out port which I have never used before .
    The issue I'm facing since is that I can't get out from my mac pro to my tv. I also bought a cable to direct sound from my mac pro's line out, to my tv's red/white stero audio ports.That didn't work either.
    When I select Digital out as the default audio output in Sound preferences the OS says that there are not default audio controls for that device and the sound icon in the menu bar is greyed out while when I switch to line out output I can control volume but no audio is coming from my TV.
    I've been searching on forums and didn't find any relevant answer so if someone knows what may cause this that'd be really helpful.
    *ALSO: I've got windows 8 instaleld on my mac pro as well. The digital out doesn't work there as well although the line out does send sound to the TV.
    ** I also have soundflower installed and perian although I don't think any of them would mess things up like that.
    Do you think this is a problem with my Mac or is this a common Mavericks issue (sorry forgot to mention I'm on 10.9.2)
    Many Thanks,
    Thanos.

    When I select Digital out as the default audio output in Sound preferences the OS says that there are not default audio controls for that device and the sound icon in the menu bar is greyed out
    That's normal.  Is the correct audio input selected on the TV?

  • Digital Out activated when regular headphones plugged in.

    Hi, guys.
    I've been fiddling with this for a couple days now.
    When I plug regular headphones or speakers into my MacBooks jack, the systems goes into Digital Out mode and thus, no sound can be heard from the headphones. If I plug them out, the internal speakers go back on and sound is back to normal.
    After a lot of researching, I found a common issue, where the microswitch inside the audio jack would get stuck, and therefore the digital audio would always be active, even without anything plugged in. I don't think this is the same issue, since the system DOES KNOW when the jack is free, since I can easily switch back to internal speakers by plugging out. That's why I don't think the microswitch is stuck in my case.
    I've noticed the red light turns on when headphones are plugged in. Somehow, it thinks any plug is a digital audio plug.
    At this point, I've tried:
    SMC reset
    Wiggling a toothpick inside the audio jack
    Deleting some audio plist files in my preferences folder
    MIDI Audio configuration
    Any tip will be preciated. I'm not in the mood to send it to have the motherboard replaced.
    Thanks a lot for any hints!

    Thanks. I already tried that twice, but didn't work.

  • How do i turn ON digital out port on appleTV

    Just got my new apple tv ( latest version). I have connected hdmi out to the tv and optical out to my old A/V receiver. I have also appropriately made all the assignments on my receiver for optical in. Not getting any sound from digital out of apple tv to my receiver. Want to use my surround speaker set up. Please advise how to turn ON digital out on apple TV.

    Hey gd6784,
    There are several versions of Yahoo Mail and they are each a bit different. Without knowing which version you use, it's difficult to help. I'd suggest you look at the [http://help.yahoo.com/kb/index?page=product&locale=en_US&y=PROD_MAIL_ML Yahoo Mail support documentation] as it will have more detailed information.
    If you search for [http://help.yahoo.com/kb/index?page=answers&startover=y&y=PROD_MAIL_ML&source=answers.landing_search&locale=en_US&question_box=out+of+office "out of office" in their documentation] you'll see different articles that explain how it works and it will tell you which version of Yahoo Mail each article applies to.
    Matt

  • M-Audio Studiophile AV 40 monitors with imac optical digital out

    I'm looking to purchase these monitors for my imac or ones very similar to them and was wondering how I go about hooking them up to the imac. I've read that I would have to use a mini-TOSLink cable to use the optical digital out, but how do I go from that to the RCA on the back of the monitors? Do they make a mini-TOSLink cable to RCA cable? Any help would be greatly appreciated.

    aberrant_soul wrote:
    I've read that I would have to use a mini-TOSLink cable to use the optical digital out,
    but how do I go from that to the RCA on the back of the monitors?
    No, the AV 40 inputs are line-level analog RCA; they 'don't understand' digital audio,
    and the conversion requires more than a cable -- you'd need an D-to-A converter.
    You could run an analog signal to the monitors with just a cheap miniplug-to-RCA
    (analog) adaptor from Radio Shack; but if you want to use the iMac's digital output,
    you'll need some sort of external digital-to-analog conversion hardware.
    I don't know of any inexpensive stand-alone TOSLINK-to-analog converters, but
    there are many USB-to-audio products that would allow you to feed digital audio
    from the iMac to the AV 40's -- but through a USB port, rather than TOSLINK.
    Search for "USB audio" on amazon.com and/or newegg.com.
    Looby

  • Xtrememusic: Digital out or Analog out, Advantages Disadvanta

    I have a Xtrememusic card, that has a wonderful sound using the analog outputs to 3 Sonic Impact T-Am
    ps.
    Now, I'm curious about using the digital out to a Panasonic SA-XR55 digital amp/receiver. I know I would lose the CMSS, but the Panasonic can do it's own synthesis of surround. I'm interested in knowing from users about the pros and cons of using the digital out or analog outs. I know the quality of the Xtrememusic DACs are good, and I read that the Panasonic?has a excellent sound output as well. If I choose to use the digital out, I could just use?the motherboard onboard digital out, although only in DVD modes does it do a true bitperfect pass through. In stereo mode, it's still using some of Windows to mix the sound. I could also use the digital out of the card. Seems like a shame to bypass all of that nice analog the card is capable of?
    Oh yeah, anyone know if a old Creative Li've 5. I/O panel will work with a Xtrememusic card??Thanks

    wiersch,
    I believe you might have Skype set to auto-configure your soundcard. Try this, open Skype and go to it's audio setting menu. Disable the option 'Let Skype adjust my sound device setting.'
    Jason

  • 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

  • 2 digital out 2 analog in loop

    LabVIEW 2013 SP 1
    Windows 7 Pro
    NI DAQ PCIe-1433
    Custom PC board attached to the DAQ
    Each individual signal disucssed has been tested and works.
    Hi all,
    I have an application that does a bunch of setup, when the user presses go, runs a main loop that does a number of things, saving images, etc., and also periodically sets digital output pins HI, and then LO.
    This has to be synchronized with the image retrieval and storage.
    It is working well.
    I need to add 2 Analog Input signals, also synched with the Digital out and the video capture.
    I simplified it all so that in the test application, I start the app, set up some preliminary stuff, and when the user presses go, run a main loop.
    I've removed the video component and data file components for now.
    The test app will trigger a single digial out (e.g. left puff) and start listening on a single Analog In (e.g., left mic).
    When the left mic reaches a trigger level, it flags it, and stops listening.
    When the time is up, the digital out (left puff) is set to LO.
    If the trigger level hasn't been reached when the digital timer is up, it stops listening then too.
    That works okay (the first time).
    However, the loop keeps running, as it should.  When the next time hack comes around the the same thing is supposed to happen again (either left or right), the digital signal is not tripped, and the Analog In is not started.
    And that failure is true for all future loop iterations.
    I threw in a counter to show me if the LabVIEW was enterring the case statement, and it is counting up as it should.  But the signals are not generated.
    If I go to the diagram, and turn on the 'lightbulb' tracking; everything works.
    I get the digital output when I should, I get the analog in.
    When I turn off tracking, it doesn't work past the first iteration.
    I've attached the example file.
    Any thoughts are appreciated,
    Jeff
    Solved!
    Go to Solution.
    Attachments:
    Puff timing loop.vi ‏36 KB

    Hi Julian,
    That occurred to me as well, but I couldn't see it.
    After taking the night off, and looking at it again, I noticed that the 'stop' case was executing directly following the 'start' case (within the same iteration of the while loop).
    So, it was actually turning on, but then immediately turning off, before any slow-witted human could discern the action.
    Thanks for the solution.
    Jeff

  • Output jack is permanently on "Digital Out"

    The output on my powerbook is permanently set to digital out. when I go to the sound preferences I am unable to change it back. There are no other options to change it to. Digital out is the only one there. What happened? Can anyone help me?

    My Powerbook G4 is also stuck with only "Digital Out" in the sound preferences. It happened right after I unhooked my headphones. Now I seem to constantly have a red laser light coming out of my headphone jack. I imagine there is probably something stuck in the jack that makes it think there is always something plugged in, but I'm not sure. I tried deleting sound preferences, checked disk permissions and restarted in different users. Let me know if anyone has any ideas. I think I'm gonna play with the actual jack and see if something is stuck or something.
    Thanks.

  • Set Digital Out as Open Collector in NI MAX

    I am not sure where the best place for this post should go since there isn't a NI MAX Board:
    Is there a way to set a digital out as an open collector (assuming device supported) through NI MAX?  Via Global Channels/Tasks/Device Config?  I am currently using the USB-6001, but see no way of performing this in MAX.   I know there is the ability to do it via a channel property node within Labview (http://digital.ni.com/public.nsf/allkb/D9B4018C3E540CE4862570F30068C0DB)
    If there is no way to do this, could this be a possible future feature (along with the ability to change other properties via MAX)?

    It doesn't really matter either way, but it would be convinient to be able to change more settings through MAX so you don't have add it to every piece of LV code you may use.  I do understand that it make sense to require this kind of setup on a program to program basis, since developers do use the same piece of equipment for multiple products/applications and trying to keep track of what the settings in MAX are could be a huge PITA.

  • Simultaeno​us digital out and analog in

    Hi. I am running into an issue with the simultaneous AI (analog in) and DO (digital out) with Athena (www.diamondsystems.com) and LabVIEW (see the supplied files): The original program example supplied by somebody (the attached 060126 file) runs fine with these two simultaneous operations.
    However, for my specific requirements, I would have to put a frame (flat sequence) around the DO part (the attached 060131 file), followed by another flat sequence frame that changes another DO state. The reason that I must do this is that I have 2 valves which change states as the AI operation continuous to run.
    I have noticed though, once I put those flat sequence frames around it, the DO pauses and doesn't perform the operation until the AI loop is stopped. I have tried to create various local variables but the issue persists. Would there be a workaround for this? Thanks.
    Attachments:
    HMIR_SBC_060131.vi ‏374 KB
    HMIR_SBC_060126.vi ‏137 KB

    I have taken a look at your code. Based upon your description,
    and the fact that I do not have the driver for your device, I am not exactly
    sure where the program is pausing.  I can give you some suggestions to
    resolve your problem.  When you use a flat sequence structure, every piece
    of code in a frame has to finish execution before the next frame will start
    execution.  If you have code in parallel (i.e. digital output and analog
    input) in one frame and the same in a second frame the digital output and analog
    output in the second frame will not start until all the code in the first frame
    has finished execution.  In your case it you have a while loops for
    digital input and output in the first frame.  When both of these loops
    finish execution, you should see the second frame start shortly after. 
    From your description what I believe is happening is that the digital output in
    the first frame is finishing and waiting for the analog input to finish. 
    After the analog input loop finishes the second frame can start.  If you
    want the second frame's digital output to start before the loop finishes
    execution you will need to take that code out of the frame.
    Regards,
    Jesse O
    Applications Engineering
    National Instruments
    Jesse O. | National Instruments R&D

  • Digital out is no option in sounds

    Dear you,
    I have bought a belkin optical cable for my new minimac intel duo. In this new minimac they made an analog and a digital out in one plug. Beautifull design, but how can I convince my Minimac to give an optical signal instead of an analogue signal. I first thought that the minimac recognizes the belkin optical cable, but it dindn't. Than I thought I could change in " sounds" under " properties" from "headphone" into "optical out" (this is what I learned from different sites), but this selection is not possible.
    And now I don't know what to try next.
    Who can help me?
    David

    Your computer should recognize the cable as an optical one when you insert it, just by the physical difference in size and shape, so are you sure it's not doing this? Test it by trying to adjust the volume in Mac OS X. If the system locks your audio level in one place, you're good to go. But if it doesn't, something has gone wrong somewhere and I would consult an apple specialist.

  • How can I set the initial state of the PGCTR0 out pin?

    Hi,
    I have a 6115 board, and I am trying to generate a pulse train on PGCTR0 with an external clock. The external clock signal is connected to PFI1 and the PGCTR0 is gated through PFI0. The PGCTR is reset at the end of each run.
    The problem is that the initial state of the PGCTR out pin changes from run to run, but I'd like it to stay high after reset. Any help is appreciated. THanks.
    feng

    Hi Feng,
    The default output state of your counters should be high depending on your board. If you run a counter application, and the line ends in a low state it will stay low. One way to change the output state is to not only reset the counter but reset the board (see knowledge base linked below). The other way is to treat it like a digital line (see second link below). This is probably the best method. This method should allow you to read the value and change it using a couple software calls. Instead of disabling the counter, I would reset the counter since you just want to reset the state. This method is also a decent workaround because you are resetting the counter anyway. Hope that helps. Have a good day.
    Default State of Counter Output Lines
    on E Series Data Acquisition Devices
    http://digital.ni.com/public.nsf/websearch/008995633E33E47486256B5F00034436?OpenDocument
    Using the General Purpose Counter (GPCTR) on the Data Acquisition (DAQ) Device as a Digital Line http://digital.ni.com/public.nsf/websearch/B8A49A4E33F38AB686256B610061DC6D?OpenDocument
    Ron

Maybe you are looking for