Alternate-action triggering on a hardware digital line?

I'm using a PCI-6036E DAQ and I have a digital pulse available as a trigger. I'd like to arrange things so that, from a stopped state, the first instance of the pulse would start acquisition and the next instance of the same pulse (on the same line) would stop acquisition. Acquisition rate is software controlled. The pulse comes from a sensor on a slowly-rotating shaft. The pulse is relatively short, and I have the option of using either edge for either the start or stop trigger. I'm using ComponentWorks and VB6. If I absolutely had to, I could use another DAQ card that fits into a PCI slot. Any ideas out there?
All for now, Doug

Hello:
The example that ships with NI DAQ and is installed if you install NI DAQ with VB6 already installed in the following directory:
"C:\Program Files\National Instruments\NI-DAQ\Samples\Visual Basic with Measurement Studio\Analog Input\Acquire N Scans.prj"
This example can do a start trigger right away. However, you need to make some minor changes to get it to use a hardware stop trigger as well. To do so, you can configure the CWAI control for a hardware stop trigger and set the source to "pfi0" which is the start trigger line or make the following changes in the code:
CWAI1.StopCondition.Type = cwaiHWDigital
CWAI1.StopCondition.Mode = cwaiFalling
CWAI1.StopCondition.Source = "pfi0"
This should get you on the right track...
G
ood Luck!
Sincerely,
Brooks B
Applications Engineer

Similar Messages

  • Reading/writing digital lines without external hardware (besides daq device)

    Hi,
    I have a USB-6259 (mass termination).  I don't have any additional hardware, just the USB device.  I  am trying to use the MAX utility (4.2.1) with NIDAQmx (8.5).  I eventually want to program digital lines (read and write them) using the NIDAQmx API.  I ran some of the VB6 samples.  I thought how it works is that I could run the WriteDigChan VB code to set line(s) on or off, then use the ReadDigChan VB code to read those lines I changed.  However that did not work so I started created some tasks using MAX however that does not work either.  I hope this is not too stupid a question but I am not too familiar with the hardware.  Do I need some additional hardware connected to my 6259 to keep those digital lines in one state or another?
    thanks, David

    Without regard to using it in VB, I am trying to understand the operation in MAX.  I am attaching two screenshots of 2 tasks that I am using.
    thanks for replying, David
    Attachments:
    ScreenHunter_004.jpg ‏180 KB
    ScreenHunter_005.jpg ‏233 KB

  • Help: Can you use software trigger on a digital line.

    Hi:
    We have a legacy DAQCARDard 700 which does not support hardware triggering.
    We have a trigger from our instrument that is 5 V+ and we would like to
    trigger when it drops to 0 V. We have several questions.
    1. Do we need to invert the signal in MAX or is that only for V that are
    negative?
    2. Is there a good example in the examples where the state of this digital
    line is used to trigger an analog acquisition? When we tried using the
    digital trigger examples, we had an error saying that the hardware did not
    support that mode.
    3. We have an analog software trigger mode (based on the Analog Software
    Trigger example) working which we would like to modify over to read the
    digital line, but we have done very little wi
    th digital I/O.
    4. The digital trigger has been assigned a virtual channel of dtrg.
    Any help would be much appreciated.
    Thanks in advance,
    Pete

    Thanks Doug,
    If we read the digital line instead of as an analog line would it improve
    the accuracy of the triggering. Everything works now except we have a
    little bit of timing jitter within about 1 data point scanning at 50 kHz.
    However, I've never done any digital i/o with LabView, but may I should work
    through some of the tutorials. If you thought that this might solve the
    jitter problem. Would checking the state of the digital line allow a faster
    response with softtrig, I guess is my question?
    Pete
    "Doug Norman" wrote in message
    news:[email protected]..
    > Hello Pete,
    >
    > You are correct that the DAQCard-700 has no digital (or analog)
    > hardware trigger. The analog trigger example t
    hat is working for you
    > is using conditional retrieval. This is where data is always being
    > acquired and the driver looks at the values to determine when to
    > "trigger" and read the data into LabVIEW. To answer your questions:
    > 1. I don't think you need to invert the signal. This is for when you
    > want a digital low (below 0.8 volts) to show up as a digital high, and
    > a high (above 2.0 volts) to be read as a low.
    > 2. I don't know of a good example. You would basically have to
    > monitor the digital line. When it goes from high to low you would
    > then start your analog acquisition.
    > 3. I think this could be your best bet. If you have enough analog
    > input lines, why not just connect this digital signal as one of your
    > analog inputs. Then use this example to trigger when the 5 volts
    > drops to 0. It won't hurt to acquire your digital signal on an anlog
    > input along with your other data.
    > 4. I don't understand this question.
    >
    > Best Regards,
    >
    > Doug Norman

  • Executing Acquire upon Digital Line State

    I have a homework problem where a analog voltage measurement isn't supposed to start until a digital line becomes true.
    I have it working, but just checking if there is a preferable way.
    As a test, I used a T/F toggle switch inside a continuous while loop to simulate the digital line state. When I toggle the switch to True, I pass a True value out of the While loop. I pass this True value to a Case structure that accepts 2 values, True and False. On True, it starts the analog data aquisition, which works all OK.
    Is there a preferable way to "wait" on a trigger, and then execute a block of code?
    thx
    Jeff

    There are a number of examples that ship with LabVIEW that already incorporate digital hardware triggering.
    The program you described will work, but the amount of time between the triggering event (toggling the switch) and the start of the acquisition will vary because you are monitoring the value of your digital line in software. The latency will depend on how many things your computer is doing at once, as well as the speed/memory of your computer.
    By using hardware triggering, you eliminate the software dependancy and achieve a response time in the nanoseconds. You can find the triggering examples by choosing "Search Examples" from the LabVIEW splash screen. Once the help window comes up, choose "I/O Interfaces -> Data Acquisition -> Analog Input -> Triggering a
    n Acquisition."

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

  • Write to digital line and wait 20 mico sec and aquisition

    i have DIO-32HS and PCI-6036E. i want to select a port by writing to digital port or line and then wait for 20 micro sec after thar i have to aquire data from AI.my problem is waiting 20 microseconds how i can achieve this?E-mail id:[email protected]

    Here is what I suggest. I'm assuming you will use the DIO-32HS for writing to the digital line. You could use that digital line as a trigger for a counter on the PCI-6036E. When the counter is triggered, it could generate a single pulse with a delay of 20 microseconds and that pulse could be used as a trigger for analog input on the PCI-6036E.
    There are LabVIEW shipping examples that will illustrate how to setup triggered counter and analog input applications. I hope this helps.
    Regards,
    Todd D.
    Applications Engineer
    National Instruments

  • Dumb question: Difference between Digital Port versus a Digital Line?!

    Hello All,
    PLEASE excuse my numbskull question, but I can't find an answer to this question. What is the difference between a digital port and a digital line? I need to control some relay modules in our 2345 box. This works with digital line output, but I can also trip the relays using a Port write.
    Any recommendations?
    Thanks for all your input.
    Max

    Hello,
    There are a few different ways that you can control your digital lines.  You can use the DAQ Assistant or you can program by using the DAQmx VIs that the DAQ Assistant uses to generate its code.
    Either way you will need to write to a digital line so your lines will need to be configured as digital outputs.  There are a few good examples that you can use that are installed with LabVIEW.  You can find these examples by opening up the Example Finder (Help>>Find Examples) and then browsing to Hardware Input and Output>>DAQmx>>Digital Generation.>>Write Dig Chan.vi.  This example shows how to write the different lines on a port.  You can also choose to write just one sample instead of N Samples.  Depending on your situation you can change the polymorphic instance of the DAQmx Write VI and also change the line grouping constant from "one channel for all lines" to "one channel for each line" if you want to write in a different way.  But you can at least start with this example and make any changes you like down the road.
    Have a good day,
    Brian P.
    Applications Engineer

  • Smart Form: Which Action triggered the form?

    Hi all,
    we are using a Smart Form that should show information depending on which action triggered it. The Smart From is called by one class that does some preparation logic (Parent CL_SF_PROCESSING_PPF, Method EXEC_SMART_FORM). This class is started by several actions.
    I know I could have several classes, one per action. But in case of changes, I would have to change all classes.
    Is there a way to determine in the class which action was used to call it?
    Thanks for your help,
    Timo
    Message was edited by:
            Timo Koch (rephrased question)

    Hi,
    I'm facing the same issue, for the moment the best answer is to read the value of the GUID from PARAMETER values.
    DATA: para TYPE tpara-paramid VALUE 'TRIGGERGUID'.
    GET PARAMETER ID para FIELD wv_ppf_guid.
    IF sy-subrc <> 0.
      MESSAGE 'Parameter not found' TYPE 'I'.
    ENDIF.
    SELECT SINGLE * FROM ppfttrigg INTO ws_ppfttrigg
    WHERE os_guid = wv_ppf_guid.
    The problem is on creation mode, the guid is filled but the table is not, I'm trying to get info through class cl_manager_ppf but I haven't found yet ...
    Regards,
    Guillaume Mackowiak.

  • Multiple VI's using different digital lines in one VI.

    I have created multiple vi's, each of which require either reading or wroting to a different digital line on the CB-68LP board. I need to put them all in one individual vi so that I can see everything on the front panel. When I have tried this the vi seems to send a confused signal and operate things which it shouldn't.
    Is it even possible to try and do what I am doing? If not, any ideas what I can do? Thanks.

    Multiple VIs are usually the better approach. What I would suggest is parallel loops. These are loops which do not have any data dependency on each other. One handles the User Interface - the front panel where you "see everything." Another which reads and writes from/to the digital lines. Maybe even a third which processes the data. Exchange data among the loops with queues or functional globals.
    Keep a record of the state of all the digital lines. When something is to be written to certain lines, use either a Write Line.VI ( I don't recall the exact name) or use AND and OR functions with masks to protect the states of line you do not want to change.
    BTW, the CB-68LP is merely a connection interface, not the digital I/O baord itself.
    Lynn

  • How does one write to individual digital lines accross many DIO-96 ports?

    I want to be able to write to any individual DIO-96 line without having to repeatedly init. The available vi's can set up only 24 lines at a time. If it is desired to write to a line outside of those 24, another 24 lines must be initialized, then to return to the first 24 lines, those must be initialized once again. Very clumsy! Does anyone know how to init all lines one time and then allow random access to all 96 lines without further initialization?
    Thanks,
    CBD

    Hi Tom,
    try to use (or at least to insert) that control in another environment (like a Visual Basic form) in order to check if it's working properly. Also, check if you have the DLL with the same name in your system folder - this control it's just a simpler way to use that dll.
    You can use Write to Digital Line.VI, but pay attention to ITERATION terminal - if it is 0(default) LV will call DIO Port Config (find details in help).
    Hope I understood the problem...

  • Pxie-6556 - How to control the rise time in the digital lines (hsdio)

    Hi,
    Is there any way to control the rise time in the PXIe-6556 digital lines?
    Even in a low frequency signal 10kHz the rise time is about 2ns.  
    Tks,
    Solved!
    Go to Solution.

    Hello engfpe,
    The PXIe-6556 is a 50 Ohm system, meaning the output is source series terminated to be 50 Ohms and all our cables and accessories are 50 Ohms.  With this setup regardless of the data rate you should have a clean rising or falling edge regardless of the data rate. The quality of the output (rising or falling edge) at your device will be related to the impedance matching of your cables. 
    The PXIe-6556 cannot adjust the slew rate by itself.  However you can insert some simple passive components to do this for you.  I've attached below to images.  The first is a schematic showing one way of slowing down the edge.  The second is the a simulated waveform showing the original edge rate before slowing it down, and the slowed down edge.   This simulation is not of the PXIe-6556 but instead a generic digital output for concept.  In the schematic R1 is set to 34 Ohms because U1.8 has the additional 16 Ohms inside it.  TL1 is the 50 Ohm output simulating the cable on the PXIe-6556.  R2, R3 and C1 are components you could insert after the PXIe-6556 cable before it goes to your device/cables.  In this setup the cable going to your device is TL2 which is also 50 Ohms but it could be another impedance in which case you would change R3 to match.
    You can see in the attached images you can significantly slow down the edge with this setup by altering C1.  I hope this helps,
    Jesse O. | National Instruments R&D
    Attachments:
    edge_compare_schematic.jpg ‏94 KB
    edge_compare_waveform.jpg ‏44 KB

  • Hardware digital trigger to start stop continuous analog acquisition

    Hi I have seen the following example to use digital trigger to start and stop for finite number of samples. The example names is (DigitalStartandStopTrigger.vi)
    in this example Reference Digital edge is used to stop acquisition but if I change to  continuous then Reference Digital edge stops and show an errir. Could you please let me know how can I use hardware digital trigger to start stop continuous analog acquisition. An example would be really great
    many thanks

    HI tintin_99,
    The way that example works (by modifying the read position of the buffer) essentially performs the same operation that the continuous samples mode does. That is to say, it is already a continuous acquisition.
    The article below explains this in more detail, and the reasoning behind specifying buffer size manually and other tricks used. You may have already visited it in order to get the example VI, in which case it may be worth another read over.
    http://digital.ni.com/public.nsf/allkb/BA775B0E445BFA79482571FE0032CCEB
    Kind Regards,

  • Digital lines showing in full quality quicktime export

    Hello - just an addition to a previous matter - I exported an 11 min. movie in H.264, w/the default settings, NTSC 4:3; 720 x 480. It's 572.1 MB and I burned to a CD, so that the client can download it into their own laptop, then project it onto a screen. When I viewed it on my computer, there were all kinds of 'digital lines' that showed up, particularly through the transitions (though on most everything else as well), that don't show up on the burned DVD copy. I'm wondering what, if any, particular settings can I use when exporting, so that these pesky 'lines' won't show up, as it looks perfect on the DVD, but won't be viewing from that on the day of the event - ok, thank you!

    I have the same problem... Im using DV pal. Looks loke this is a big problem for many users, bus nobudy knows how to fiks it..my lines are still there on the dvds to by the way..)

  • Time Controlled digital line PXI-6251

    Hi,
    I need to create a time controlled boolean.
    For example a digital line is set to False. I'd like to change to True status for a certain amount of time (e.g. 150ms).
    Is it possible with PXI 6251?
    Thanks

    Hi,
    yes you can. Set a buffered digital output task like "Digital - Finit Output.vi" example.
    You can use an external clock, generate it throught counter output or use ananog in/out sample clock.

  • Arming a counter polling a digital line

    For arming a counter, a start trigger on the STC counter can be roughly emulated by polling a digital line and arming the counter once a high digital pulse is sensed. How can i do that?
    I'm using a PCI-MIO-16E-4

    Daniel,
    You did not mention which programming environment you are using, so I will describe the structure in LabVIEW (no matter which language you are using, this should give you the general idea).
    1. Configure your DIO port with DIO Port Config.vi.
    2. Configure your counter operation (Counter Group Config.vi, etc.).
    3. In a while loop, call DIO Port Read.vi.
    4. Monitor the bit corresponding to your trigger line. When this bit goes high, stop the while loop.
    5. Immediately after the while loop, call Counter Control.vi to arm your counter.
    This should be the basic structure of your program. Good luck with your application.
    Spencer S.

Maybe you are looking for

  • Abap Report including sales orders and delivery data.

    Hi Experts, I Want to develop a new abap report which would contain the data for sales orders and delivery. I want to fetch all the sales orders based on the ship date (LIKP-WADAT_IST) of the delievry. Could anyone please let me know how to fetch teh

  • TREX 7.10 Creation of an Index doen't work: TREX_RFC_CREATE_INDEX rc: 4950

    Hi,<br> <br> I order to use the few features of PLM7.0  I started to setup a TREX-Server.<br> <br> But when I create an Index for an Business Object,<br> (using Transaktion SES_ADMIN -> Index -> create Index/activate Index -><br> select an Business O

  • Hierarchy columns in prompts

    Hi, When using a hierarchical column (parent-child type) in a prompt the underlying reports must have this column physically included and the hierarchy column must also be included in the graph/table or else it will not be filtered when a value is se

  • Trigger and compare waveforms then write to file

    I am trying to make a coincidence between two channels without using a SCA.  I have a Tek DPO 7104 scope where I have two PMT's connected.  PMT1 is on channel 1 and PMT2 is connected to channel 2.  I have my current vi setup to trigger on channel 1. 

  • Time Machine and bootcamp

    Hi, I have Windows Vista loaded via bootcamp, whilst in OS X will my time machine back up the windows partition if there is a disaster will time machine put everything on my hard disc back as it was. Thanks