triggering event

NOR dear Experts:

I use NEITHER-DAQmx ANSI C to develop software to acquire an analog signal by PCIe-6351.  The sample clock is generated internally, which will be sent to trigger a transducer. The sample clock rate is about 4 Hz. I'll acuqire believes over data on each digital trigger, which is redeclenchables. The snippet of code like this:

DAQmxCreateTask("",&taskHandle);
DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL);
DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000);
DAQmxCfgDigEdgeStartTrig(taskHandle,"/Dev1/PFI0",DAQmx_Val_Rising);
DAQmxSetStartTrigRetriggerable(taskHandle,1);

DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,1000,0,EveryNCallback,);

However, I need to save data from RS232 to each trigger starts exactly who needs to synchronize with the recording of the analog signal.

So my question is how can I get each startup trigger event or recall or read the timestamp of each trigger early?

Thank you very much.

Hello

Below I've linked to a Knowledge Base that will give you a few options to get a timestamp in a C environment.

http://digital.NI.com/public.nsf/allkb/354468202721D85D8625759F004B0357

-Jake B.

Tags: NI Products

Similar Questions

  • Triggering event for different loop

    Hi all

    I'm working on an application that uses the architecture of producer/consumer.

    In the loop of producer I collect the data of my H/W, and in the loop of consumer, I did it.

    the loop of producer has structure of the event which can also be triggered using buttons on the front panel.

    Now, he has a record button on the front panel that will begin to record incoming data in the file. and the Structure of the event by taking care of recording loop of producer.

    Now how can I raise the event Record in the loop of the producer of the loop of consumer?

    Thank you

    Ritesh

    Or, you can just write the Value property (signage) for the button (assuming that it is the event that you treat a user pressing the button).

  • The triggering event programmatically

    My front panel has two buttons and two digital indicators.  By clicking on a button increments the value of the corresponding indicator.  I would like to than Button2 to increase his meter and the shutter Button1.ValueChanged.

    In other languages (ie: VB.NET), I can raise an event manually (ie: myBtn.PerformClick)

    What is the standard way / best practices to programmatically trigger an event (in my case, a close button value change event) in LabVIEW?

    As described in many other positions, you use the Value property of a signalling.

  • triggering event for the time of day

    I'm trying to put in place a system that requires taking several samples per day at the fire time (at irregular intervals) and then repeat it every day for a week or two. So far, I have tried to use a TimeStamp control array, but I'm not getting much. Does anyone has any ideas on how to do it, or can point me to an example that I missed in my research.

    Thank you

    So what I would do, is create a loop of events with a single event - a timeout. Conduct of this event would be a picture of the time when an action should be performed. The loop starts, remove the first item and subtract the current time of the time goal. This will give you the time in seconds before the event. Multiply by 1000 to get the number of milliseconds before the time runs out. Feeding this value for the time-out. Then each timeout event fires of time, of the index to the next item and calculate a new delay.

    Mike...

  • Triggering events contextual FocusLost?

    I just added a button in a panel that has a textArea that raises an event when his accent is no longer. I want to activate the focusLost event when you press the button again and when it is pressed. I would like to add the event to the listener from the first box, except that it is activated only when the text box has some text in there, but the other button is always enabled. Is it possible that I can get what I want? I can do something else if need be.
    package sscce;
    
    import java.awt.BorderLayout;
    import java.awt.KeyboardFocusManager;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.WindowConstants;
    
    public class SSCCE
    {
        JButton     leftButton     = new JButton("Right Button");
        JButton     rightButton     = new JButton("Wrong Button");
        JTextArea     text            = new JTextArea("My SSCCE", 5, 15);
        
        public SSCCE()
        {
            final JFrame frame = new JFrame("SSCCE");
            final JPanel p[] = { new JPanel(), new JPanel() };
            text.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
                null);
            text.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
                null);
            text.addFocusListener(new TextAreaListener());
            leftButton.addActionListener(new LeftButtonListener());
            rightButton.addActionListener(new RightButtonListener());
            p[0].add(text);
            p[1].add(leftButton);
            p[1].add(rightButton);
            frame.add(p[0], BorderLayout.CENTER);
            frame.add(p[1], BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            frame.setLocationRelativeTo(null);
            frame.setSize(300, 300);
            frame.setVisible(true);
            text.requestFocus();
        }
        
        public static void main(final String args[])
        {
            new SSCCE();
        }
        
        public class LeftButtonListener implements ActionListener
        {
            @Override
            public void actionPerformed(final ActionEvent e)
            {
                System.out.println("This button is supposed to have the listener "+
                        "fire. It is contextually disabled.");
                text.requestFocus();
            }
        }
        
        public class RightButtonListener implements ActionListener
        {
            @Override
            public void actionPerformed(final ActionEvent e)
            {
                System.out.println("This button is not supposed to have the "+
                    "listener fire. It is always enabled.");
                text.requestFocus();
            }
        }
        
        public class TextAreaListener implements FocusListener
        {
            @Override
            public void focusGained(final FocusEvent arg0)
            {
                // TODO Auto-generated method stub
            }
            
            @Override
            public void focusLost(final FocusEvent arg0)
            {
                System.out.println("This is the event that fires on textArea "+
                "focusLost.");
            }
        }
    }

    an action is enabled or not ;-) If as modelled action corresponds to your needs, refine the model.

    Your turn :-)
    Jeanette

  • passing parameters to functions triggered event

    Hi all
    I created a button and added EventListener.
    as mybutton.addEventListener (MouseEvent.CLICK, clickSt);
    When I apply the clickStart function (event: MouseEvent) I'd like to
    an array, a string to the function as parameters. How can I do this.
    is it possible or not.
    thanx.

    Well, not this way.
    The function automatically receives a parameter when you create a reminder with this 'addEventListener' function, this parameter is datatyped as the event type that you defined in the callback, in your case "MouseEvent". If you want to pass more data when the function is called so you have create your own event class because almost all of the events just inform when something happened and send limited information. You can consult the documentation on creating a custom event class, there is a lot of info on the subject.

  • Triggering an event running log

    I am the object of an initiation by fire trying to get new programming up until I can pass the training, so this may be an easy answer.  I keep a diary of text of triggered events, as this VI will run for several hours and did not have a person observing constantly.  An example would be:

    Power of 10:00 on

    Valve 10:05 A at Position 2

    10:10 tension triggered TCD on 0.5 V, fill routine

    The big difference I see between the examples I found my code, it's that I want to call from various points along which will be a very big piece of code, and most of these loops shift register are all able to be inside of the loop.  I am trying to use a trigger of change in value, but may not know how to get the whole thing in a loop to trigger.  The part of the code I'm getting is attatched-am I close?  Going on that's totally wrong?  Thanks for the tips!

    While butt that the loop will never execute until the end of the upper loop, that is to say, data flow. He expects the Boolean value to return from the loop at the top of the page.

    Events using a queue or user to send stuff to your second loop, the val property signs are not recommended, causes a switch to the user interface thread.

    Finally, you send a command to the serial port and immediately check a response. Most of the instruments series I've used are slow and require a small wait before being ready for a response. Is your instrument sent a stop character, if so use it and just put a wait on playback, no need to query the bytes.

    See you soon,.

    McDuff

  • generate the event user triggers two events structure

    Hello

    I would like to generate a while a user event that triggers events in two or more loops loop event.

    I have attached a non-fonctionnel project VI, so easier to show what I would understand.

    My experience is that user generated event cause that a case of Structure of the event, not both. Why? What if I want the two loops of the event that will be raised? How can you make with the user event?

    Maybe someone could explain this a bit deeper?

    Thank you very much!

    Kind regards

    PS. : new problem with forum upload file...

    So here's the VI in my dropbox:

    https://DL.dropboxusercontent.com/u/8148153/draft_to_show.VI

    Classic mistake.

    You need TWO 'register for events', the output of each class to a separate structure of the event.  Then it won't work.

  • Popup event on table not triggered

    With the help of Jdev PS4.
    Consider this example: http://www.yonaweb.be/ContextualEvent.zip

    (I know this example can be simplified using master / detail in the data control, but it's to illustrate the example)

    I have two taskflows: EmployeeTF and departmentTf.
    The idea is to raise an event when I select a new record in the department table.
    This is the link of the tree:
     <tree IterBinding="DepartmentsIterator" id="Departments">
          <nodeDefinition DefName="model.views.DepartmentsView" Name="Departments0">
            <AttrNames>
              <Item Value="DepartmentId"/>
              <Item Value="DepartmentName"/>
              <Item Value="ManagerId"/>
              <Item Value="LocationId"/>
            </AttrNames>
            <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
              <event name="changeTheDept"
                     customPayLoad="${bindings.DepartmentId.inputValue}"
                     eventType="Currency Change Event"/>
            </events>
          </nodeDefinition>
        </tree>
    I created a custom java class to use as a control data to find out when the event fires. This is my code:
        public void handleEvent(Object payload){
            System.out.println("Event handler");
            System.out.println(payload);
        }
    When I select a record in the table, the event does not get fired.

    So as a test, I added my own custom method to see if contextual events work properly so I added this method to my domain controller:
        public void triggerEvent(){
            System.out.println("triggering event");
        }
    and added on a commandLink to the DepartmentTF. I also added an event on this topic:
    <methodAction id="triggerEvent" RequiresUpdateModel="true"
                      Action="invokeMethod" MethodName="triggerEvent"
                      IsViewObjectMethod="false" DataControl="EmpBean"
                      InstanceName="EmpBean.dataProvider">
          <events xmlns="http://xmlns.oracle.com/adfm/contextualEvent">
            <event name="triggerEvent"
                   customPayLoad="#{bindings.DepartmentId.inputValue}"/>
          </events>
        </methodAction>
    When I raise this event, my event handler called on the employee taskflow.

    So my question is:
    (1) is that the row change event is not raised a normal behavior?
    (2) if so, how to raise or what is the purpose of this event?

    Published by: Yannick Ongena on May 28, 2012 21:03

    Yannick,

    This bug 10045872. The ' fix by ' current is set to 11.1.1.6

    Here is a work around: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/68-contextual-event-table-selection-262503.pdf

    Frank

  • structure of the event + while loop

    Hello, I am trying to understand how to unite two while loops in attached VI for half a day

    The first loop creates a state machine solid which reacts on each key and runs one of the structure cases. (that part works very well)

    The second loop, always generates the random number, but it stops the generation during the time where one of the structure cases events are executed. (this is the part ticky)

    Any suggestions?

    If you want your random number to stop so that the user triggered events are running, you should be able to simplify your design a lot.

    It can be done with a loop using the case of timeout.

  • How to activate the module message once per trigger event?

    I use the action to display a message and possibly send emails when a triggering event occurs, say that a temperature exceeds a limit.  Currently when a product (high TTL of a pre/post trigger) trigger module action continues to produce messages every minute in the message window, continues to send messages to the log file and would continue to send emails every minute if I had the Active Messaging module.  I wish I had the messgae displayed once.  Any help would be appreciated and thanks.

    You must use Rising Edge to the event, not TTL high. It has an automatic hysteresis because it seems to change from low to high, not only from top.

  • Picture of the events of clusters - change value and the mouse down

    Hello everyone

    I am facing a problem of triggering events using two arrays of clusters.

    I have two paintings of clusters: A and B. There is a Boolean control within each group and to maintain the two paintings in clusters at the same index value (indexVals), the vertical scroll bar of A is hidden but the vertical scroll bar of B is visible. I was using a case with 3 cases triggered by structure: the mouse down, timeout and the mouse upwards. The case of "mouse down" feeds of terminal 1, which makes the case "timeout" the waiting period. The case of "timeout" continues to fuel terminal 1 timeout and has two property nodes (one for A and for B) makes the value of B indexVals is written on the indexVals of a. inside the case of "mouse up" it has a value of-1 for the terminal timeout, putting an end to the process. OK, it was working great. But...

    Now I need to keep the same procedures described above, but I need to raise an event when the user clicks any boolean (led) change state. I thought about the event "change value", but when I click on the led to trigger the event of "change value", the "mouse down" event is also triggered.

    Any suggestions?

    The real VI is a little different from what I described, but the problem is exactly the same.

    Thank you

    Dan07

    Like this:

  • Events unregistering on a cluster without Unregistering for all dynamic events

    Hello everyone

    I've been playing with dynamic event record but I hit a problem.

    Normally if I want to stop triggering events on a single control I will be wire constant ref with the correct type in the registry for block of events. This means that I don't have to use the unregister for events block and then rebuild the entire events list to registry when I only want to stop the events on a control.

    However, if I try to bring together a group of the refs (which cannot necessarily be of the same type) in a cluster then I can no longer cancel the events on this cluster registration from the register of events work a group of control constants.

    An alternative would be to use an array instead of a cluster, but this has two disadvantages: it does not create a case of dynamic event for each Member of the array and all controls must be the same type or they are co-erced to a more generic control class.

    I've attached an example VI (labVIEW 2011 SP1)

    I think I finally get the problem now.

    You need feed two references in separately.  You can cluster the registry OUT for events, I know, but I don't think that what you want will work.  You know that you can enter the tables in a table instead of a cluster, right?

    Shane.

    PS to be clearer.

    Register to activate your button separately from the rest.  Save all your "to be marketed" references - individually, not clustered - in a second 'register to events' and then together the two outputs (with the Save refnums event) before passing into the structure of the event.  You might have what you want.  So big cluster AFTER signing up, not before.

  • Write multiple events created for a single value (signaling)

    Hello

    I have a program that checks continuously to check if a given amount of time has passed (e.g. 10 seconds). I pass the Boolean result to a case statement. In the case of FALSE, do nothing. Inside the case TRUE I wired the switch entry dealing with a property node: Val (Sgnl) in order to trigger an event. The actual value is not important, I just use it to trigger an event.

    When you view the event inspector window, I see two events are sometimes created at the same time, which causes problems in the rest of my code. I have the option 'max limit Instances"checked in the menu change events, as well as the number of Instances the value 1.

    Can someone please explain why this is happening and recommend a solution?

    Thank you.

    -Natsfan

    Add a wait of 1-2 ms to the loop in your main calendar.  It is conceivable that the loop takes less than 1 ms to run and you see the same time at two subsequent iterations of your loop and that's why you get sometimes two close triggered events

    I would not use a separate at all, but directly control the timing of the event timeout.

  • untriggerred event(e-fgv)

    Hi guys,.

    I have questions about triggering events of efgv (functional global variable of event, I don't know if it's the standard name that people use... haha). We discovered that efgv is quite handy. But the more we use it, we realized that certain events are not triggered.

    I created a (Test EFGV.vi) VI for you guys to run it. Basically, there are 1 headband that will trigger the event 50 times and supposely any events on the various nodes must be triggered to 50 times more. However, when you run the VI, each triggered loop iteration will be different. The VI loop 1 trigger and 4 loops to-be-triggered, even with what we normally do on our application: 1 will trigger many.

    However, there is also efgv that 1 is designed to be the trigger of 1 to 1. And I realized that the problem occur again but much less frequent. For example the previous project we have intermittent problem on this point, where, in a month, the efgv was not triggered only once.

    Anyone know why this is happening? What I did wrong with the program? Hope you guys can help me on this...

    Thank you...

    You may not use the same event record refnum among several event structures.  Each needs its own thread for reference.

Maybe you are looking for