Externer trigger fuer pci 6542

Hallo
ich benutze die PCI-6542 I/O-Karte und wuerde gerne bei der steigenden flanke eines externen triggers Daten aufnehmen. d.h. noch im gleichen clock cyrcel. Wenn der externe trigger wieder runter geht, soll auch die Datenaufnahme stoppen. Ich benutze eine 10 MHz clock. gibt es ein entsprechendes vi fuer diese Anwendung. 

hi danke fuer die Antwort und sorry das ich jetzt erst antworte, aber war leider gesundheitlich verhindert.
meine Auslese ist imprinzip ganz einfach. Die I/O-karte bekommt die daten bei einer steigenden Flanke von einem externen hardware trigger, geht der trigger wieder runter, soll auch die Auslese stoppen, (bzw. man kann eine feste Anzahl von Packeten definieren). Fuer diese Anwendung benutze ich das "Pause trigger-vi" wobei ich hier eine feste Anzahl von Packeten definiere die ausgelesen werden soll, sobald der trigger high ist. Danach wartet die Aufnahme auf einen  neuen trigger...oder sollte warten. da ich um das ganze "pause-trigger-vi" einfach noch eine while schlife gezogen habe. Das Problem ist...es scheint so als ob die While schleife zu langsam ist. Der erste trigger puls kommt mit all seinen Datenpacketen super an, beim zweiten triggerpuls sollte die while schleife eigentlich schon wieder soweit sein, dass sie auf den naechsten trigger wartet, dies ist aber nicht der fall, sie ueberspringt mehrer triggerpulse, weil sie zu langsam ist.... siehe bild
gibts da eine Loesung die schleife zu beschlauenigen oder eine andere???
THX
Attachments:
puls.jpg ‏51 KB

Similar Messages

  • How to connect external trigger PCI-1433

    Hi all:
    I met the same problem as this old post: https://forums.ni.com/t5/Machine-Vision/How-to-connect-external-trigger-PCIe-1433/m-p/1677560/highli...
    however the post did not give solution.
    I am having an issue getting the external trigger( from PCI 6259) to work with a cameralink camera, a PCIe-1433 card . The PCI 6259 is connected to BNC 2111, the output trigger signal from CTR0 is connected to the SMB connector on the 1433 card and is providing pulse train at TTL voltages (0-5V).  Using the MAX SOFTWARE and under the Acquisition tab I have CC1 set to external 0, however the camera is not receiving this external trigger. The camera is Basler 4096-140km.
    I measured the ouiput signal from CTL0, the sigal seems good.
    I tried RTSI trigger before, failded. I thought SMB should be more straight forward, seems I was wrong.
    Looking forward to reply!
    Attachments:
    camera configuration.jpg ‏168 KB
    External Camera Trigger(SMB).vi ‏57 KB

    Bobjojo,
    You will actually need to affect the properties of both the camera and the frame grabber to take advantage of this triggering mode. I found a document that contains a good run down of the process to acquire in this mode (linked below). As far as the programming for the acquisition is concerned, the frames will be built at the driver level for the specified frame height. This means that the IMAQ driver will composite the line scans for you, and any simple acquisition (the document shows using the Vision Acquisition Express VI) will be able to pull the image into LabVIEW.
    www.ni.com/white-paper/13786/en/pdf
    Karl G.
    Applications Engineer
    ni.com/support

  • Software trigger the PCI-5122

    hi
    I am going to program a board with PCI-6552 and in meantime in specific times capture just one sample of the anolog output of the board by PCI-5122.
    1) Can I use the digital output of one channel of PCI-6552 as trigger for PCI-5122 (to activate the fetching of PCI-5122) e.g. by connecting the output of PCI-6552 to the external trigger input of PCI-5122.
    2) Does it need to synchronize the two boards.
    2) Is there any example for software triggering the PCI-5122, and how long it takes from triggering to sampling the data.
    3) How I can capture just one sample in every triggering time and then wait for another trigger time.

    1) after programming the two output of the NI-6552 (DIO0 and DIO1) with the same pattern and connecting the DIO0 to Ch0 of PCI-5122 and DIO1 to external trigger of PCI-5122 and assigning the external trigger as the edge trigger source, the the signal is different from when the Ch0 is assigned as the trigger source. why are they different, also it does not accept two triggers sequentially. (Pic 1)
    2)I am using a loop for generating the data and a loop for aquisition, when I using two trigger in one cycle and select niscope repeat_time=4, the signal position for 8 aquisition should be the same but as you can see in figure 3 the first two pulse are correct but the other ones are different.
    Attachments:
    pic1.bmp ‏2305 KB
    pic2.bmp ‏2640 KB
    pic3.bmp ‏2305 KB

  • How to connect external trigger PCIe-1433?

    I am having an issue getting the external trigger to work using a cameralink camera, a PCIe-1433 card and a signal generator.  The signal generator is connected to the SMB connector on the 1433 card and is providing a 20 Hz signal with a 20ms pulse width at TTL voltages (0-4V).  From memory, we are using the MAX software and under the Acquisition tab I have CC1 set to external, however the camera is not receiving this external trigger.
    I've attached a rough diagram of our setup.
    What could my issues be?  My thoughts are:
    1) Are there other settings in MAX I need to ensure?  I know the SMB connector can be an input or an output.  How can I make sure this is set to input?
    2) My input signal is 0-4V which is TTL, but does the signal need to be 0-5V?
    Any thoughts would be greatly appreciated.  Thank you.
    Attachments:
    ExternalTrigger.jpg ‏29 KB

    Hello tuckturn
    Thank you very much for getting in touch with us. 
    1)  In Measurement and Automation Explorer, the default is an input.  You would need to use LabVIEW to change the SMB connector to be an output. Can you please show me a screenshot of your camera attributes in Measurement and Automation Explorer.
    2)  Where does this input signal come from?  Do you have a 5V TTL compliant output to test this?  Can you please provide me the specification for whatever device is outputting the voltage?
    Thanks again.
    Sincerely,
    Greg S.

  • [Question] PCI-6220: digital level at the pause of a continuous impuls train with external trigger

    Hallo,
    I'm trying to use a PCI-6220 card to generate a continuous impuls train which will be paused at an external trigger. I've used the example code in the example library to generate the impuls train. The idle state of the impuls train is set to be high. But I figure that die digital level at the pause is sometimes high and sometimes low. I suppose that the level stays at the exact time when the pause begins?
    Is my assumption correct? Is there any way to let the impuls always pause at the idle state, like it will then be paused after a full impuls is finished? Any tips or links will help. Thanks in advance.
    Wei

    Yes your assumption is right. The output is latched to the last set value.
    If you are generating the pulse through the counter,  setting the Idle state in Create Virtual Channel.vi   doesnt help?

  • PCI 4472 external trigger source

    Dear All,
    I have a PCI-4472B which I want to program in order to acquire a signal from channel 0 whenever it recives a TTL signal throw the External Trigger input.
    I'm using a modified example but I don't know which is the name of the external trigger source. I always recive this kind of error (for example if I connect a string containing "EXT_TRIG"):
    code: "-200265"
    "DAQmx Start Task.vi:1<append>
    <B>Property: </B>Start.AnlgEdge.Src
    <B>Corresponding Value: </B>EXT_TRIG
    <B>Task Name: </B>_unnamedTask<DB>"
    The program I'm using is of this form:
    First of all, does this error mean that I didn't input the right external trigger source name?
    If so, which is the right name of the external trigger source for NI4472B?
    Thank you for help
    Solved!
    Go to Solution.

    Hello there,
    The error pops up because there is no channel named EXT-TRIG. If you are receiving a trigger from channel 0, I think the best way is to specify the channel name in the `DAQmx Start Task`.  There is a terminal where you can specify the channel name and use that name as an string input for the trigger. I think this should solve the problem. 
    I refered from this knowledge base. 
    http://ae.natinst.com/public.nsf/webPreview/BEBB10D02D72798A8625736B0076B09A?OpenDocument
    Also, seems like you have `start analog edge` trigger. Since you want to get TTL signal, why not try `start digital edge` trigger? 
    Regards,

  • How to externally trigger the execution of TestStand with a start and abort button through a digital interface?

    Hello,
    I'm Currently evaluating TestStand as an alternative for an in-house developed Test Sequencer.
    To start our own Test Sequencer we use a small box, connected to a DIO board. The box has a start button and an abort button. The box also has a pass, a fail and a running led.
    The interface with this box is made via some digital lines of a PCI-DIO-96.
    In our own Test Sequencer we have groups named Init, Run, Abort, Exit.
    The Init group is executed at startup (only once). It is used to initialize all the HW and SW. -> I guess this is the Pre UUT Loop callback in TestStand.
    The Exit group is only executed once at the end of the day when the application is terminated. It is used to free all the used hardware and cleanup all the resources. This probably is the Post UUT Loop Callback in TS.
    When a product needs to be tested, the operator presses the "start" button which triggers our own Test Sequencer and the run and abort group are being executed (first the run group, afterwards the abort group).
    When the product is being tested the "running led" of the little box lights up to indicate to the operator that the application is running. (only when the run and abort group are running)
    The Run group has all the functional tests in it. (MainSequence)
    The abort group is used to put everything back in it's original state after the test on this single product is done. (Post UUT)
    When executing the tests and something goes wrong (operator gets stuck in a clamper, ...) the operator can still press the abort button and then the execution immediately jumps from the currently executing step in the run group to the first step of the abort group. So, when something goes wrong, immediately the abort group is called.
    At the end of the run and abort group, if no errors occured, the "pass led" lights up. If one or more steps went wrong the "fail" led lights up.
    This setup can also be used to test multiple product in parallel. At that time all the different parallel testers have such a small box which contains a "start" and "abort" button and a pass, fail and running led. (it is possible that they are all connected to the same PCI-DIO-96 board. )
    My question:
    Is it possible to do something similar like this in Teststand? If yes, is there an example available that shows me how to do this in TestStand? (externally trigger the execution of TestStand)
    Typically, in the Init group (Pre UUT Loop) the digital interface box gets initialised.
    In the Close group (Post UUT Loop) the digital interface box is taken out of scope.
    Note: The PCI-DIO-96 board to which the digital interface box is connected will also be used in the rest of the developed application (MainSequence, ...)
    What's really important for me is that I can create a process model that all the application developers in our organisation can use. I really don't want any of the application developers (limited software experience) to mess around in all the features of TestStand.
    For them it's important that they just add the function DigitalInterfaceBoxInit () in the Pre UUT Loop Callback and the DigitalInterfaceBoxClose () in the Post UUT Loop Callback, and then everything works!
    It is important that the appliation developers do not have to create any global variables, other functions, synchronisations, parallel sequences, ... in TestStand. All this needs to be done with a simple call to the DigitalInterfaceBoxInit function.
    Thanks in advance for all the help!
    Best Regards,
    Dennis Vanotterdijk
    [email protected]

    Dennis-
    Your application sounds very well suited to TestStand's abilities. I am also quite impressed with your knowledge of how TestStand's architecture is arranged when you are still just considering whether or not to use it.
    I think that TestStand would work really well for you in this application. Like you mentioned it will provide you with a form of standardization for your application developers to work from. It also provides the flexibility for you to add your custom routines in many different places. TestStand also makes parallel and batch testing much easier in TS 2.0 so that you could develop one test for your product and execute different instances of it in parallel to test multiple products at once.
    As for your specific question about how to c
    ontrol TestStand using a DIO board. I think this is very feasible and should not be too difficult. Since TestStand provides you the ability to create a custom operator interface your operator interface could monitor the status of your DIO board and launch/abort executions based on the read values. Usually the executions are launched/aborted when a button on the GUI is pressed however, I do not see any thing different about basing the action on a DI signal vs a mouse click. I am sure your application is more involved than this high level description but from the sounds of it I think it is very possible to do with TestStand.
    Based on my experience of building test systems with TestStand and your description of the application, I would feel very confident in using TestStand to achieve all the goals you mentioned. If you have further detailed questions on how one of your features might be implemented, feel free to contact one of our Application Engineers or email us at www.ni.com/ask
    and we would be glad to help you.
    Best regards,
    Richard McDonell
    National Instruments

  • Data-acquisition with NI 6036E DAQ card & GPIB using an external trigger

    Hi all,
    I hope somebody could give me some help with the following and answer some questions:
    Simple system description:
    Labview 6.1
    PCI-GPIB card
    6036E DAQ card
    In my system, I am using an external analog trigger signal (A) for continuous data-acquisition. Characteristics of the analog trigger signal (A) are: ~40 Hz, signal height +1.48V, triggered by rising edge (the analog trigger signal (A) could be changed to a TTL signal). Each data-acquisition is done within ~1.0 ms after the rising edge of the trigger pulse. The timing of the data-acquisition and analyzing procedure is controlled by execution in a sequence structure placed in a loop.
    Now, I connected a power meter to the system, to measure the laser power during the data-acquisition. The power meter has two options to provide the laser power data:
    a) via analog signal output (voltage corresponds to laser power in watts)
    b) via GPIB (direct output reading of laser power in watts).
    Problem:
    During a certain point in my data-acquisition sequence structure (defined by a frame), I want to use the next occuring analog trigger signal (A) to acquire 1 value from the power meter.
    How do I do this in Labview programming for the following two situations?
    a) If I connect the analog output from the power meter to an analog input channel of the 6036E DAQ card. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    b) If I use the GPIB connection of the power meter. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    An other possibility would be to trigger the power meter directly, so it outputs constantly power meter values at ~40 Hz. How could I than acquire 1 power meter value (at a certain time im my sequence structure) via analog input at DAQ card or GPIB?
    Additional questions:
    How do I configure the PFI0/Trig pin on the 6036E DAQ board individually as an INPUT?
    How do I use an analog trigger signal (A) as counting signal for a loop, or as an activation signal for a sequence structure which includes GPIB commands?
    It would be very nice if somebody could give me some help.
    Kind regards,
    beam

    Hi beam,
    I just want to verify that I understand your situation correctly:
    An external trigger signal (A) is wired to one of your input channels (e.g. CH0) to trigger data acquisition of a second channel (e.g. CH1). Your power meter is connected to an analog input channel, which you would like to trigger with a certain rising edge at some of your sequence structure.
    Problem:
    During a certain point in my data-acquisition sequence structure (defined by a frame), I want to use the next occuring analog trigger signal (A) to acquire 1 value from the power meter.
    How do I do this in Labview programming for the following two situations?
    a) If I connect the analog output from the power meter to an analog input channel of the 6036E DAQ card. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    If a task has been configured to acquire signal from one analog channel, it's not possible to run a second analog input task or to add a second channel on the fly. You had mentioned that it's possible to read from the instrument through GPIB. Is it possible to perform a software trigger such that at a certain frame of your structure, when the trigger signal A reaches voltage "x", a GPIB command is written to your power meter to query a measurement reading?
    Additional questions:
    How do I configure the PFI0/Trig pin on the 6036E DAQ board individually as an INPUT?
    You do not need to explicitly configure the PFI0 line as an input. If you want to use it as an input such that it acts as an analog trigger, simply wire the trigger signal to this pin. When configuring the trigger in your software, specify PFI0 as the trigger source.
    How do I use an analog trigger signal (A) as counting signal for a loop, or as an activation signal for a sequence structure which includes GPIB commands?
    You can try using the Limit VI to find out when the trigger signal reaches a certain level, and count how many times this level is reached. Similarly, you can use this as the condition to execute GPIB commands.
    Hope this helps,
    Lesley

  • Ai acquisition external trigger rate in windows 2000/xp

    I'm doing repetitive measurements of the type described in the nidaq example DAQsingleBufExtTrig.C:
    iStatus = DAQ_Rate(dSampRate, iUnits, &iSampTB, &uSampInt);
    iStatus = DAQ_Start(iDevice, iChan, iGain, piBuffer, ulCount, iSampTB, uSampInt);
    while ((iDAQstopped != 1) && (iStatus == 0))
    iStatus = DAQ_Check(iDevice, &iDAQstopped, &ulRetrieved);
    When using a 100 Hz external trigger, the above code can be repeated at nearly 100 Hz on our various ni hardware (PCI E-series and a DAQCard-1200) under windows 95/98/me, using appropriate parameters. Under Windows 2000 but otherwise identical conditions, the best rep rate I can do is in the low 40s. I wouldn't have been too surprised if the roles of (2000/xp)
    and (9x/me) were switched, but as it is I don't know why this is happening. Any ideas are welcome.

    Hello;
    As you are reconfigure the hardware at each end of the buffer, you will become system dependent. The maximum speed that you can go will vary from machine to machine even.
    The way to go about that, is to set up a retriggerable Analog Input operation, which is hardware controlled. By doing that, you will become completely system independent, and will be able to run your application in any sort of machine/OS.
    I'm attaching a ANSI C example that does the trick.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments
    Attachments:
    SimulateRetriggerScan_Eseries.zip ‏5 KB

  • How to connect external trigger PCIe1427

    Hi,
    We are working with PCIe 1427 frame grabber and a IR camera with Cameralink Standard. Our camera has got asynchronous reset at CC3, so we have given external trigger 2 in NI MAX and successfully able to grab the video. But we need to implement the same using Labview application, so tried to use imaq configure trigger3, imaq trigger drive VI's and unsuccessful in resetting the camera and grabbing video.
    We are using IMAQ 4.9 driver and Vision development module with Labview development suite 2013 SP1.
    Kindly provide any solutions.
    with regards,
    Sri 

    Hi all,
    Any suggestion in this regard.

  • External trigger for internal event

    Hello,
    I would like to use an external trigger on a PFI-line to trigger an
    internal event, e.g. the switch of an indicator on the front panel from
    "1" to "2".
    How do I do that?

    Thanks for your answer!
    The problem was that I wanted to use a PFI-line on a PCI-board
    (BNC-2110) from NI to trigger the start of a voltage output task. On
    the other hand, I wanted to use the same trigger event for stopping a
    while-loop which would otherwise abort the task after some seconds if
    the trigger didn't come; the data generation itself is rather long, so
    you have to set the "timeout" terminal of "DAQmx Wait Until Done" to "
    -1". The problem was that it is not possible (at least on this board)
    to use a digital in-line for triggering the task and the PFI-line for
    getting a digital input. So I splitted the signal up: it was weird to
    both lines and worked as trigger on the PFI and was monitored on a
    DI-line.
    This setup worked, but as there were still some problems, I changed it
    again. Now I check for some digital in-lines (which provide a stimulus)
    in a while-loop while waiting for the trigger; if the stimulus changes,
    the task (which is waiting for the trigger) is aborted. The problem is
    that if the stimulus doesn't change and the task is triggered as usual
    and is completed, I can't report that fact to the while loop! So the
    while-loop goes on and blocks the rest of the diagram. I just wrote
    another posting concerning that thing, if you would have a look... It
    can be really a little hard sometimes, can't it...
    This thing concerning the event structure and value (signaling) sounds
    interesting, I'm just trying to figure out the possibilities how to use
    an event structure; but it's not always really intuitive.
    Best regards,
    Mitja
    Message Edited by Mitja on 11-14-2005 07:09 PM

  • How can I get started if I am not an advanced user but still want to config ATS660 external trigger?

    There r 2 groups VIs provided by the company: easy VIs and advanced VIs. And set external trigger VI is in the latter one. The manual indicates that only the person who r very familar with the ATSApi Application Programming Interface should attempt using the Advaced VIs. Unfortunately I am not that kind of advanced user. If I want to learn all these stuff(like how to call the VIs in correct order), how can I get started?
    I will be really appreciated if I can get some help here.  all I have now is the ATS660 User Manual and ATS-VI Software Manual. I wonder if there should be other useful manuals, like NI-DAQ user manual that can help to understand how to call/config the device in right order.
    Thank u in advance.
    Dyna----an eager learner

    ya, u r right. That was what happened to me.
    The company is Alazartech. This is a PCI waveform digitizer.
    I've visited the www.alazartech.com , and found no further info about how to call this subVIs in correct order. So I am asking here , hope that any one is familiar with this stuff.
    Anyway, thank u for ur reply.
    I will keep focusing here and expecting some replies.
    Dyna

  • 4472 external trigger source name

    Dear All,
    I have a PCI-4472B which I want to program in order to acquire a signal from channel 0 whenever it recives a TTL signal throw the External Trigger input.
    I'm using a modified example but I don't know which is the name of the external trigger source. I always recive this kind of error (for example if I connect a string containing "EXT_TRIG"):
    code: "-200265"
    "DAQmx Start Task.vi:1<append>
    <B>Property: </B>Start.AnlgEdge.Src
    <B>Corresponding Value: </B>EXT_TRIG
    <B>Task Name: </B>_unnamedTask<DB>"
    The program I'm using is of this form:
    First of all, does this error mean that I didn't input the right external trigger source name?
    If so, which is the right name of the external trigger source for NI4472B?
    Thank you for help

    Hi tooooommi,
    would you mind expanding the error message? I cannot see the entire message and there should be more information about the error that we can use to solve it.
    Also, have you tried connecting another Physical Channel control (like the one that you connect to the AI Voltage function) to the Start Analog Edge function? That may allow you to browse to find the right source for your analog trigger.
    Let me know, so I can try to help you further. Best,
    Corrado Degl'Incerti Tocci
    Application Engineer

  • Externally trigger binned counting

    Hi,
    I have a PCI-6221 and am trying to achieve the following.  I've tried searching and found similar questions, but nothing exactly the same, so apologies if I have overlooked a previous answer.
    What I would like to do is count total pulses per 100 µs for some fixed period of time, say 100 ms.  The start of the 100 ms total measurement period should be triggered by an external signal which is much slower, e.g. 1Hz  This is as I need to sum multiple mesurement events as follows, where the time bins given are times after the trigger signal and each measurement is triggered by the external signal.
    Measurement     0-100µs  100-200µs    200-300µs   etc.
           1                    2                1                0
           2                    1                2                1
           3                    2                1                1
           4                    0                1                0
        total                  5                5                2
    If I could get the rolling total for each measurement that would also be fine, I can subtract each time bin from the previous in software.  The previous example using this method would therefore be:
    Measurement     0-100µs  100-200µs    200-300µs   etc.
           1                    2                3                3
           2                    1                3                4
           3                    2                3                4
           4                    0                1                1
        total                  5                10              12
    I have looked at previous answers such as http://forums.ni.com/ni/board/message?board.id=40&​message.id=2056&query.id=1096458#M2056 and whilst I converted that to a finite number of measurements OK, I couldn't work out how to set it to digitally trigger without errors.  I'm using LabView 7.1.
    Thanks very much, I hope that this was clear.
    Alex

    I haven't fully fleshed out this idea, but here it is in a think-out-loud form.
    I'm assuming you don't have clocked analog output in your app, and will lean on using an AO task solely for its clock.
    Here's the idea:
    1. One of your counters is set as a retriggerable single pulse generator.  Let's say it's CTR0.  Use the external ~1Hz signal as its trigger, and set it up to generate a single pulse with a 100 msec high time and a minimal low time.  You'll need a DAQmx property node to make it retriggerable.
    2. Configure an AO task to generate at 10 kHz, corresponding to your 100 microsec bins.  Configure it to be pause triggered by the output of CTR0.  Thus, the AO generates samples at 10 kHz, but only while CTR0 output is high (for 100 msec).  You'll have to write a buffer of analog values to generate, but it can just be an array full of 0 voltage, and you don't have to wire that output to anything either.
    3. Configure your other counter, CTR1, for period measurement.  This may be tricky to configure with DAQmx property nodes, but ultimately you'll need to treat your pulses of interest as the timebase for the measurement while using the AO sample clock as the signal to be measured.   That sounds backwards, but the effect will be to store the number of your pulses of interest that occur between AO clock edges.  You will need to research "duplicate count prevention" to make sure that 0 values get buffered properly.
    I *think* that sort of arrangement could work.  About every second, you get an external trigger.  That trigger causes CTR0 to generate a single pulse with a 100 msec high time.  Your AO task generates a clock pulse every 100 microsec, but only during the 100 msec when CTR0 is high.  Each of those AO clock pulses buffers a value for your CTR1 period measurement.  This should produce a measurement buffer like the first one you listed.
    4. (Simpler Alternative) Configure CTR1 for simple counting.  Use DAQmx Timing.vi to specify the use of the AO Sample clock, and specify your external pulses of interest as the signal to measure.  By default, LabVIEW will expect to see those pulses at CTR1's default SOURCE pin.  This arrangement should produce a measurement buffer like the second one you listed, though you may still need to research "duplicate count prevention" to make sure that gets set up right.
    5. I can't help but think there's another way to do this without the AO stuff, but nothing's coming to me now.
    -Kevin P
    Message Edited by Kevin Price on 02-01-2010 02:19 PM

  • NI PCI-6542: Creating Dynamic Waveforms Using the HSDIO Library

    Hello!
    I am having problems understanding how to create waveforms using the HSDIO library to run on my PCI-6542 board. I need to create a program that turns one channel on for 12.5 microseconds, waits a set amount of time(i.e. 100 samples),  and turns another channel on for 12.5 microseconds.
    This program is to be used in a phased array ultrasonic system.
    Below is the Dynamic Generation example program that turns channels 0 - 2 on for 1024 samples.
    * Example Program:
    * DynamicGeneration.c
    * Description:
    * Generates a simple pattern on specified channels.
    * Pin Connection Information:
    * None.
    /* Includes */
    #include <stdio.h>
    #include <limits.h>
    #include "niHSDIO.h"
    /* Defines */
    #define WAVEFORM_SIZE 1024
    int main(void)
    ViRsrc deviceID = "Dev1";
    ViConstString channelList = "0-2";
    ViReal64 sampleClockRate = 50.0e6;
    ViInt32 dataWidth = 4;
    ViUInt32 waveformDataU32[WAVEFORM_SIZE];
    ViConstString waveformName = "myWfm";
    ViInt32 timeout = 10000; /* milliseconds */
    ViSession vi = VI_NULL;
    ViStatus error = VI_SUCCESS;
    ViChar errDesc[1024];
    ViInt32 i;
    /* Initialize generation session */
    checkErr(niHSDIO_InitGenerationSession(
    deviceID, VI_FALSE, VI_FALSE, VI_NULL, &vi));
    /* Assign channels for dynamic generation */
    checkErr(niHSDIO_AssignDynamicChannels (vi, channelList));
    /* Configure sample clock parameters */
    checkErr(niHSDIO_ConfigureSampleClock(
    vi, NIHSDIO_VAL_ON_BOARD_CLOCK_STR, sampleClockRate));
    /* Query the Data Width Attribute */
    checkErr(niHSDIO_GetAttributeViInt32(
    vi, VI_NULL, NIHSDIO_ATTR_DATA_WIDTH, &dataWidth));
    /* Populate waveform with ramp data */
    for (i = 0; i < WAVEFORM_SIZE; i++)
    waveformDataU32[i] = i;
    checkErr(niHSDIO_WriteNamedWaveformU32(
    vi, waveformName, WAVEFORM_SIZE, waveformDataU32));
    /* Initiate generation */
    checkErr(niHSDIO_Initiate(vi));
    /* Wait for generation to complete */
    checkErr(niHSDIO_WaitUntilDone(vi, timeout));
    Error:
    if (error == VI_SUCCESS)
    /* print result */
    printf("Done without error.\n");
    else
    /* Get error description and print */
    niHSDIO_GetError(vi, &error, sizeof(errDesc)/sizeof(ViChar), errDesc);
    printf("\nError encountered\n===================\n%s\n", errDesc);
    /* close the session */
    niHSDIO_close(vi);
    /* prompt to exit (for pop-up console windows) */
    printf("\nHit <Enter> to continue...\n");
    getchar();
    return error;
    Questions:
    How can I change the values in waveformDataU32 to create off and on states(instead of just always on)?
    How do I select the channel that waveformDataU32 is applied to?
    Thanks!
    Zachary Geier
    Solved!
    Go to Solution.

    The waveformDataU32 array is an array of 32 bit integers. Each bit corresponds to a line on the device.  So on the first clock cycle, this program outputs:
    0000 0000 0000 0000 0000 0000 0000 0000
    Then it outputs the following, changing on each clock pulse:
    0000 0000 0000 0000 0000 0000 0000 0001,
    0000 0000 0000 0000 0000 0000 0000 0010,
    and so on all the way up to 1023:
    0000 0000 0000 0000 00000011 1111 1111
    In the example you include at the bottom, you are setting the least significant bit (LSB) to zero and one, effectively only changing one line on the output. To change all of the lines, you should use 4,294,967,295 or 0xFFFFFFFF instead:
    for (i = 0; i < WAVEFORM_SIZE; i++){
    if(i < 200){ //If sample number is less than 200
    waveformDataU32[i] = 0; //Turn off channels 0-2
    else{
    waveformDataU32[i] = 4,294,967,295; //Else turn on all channels for 800 samples
    -Jim B
    Applications Engineer, National Instruments
    CLD, CTD

Maybe you are looking for