Detect DIO line change on PCI-6250

Using Visual C++ how can I detect when a digital line goes high on a NI PCI-6250 M-series board? I want to make a loop that will cycle each time a digital input goes high (with millisecond or better accuracy).
Thanks,
Mark

Actually, there are two ways to do this, if your card supports Digital Change Detection timing. Unfortunately the PCI-6250 does not, but the following cards do: PCI-6509, PXI-6509, PCI-6510, PCI-6511, PXI-6511, PCI-6514, PXI-6514, PXI-6514, PCI-6515, PXI-6515, PCI-6518, PCI-6519, PCI-6527, PXI-6527, PCI-6528, PXI-6528, PXI-6533, PCI-6533, PXI-6534, PCI-6534, and perhaps others.
In any case, if you do have one of these cards with hardware support for Digital Change Detection timing, then you can do one of the following:
a) Create a DI channel on your task, and then configure digital change detection timing using CNiDAQmxTiming::ConfigureChangeDetection(). Then perform either synchronous or asynchronous single-sample reads; when one of the digital lines of interest changes, then the blocking synchronous read will finish or the asynchronous read will call your callback. This is demonstrated with the Digital \ Read Values \ ReadDigChan_ChangeDetection example.
b) Create a DI channel on your task, configure digital change detection timing, and then set up a Digital Change Detection event on the task. This is demonstrated with the Digital \ Read Values \ ReadDigChan_ChangeDetection_Events example, although (a) is the preferred method.
Since the PCI-6250 doesn't support hardware digital change detection, what you have to do instead is to continuously read the status of the digital lines, and check to see if the lines went high programmatically. If you do not explicitly configure the timing for the acquisition, then the timing mode will be on-demand and the data will be read as fast as possible. You also have the option of calling CNiDAQmxTiming::ConfigureSampleClock() to configure the clock rate based off of another signal, such as PFI7. Here's a sample:
try
CNiDAQmxTask t("");
t.DIChannels.CreateChannel("6250/port0/line7:0", "", DAQmxOneChannelForAllLines);
t.Timing.ConfigureSampleClock("/6250/PFI7", 0,
DAQmxSampleClockActiveEdgeRising,
DAQmxSampleQuantityModeContinuousSamples, 1);
CNiDAQmxDigitalSingleChannelReader reader(t.Stream);
bool stopLoop = false;
while (!stopLoop)
CNiBoolVector data;
reader.ReadSingleSampleMultiLine(data);
for (unsigned int i = 0; i < data.GetSize(); i++)
if (data[i])
MessageBox("Went high.");
stopLoop = true;
break;
catch (CNiDAQmxException* ex)
ex->ReportError();
ex->Delete();
Hope this helps,
Hexar Anderson
Measurement Studio Software Engineer
National Instruments
Hexar Anderson
Measurement Studio Staff Software Engineer
National Instruments

Similar Messages

  • DIO lines of NI PCI 7334

    Hi
    I have a NI PCI 7334 motion controller from which I hope to controll 4 stepper motors through a MID 7604 stepper motor driver. In addition to this I require to drive 6 relays from TTL signals (generated from commands from labview) through the digital IO lines of the device.Can this controller provide 6 digital out puts ( each giving a TTL signal) and one ground like in the case of DAQ device. I only have the cable connecting the controller to the MID 7604 stepper driver. What else is required to get the digital output lines and the ground similar to a DAQ device?
    Thanks
    Mal

    The PCI-7334 provides two connectors. One (1) for the motion control signals (which you are using) andanother one (2)for the additional 32 digital lines.
    On connector 1 there are also 4 digital output lines available that can be used as general purpose digital outputs for the case that you don't need the breakpoint feature of the board. These are open collector DOs pulled up to +5 V with a 5.5 kOhm resistor and they can sink up to 64 mA. You can place a parallel resistor between each DO and +5 V in order to increase the current. Please note that the resulting resistance (3.3 kOhm in parallel with your resistor + load resistance) shouldn't be below 78 Ohm.
    As there are only 4 breakpoint outputs available this solution will probably not work for you so you should use the additional digital lines on connector 2 instead which will require a cable (e. g. 186381-01) and a connector block. These DIOs provide a 0 to 5 V voltage range and can sink and source 24 mA. The current range can be extended with external SSR modules. For more information please refer to the NI 7330 user manual.
    Best regards,
    Jochen Klier
    National Instruments Germany

  • Accessing full 32 DIO lines on PCI-6602 in C++

    Hi,
    I have seen a couple of posts on this topic, but none seem to contain an answer to the question, and the documentation in the Register Level Programming Manual appears to be incomplete.
    We need to access the full 32 DIO lines on the PCI-6602 card; however, only the first 8 lines (those driven by the STC) are documented.  Is there any example code or further info that would allow us to use this functionality? 
    We are programming in C++, using the Driver Development Kit, in QNX.
    Any help would be much appreciated.
    Cheers,
    Monte

    The 32-bit digital port registers were not included in the chipobject (by mistake).  The digital intput register is at offset 0x414 and the digital output register is at 0x510.  To access them you can use the tAddressSpace object directly:
    u32 value;
    value = Bar1.readU32(0x414); // read digital 32-bit port
    Bar1.writeU32 (0x510, value); // write digital 32-bit port
    For configuration, use the IO_Pin_x_x_Configuration_Register registers to configure the line for input or output. 
    For example,  to configure line 0 and 1 for input
    tio->IO_Pin_0_1_Configuration_Register.setIO_Filter_0_Select (0); // no filter
    tio->IO_Pin_0_1_Configuration_Register.setIO_Pin_0_Select (0); //input
    tio->IO_Pin_0_1_Configuration_Register.setIO_Filter_1_Select (0); // no filter
    tio->IO_Pin_0_1_Configuration_Register.setIO_Pin_1_Select (0); //input
    tio->IO_Pin_0_1_Configuration_Register.flush (0);
    or lines 29, 30 and 31 for output:
    tio->IO_Pin_28_29_Configuration_Register.setIO_Filter_29_Select (0); //no filter
    tio->IO_Pin_28_29_Configuration_Register.setIO_Pin_29_Select (2); // digital output
    tio->IO_Pin_28_29_Configuration_Register.flush (0);
    tio->IO_Pin_30_31_Configuration_Register.setIO_Filter_30_Select (0); //no filter
    tio->IO_Pin_30_31_Configuration_Register.setIO_Pin_30_Select (2); // digital output
    tio->IO_Pin_30_31_Configuration_Register.setIO_Filter_31_Select (0); //no filter
    tio->IO_Pin_30_31_Configuration_Register.setIO_Pin_31_Select (2); // digital output
    tio->IO_Pin_30_31_Configuration_Register.flush (0);
    valid values for the select field are:
    0 - input
    1 - counter output
    2 - digital output
    I hope this helps.

  • Output signal high at DIO lines of 7330

    Hi
    I am using Labview 7.1 with Ni motion controller. I am trying to detect the output signals at the auxiliary DIOports of the card using the attached programme in the NI example finder. My board ID is 1 (thats what was allowed by the programme) and I put port 1 , to check the DIO lines of it. I checked pin 10 (port 1-bit 0) and pin 44 (port1-bit 1) using an oscilloscope. The output is high at 5volts.
    I changed the DIO pin polarity switches to active low status but the output remains the same.I fiddled with the set and reset buttons of the programme, initialize the card but nothing changes.  Any idea on how to figure whats wrong? 
    Thanks
    Mal
    Attachments:
    Auxilliary Digital Output.vi ‏57 KB

    Hi
    Thanks for the reply. Sorry for the delay in response as I was on vacation. I tried your programme but the result remains the same. The output is always high.
    Max shows the card is working properly. It also shows the board type as 63. But the programme only takes in board ID as 1. How can set the direction using MAX and save the settings?
    I tried the write 1 point example programme on axis 1 ,line 1 and tested the signal on pin 44 and 42 (oscilloscope ground), and toggled the line but the output is high. But when I stopped the programme with the STOP button it gave an error message 70102 with a possible cause the setting doesn't match the line direction?
    The oscilloscope ground was firmly connected to pin 43 or 42 of the board for all tests.
    I appreciate your help.
    Thanks
    Mal

  • Anyone have an example of a PCI-6250 Digital and Analog Aquistion with Analog Post-Trigger?

    Hey All,
    We're trying to set up a post trigger data capture of parallel absolute strobed Gurley 17-bit encoder data (ignoring MSB for 16-bit aquisition) with an analog signal that is the output of a torque load cell.  The trick is to use the analog signal level as a post-trigger to stop the data aquisition.
    1) can the analog signal be recorded and used as the trigger?
    2) does anyone have an example using the PCI-6250 (or 6251)
    Thanks in advance for your help,
    -Drewksi 

    Hi Drewski,
    You can use the APFI0 line as an analog trigger for your signal. However, in this case you need to connect your analog signal to both the analog channel you want to acquire at and the APFI0 line.
    Assuming you are using LabVIEW,you can check the "Acq&Graph Voltage-Ext Clk-Analog reference.vi" example. This examples uses an external clock but it works also with the internal clock. All you have to do to change the control to onboard clock.
    You can find this example in LabVIEW Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Analog Measurement >> Voltage
    Best Regards,
    Faris
    Bueller

  • Apparent altered DIO line input state on 4351 when using driver instead of NI MAX

    Hi,
    I'm using an NI4351 PCI DAQ card with the Ni435x driver and LabWindows/CVI v5.5 (on Windows 98) to capture digital logic states on the DIO lines. I first used NI's MAX utility to establish a virtual DAQ input channel from 'Data Neighborhood'. When I tested this channel from the utility by connecting the DIO line to 5V or GND via a 10K resistor, the respective logic levels were registered. In LabWindows, I use the 'NI435X_Init' and 'NI435X_Configure_Digital_Lines' driver functions to respectively initalize the DAQ card and set one of the DIO lines as an input, with the rest being set as outputs. However, I cannot read the input line using 'NI435X_Read_Line' unless I directly connect th
    is channel to 5V or GND (i.e. without a 10K resistor), but 'NI435X_Write_Line' works fine. It would appear that the input state of the DIO line is different to that established by NI MAX. Is there something other than the initialize function that should be called? I tried the following linemask combinations to set the port lines, by using F or 1 to represent an output and 0 to represent an input:
    NI435X_Configure_Digital_Lines(DAQ_session, 0x0FFFFFFF) // DIO 0 set as input, the rest as outputs
    NI435X_Configure_Digital_Lines(DAQ_session, 0x01111111) // DIO 0 set as input, the rest as outputs
    I am unsure which format, if either, is correct and would be grateful for any help on this anomaly. Thanks.

    Hi Kevin,
    Yes, if I connect an input channel directly to 5V, the software reads a logic high and continues to read this level even when I disconnect the channel and leave it "floating". The state changes to logic low only when I connect the channel directly to GND and then it stays at this level, even if I disconnect it from GND. In other words, the states seem to 'latch'. Nothing happens if I connect via the 10K resistor - the channel simply remains at the logic level it was last set to after I momentarily connected it directly to 5V or GND.

  • Detect deleted or changed members

    Hi,
    I am processing time dimension. while processing it is not moving forward from "Detect Deleted or changed members" step.
    Usually it takes about 2-3 mts or some times 5 mts, It is hanging about hour and half and never moves forward.
    can any one help me ?

    Hi,
    To see the IMG changes proceed as follows;
    Position Cursor on the IMG node and click on "Change Log" button (F7). If table loggin is not enabled then you may not be able to see the changes already made. But to track future changes in IMG settings you may Activate Table Logging at the Client Lebel. This can be helped by Basis Team. To check
    For changes made using KP97 you will be able to see changes in the planning screen. Go to KP06 or KP26 or KP46 and select the values and press overview button. Then position cursor on the value that you think has got changed and click Line Items (CTRL + SHIFT + F3) you will see the changes.
    For changes to FI Master data there are different TCodes;
    FS04 - Display changes to GL master centrally etc.
    The user id will be available in the change log.
    Thanks,

  • One control to 2 different DIO lines

    Hi there:
       I am using PXI 7833R card and Labview 8.0 for windows. FPGA 1.1 version.
    I have a problem about the DIO. In a previous program I use one boolean number to control one PXI 7833R digital output line. Everything works. Then I want to use the same boolean number to control two different Digital output lines. I did not change anything else, Just add a Digital output line to the node A(the circled one is added). The program does not work any more.
    I used the oscilloscope to measure the output and got the signal I want for both output!!!
    Anybody knows why?
    Message Edited by lightmiddle on 03-06-2006 04:57 PM
    Attachments:
    twodio.jpg ‏1042 KB

    lightmiddle,
    I am still confused as to what you mean by "the result is far away from what I expect".  What is actually happening? In your previous post you said "I used the oscilloscope to measure the output and got the signal I want for both output!!!"
    I am still not sure how you can be using the FPGA 1.1 module with LabVIEW 8, this should not work.  To add multiple lines to one I/O node in LabVIEW 8 you can simply drag lower edge of the I/O node downward to create more lines.  See the attached image.  I would also take a look at the shipping examples for LabVIEW FPGA module.
    Message Edited by Doug M on 03-09-2006 06:36 PM
    Doug M
    Applications Engineer
    National Instruments
    For those unfamiliar with NBC's The Office, my icon is NOT a picture of me
    Attachments:
    two DIO lines FPGA.JPG ‏39 KB

  • RVDT avec une PCI 6250 ?

    Bonjour,
    Je désire faire l'acquisition des données d'un RVDT afin de mesurer sa précision et linéarité.  J'utilise LabView 8.2 et une PCI 6250.
    J'ai trouvé dans LabView un VI nommé "AI RVDT" qui semble pouvoir réaliser exactement ce que je cherche.
    Mais lorsque je lance l'exécution du prog, un message d'erreur s'affiche :
    L'erreur -200431 s'est produite à : DAQmx Create Channel (AI-Position-RVDT).vi:1
    Raisons possibles :
    La voie physique sélectionnée ne supporte pas le type de mesure requis par la voie virtuelle que vous créez.
    Créez cette voie d'un type de mesure qui est supporté par la voie physique ou sélectionnez une voie physique qui supporte ce type de mesure.
    Propriété: AI.TypeMes
    Vous avez demandé : Position : RVDT
    Vous pouvez sélectionner : Courant, Résistance, Jauge de contrainte, Température : Capteur intégré, Température : RTD, Température : Thermistance, Température : Thermocouple, Tension, Autres : Tension : Courant avec excitation
    Nom de tâche : TâcheTension0
    J'utilise une entrée analogique AI 1 (broche 33), le Vi "AI RVDT" ne me propose que des voies analogique AI0-AI15 et le résultat est le meme pour toutes ces voies.
    Pourquoi ?
    Le VI "AI RVDT" ne peut etre utilisé directement avec une PCI 6250 ?
    Si oui, dans ce cas, comment puis-je réalisé l'acquisition ?
    Merci.
    jcff

    Bonjour,
    En effet, seul certains matériels (SCXI, etc) peuvent utiliser cette fonction pour mesurer un déplacement avec des capteurs RVDT.
    Ainsi, si vous souhaitez utiliser votre carte 6250 pour mesurer un déplacement avec ce type de capteurs, il faudra que vous génériez une tension d'excitation adaptée, et que vous mesuriez la tension obtenue en sortie. Cependant je ne peux pas vous garantir le résultats final.
    En vous souhaitant une bonne journée.
    Cordialement,

  • How to detect the line wrap event of JTextPane?

    Hi all,
    I'd like to detect the line wrapping event of JTextPane, so as to adjust the visible rows of JTextPane. How could I do this? Thanks!
    Yi Bing

    there is no wrap event.
    Wrap happens during relayout. The event which invokes relayout could be different. E.g. change size or chane model (document).
    Just add document listener and componnet listener.
    Regards,
    Stas

  • Obtaining a TTL input signal via DIO lines of 7334

    Hi
    How can I obtain a TTl input signal from a source via the DIO lines of the 7334 .
    Thanks
    Mal

    I do not quite understand your question.
    If you want to know what kind of signal a DIO line will detect properly: the signal has to be less than 0.8V to detect a low state and more than 2.0V to detect a high state. This is compatible with outputs of all TTL logic circuits.
    If you have some other circuitry (source) with different specifications for the digital signal you can simply connect a switching transistor in open collector circuit. The DIO lines have pull-up resistors, and when the transistor is switched the DIO input will be tied to less than 0.8V (low level).
    Anyhow, if the high output level of your source is more than 5V (there are many control systems with 24V output level) it is better to use galvanic isolation to avoid damage of the motor controller. You can use a relay, or better an opto-isolator. You have to design the series resistor of the opto-isolator such that the input gets proper current to drive the LED (usually 10mA will be sufficient for most optocouplers). If the opto-isolator has an open collector output configuration it can be connected directly to the 7344 DIO line.
    Of course you always have to provide a common GND connection between the 7344 board and your signal source (or the open-collector transistor in case you use this configuration or an opto-isolator).

  • Pull-Up DIO Lines to 5V

    Hello, I'm using the NI PCIe FPGA 7852R card. When configured for output the DIO lines go from low, zero volts, to high, 3.3V. My application requires going from 0 to 5V. The manual for this card says an external pull-up resistor can be used to achieve 5V output from the card. I'm not sure how this is done, can any one recommend how to do this? Or, can anyone point me to documentation that details how to do this?
    Thanks,
    Ed

    All kidding aside, here's a more detailed link then my original one if you want to know more about the workings of a pullup/pulldown resistor
    CLA, LabVIEW Versions 2010-2013

  • Accessing the 3 extra DIO ports of a PCI 6025

    How do I access the 3 extra DIO ports of my PCI 6025E ?
    I understand that it is not supported -yet- by DAQmx base.
    From the writeDigPort.c example it looks like it is possible using
    DAQmxBaseCreateDOChan(...,"Dev1/port0:2",...) but it returns a -1 error.
    I had a look a the MHDDK ( tSTC and tESeries files) and it looks like the
    extra DIO ports of the 6025 are not accessible/exported. If I want to access
    the extra 6025 ports via the 8255 I need to write my own much like the
    DIO96's t8255 files ? I would prefer to avoid such a writing....
    Thanks
    Chris

    I haven't actually test this but ...
    You should be able to use the existing 8255 Chip object and examples from the DIO-96 and just change the offsets within t8255.h.  The offset for the 8255 registers on the 6025E are as follows:
    portARegisterOffset =   0x19;
    portBRegisterOffset =   0x1B;
    portCRegisterOffset =   0x1D;
    controlRegisterOffset = 0x1F;

  • How can I access the control lines of a PCI-1422 from within C++?

    I would like to know how the control lines of a PCI-1422 can be accessed (set) programmatically from within C++ (MS VC++7, Windows XP). A flat panel sensor connected to the PCI-1422 needs the control lines to switch on features like binning which I want to use.
    Unfortunately I was unable to identify an appropriate command in the IMAQ documentation. Does anyone have experiences with this?
    Thank you very much in advance!

    Kluas,
    The control lines are not exposed through any API. The control lines are run by the driver based on the instructions in the camera files. If the cammera file supports the binning functionality of your camera then you should be able to set the attributes such that the board runs the control lines approriately.
    Hope this helps,
    Amaury
    NI Applications Engineer

  • How can I use 4 DIO lines as digital input in a E series-SC 2050-ER8 set up ?

    I have a DAQ system with an E series DAQ card that is connected to SC-2050 and ER8. I want to use 4 DIO lines (out of 8) for digital input. How can I do this?

    Hello Suresh,
    There are a variety of ways to accomplish this. If you are using LabVIEW, you will use the DIO Port Config VI and the DIO Port Read VI. You will use the line direction map input of the DIO Port Config VI to setup which 4 lines you want to be the input lines. The LabVIEW shipping example entitled 'Dig Multi-line Direction (E) VI' shows how to use the lines of the digital port on an E-Series device for input and output.
    If you are using NI-DAQ function calls, you can use the Dig_Line_Config and Dig_In_Line calls to configure a digital line for input and then read from that line.
    I hope this helps.
    Regards,
    Todd D.
    NI Applications Engineer

Maybe you are looking for

  • Brand New Iphone 5s Home Screen display defect

    Here goes my ordeal with my Iphone 5s upgrade After waiting in line for over an hour I purchased the Iphone 5s yesterday at Best Buy (Stonebriar, Frisco, TX). Later that evening, I noticed that when the time was 5:36, the home screen display was not

  • Video Uploading in oracle database and playing that video in a jsf page

    Aoa, I want to upload videos in oracle database and I also want to play those videos using <af:media> tag in JDeveloper 11g. I have an applicaton which stores images in the database and show the images but when I try to upload videos lot of exception

  • Need help with ext. SWF and XML

    I'm trying to create an External SWF to load into my main site (photography). Home | Portfolio | Published Work | Bio | Contact The SWF I want to load externally is Portfolio because it has 5 sections Those 5 sections are: -Editorial -Adventure -Fly

  • PDF exports look terrible - white lines in text

    I have been u sing indesign for years and years all of the sudden my pdf exports look terrible. The images are pixelated and the text has white lines in it. I used these pdf previews for my clients and I certainly cant use what Im getting from INDD r

  • Internet connection settings

    Hi, I recently went on holiday to China for a week and during that period I used airport wifi connections and the broadband connection in my hotel room, but since my return home my dial up connection has been giving me problems. When I go into System