Using triggers with software timing

Hello
I'm using the PCI-6259  M
series multifunction DQ board on a linux box (SLES 10.2) and am using
the ansi_c api and the driver is NI KAL 1.4.  My application requires
10 analog inputs, 8 digital inputs 8 digital outputs and all 4 analog
outputs to interface with a piece of HW in real-time.  Currently I am
doing straight software timing meaning I am not using the
DAQmxCfgSampTiming call but am doing "on demand" sampling at a external hw
controlled 1 ms interval using the NI read/write api calls.  I use 4
NIDaq tasks (analog input/output,digital input/output).   I was
attempting to add a analog input trigger to my system to mark a specifi
event.  Here's what I want to do and after reading the NI documentation
I'm not sure I can accomplish this with the NI ansi_c API
I
want to keep the software timing mentioned above in place which is making simple DAQmxRead/Write calls at that above specified 1 ms interval.  I want to ADD to my analog input task a trigger event for APFI1 and assign to it
a callback function when the trigger condition occurs.  From the examples that
comes with the driver (Acq-IntClk-AnlgStart) it looks like the event callbacks are tied to the TASK NOT the trigger.   I don't see how I tie the event callbacks in the API to a specific trigger not the whole task.  I need to be able to access my other anlog inputs "on demand" but want my trigger to fire a callback when the trigger condition occurs.  Also if this is possible what is the latency between the hw event and the execution of the callback?
Kevin

This is a cross-post. See my reply here:
triggers using nidaq-mx
http://forums.ni.com/ni/board/message?board.id=250​&view=by_date_ascending&message.id=54949#M54949
Joe Friedchicken
NI VirtualBench Application Software
Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
Senior Software Engineer :: Multifunction Instruments Applications Group
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)

Similar Messages

  • Beginner timing program - triggering with photogates

    Hello, 
      I am attempting to create a program in which I can time the sprint time of runners that break photogates, which are connected to channels on the measurement device. The idea is that once the photogate is broken, there is a voltage trigger that begins a timer, and the timer stops once the the next photogate trigger is broken (another voltage trigger). I have something very basic attached in which if a voltage threshold is surpassed (from one channel), a time is taken, and then potentially when the next threshold is surpassed, another time is taken, and perhaps the two times can be subtracted, but I can't seem to make this work out of the program, thus it is not quite exactly what I am looking for. I am very new to LabView and I think the solution might be simple, but I can't seem to work it out. Could you give me any suggestions?
    Thanks for any help.
    Attachments:
    sprintspeed_timer2.vi ‏33 KB

    For the program to do what you want you only have to have it remember all the times it triggered - in my example I used a shift register with an array for that.
    There are a few things to be aware of (maybe more than I'll think of now):
    1. Windows is not a real time OS - your measurement may be off by a couple of microseconds. If it has to be exact doing the timing in software will not suit you.
    2. If you can live with that you still have to be careful with that timing VI. It counts to 2^32 - 1, and then it starts over. That might happen during the time you want to take.
    Regards Florian
    Attachments:
    sprintspeed_timer2_array.vi ‏25 KB

  • The app store on my brand new ipod touch offers me majority apps that cannot be used on my software. how do i find apps that will work with 6.1.5? this is frustrating, especially when purchased brand new.

    the app store on my brand new ipod touch offers me majority apps that cannot be used on my software. how do i find apps that will work with 6.1.5? this is frustrating, especially when purchased brand new for christmas.

    See the following to purchase earlier, compatible version for iOS 6
    App Store: Downloading Older Versions of Apps on iOS - Apple Club

  • I bought a new imac running Loin and Office 2011. The server we use to access emails runs exchange 2003 and my IT person says the imac is not compatible with the server. The server does not want to let me access using any email software.

    I bought a new imac running Loin with Office 2011. I am the only mac in the office and the Server we use to access emails runs exchange 2003 and my IT person says the imac is not compatible with the server. The server does not want to let me access using any email software other than webmail access through our website. It looks as though 2011 is not compatible with 2003 per some searches online, but what are some options I have to gain full access again? I purchased parallels in hopes that this my help and I am able to use remote desktop connection to log on to server but can not drag and drop files I need. There is a shared drive on that Server we all use to exchange files.
    The two main issues are gaining access to my email again and ability to drag and drop files from mac to pc. I hope this is enough info to get some solutions.
    PS - IT person says my iMac's IP is what his server does not understand so that is why I can not login.

    Office 2011 is not compatbile with Exchange 2003.
    I suggest you post further Office related questions on Microsoft's own forums for their Mac software:
    http://answers.microsoft.com/en-us/mac

  • I have an old iPhone 3Gs with software version 4.3.5,  I am trying to use it again, and it works fine, but I have not been able to update the software.  Every time I try, I get the following message: "there was a problem downloading the software for the i

    I have an old iPhone 3Gs with software version 4.3.5,  I am trying to use it again, and it works fine, but I have not been able to update the software.  Every time I try, I get the following message:
    "there was a problem downloading the software for the iPhone, the network connection could not be established".  This happens even though I have a working internet connection.
    Besides that, all the other functions work properly, even synchronize apps and library.
    Will I be able to update the software?

    look around the forum tons of people repport that they can't update
    makes you suspect that apples update servers can't meet the depand of too many users
    trying to update at once

  • I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    Hi,
    You have 2 solutions:
    1 - You can use 2 differents icloud account
    2 - You use the same account but you don't sync yours contacts.
    You configure that in  Settings > icloud
    You activate or desactivate what you want.
    Have a nice day.

  • Hi All, I am using iphone in UAE and ipad in India usinging same apple id. Earlier I could do imessage  to my Ipad with different name but with  software update,I am unable to do, as signing id for the iphone and ipad is same.How to restore back

    Hi All, I am using iphone in UAE and ipad in India usinging same apple id. Earlier I could do imessage  to my Ipad with different name but with  software update,I am unable to do, as signing id for the iphone and ipad is same.How to restore back

    I believe because you migrated from a Nokia to an iPhone you need to register the Bn phone number with your Apple ID so it can be used for iMessage. The Pn number seems to be the only one registered
    Go here > https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Manage your Apple ID and see if that does the trick
    Hope that helps

  • HOWTO: Use BC4J With or Without DB Triggers

    This HowTo describes how to use BC4J, database sequences and triggers
    and what are the ramifications.
    INTRODUCTION
    BC4J has the ability to work with database sequences in order to obtain a
    unique value when inserting records. BC4J also has the ability to
    work either with a 'before insert' trigger which automatically creates
    a new unique value for the primary key or without a trigger. When not using
    a database trigger, BC4J also has the ability to obtain the sequence value
    and set the primary key value.
    Before discussing the ramifications of using one approach or the other, let's
    show examples of how to use both approaches:
    BC4J & sequences WITH a database trigger
    and
    BC4J & sequences WITHOUT a database trigger
    HOWTO DEMONSTRATION STEPS
    To illustrate both scenarios a simple database setup script is provided which
    creates two tables:
    CUSTOMER_NT which DOES NOT have a before insert trigger and
    CUSTOMER_WT which DOES have a trigger.
    Database Install Script:
    <code>
    drop trigger customer_insert_trigger;
    drop table customer_wt;
    drop table customer_nt;
    drop sequence customer_wt_seq;
    drop sequence customer_nt_seq;
    create sequence customer_wt_seq start with 1;
    create sequence customer_nt_seq start with 101;
    create table customer_wt(
    id number,
    name varchar2(30),
    constraint
    customer_wt_pk
    primary key (id)
    create table customer_nt(
    id number,
    name varchar2(30),
    constraint
    customer_nt_pk
    primary key (id)
    prompt Inserting data...
    insert into customer_wt (id, name)
    values (customer_wt_seq.nextval, 'Mickey');
    insert into customer_wt (id, name)
    values (customer_wt_seq.nextval, 'Goofy');
    insert into customer_nt (id, name)
    values (customer_nt_seq.nextval, 'Daffy');
    insert into customer_nt (id, name)
    values (customer_nt_seq.nextval, 'Porky');
    commit
    prompt Creating trigger
    create trigger customer_insert_trigger
    before insert on customer_wt for each row
    begin
    select customer_wt_seq.nextval into :new.id from dual ;
    end;
    </code>
    The next step is to create the DEFAULT Entity Objects and View Objects using
    the Business Components Wizard.
    USING BC4J WITH A DATABASE TRIGGER
    Let's modify the entity object CustomerWt so it can use the database trigger.
    Edit the entity object CustomerWt by right-clicking in the navigator.
    Click on the 'Attribute Settings' tab and edit the ID attribute.
    - Uncheck 'Mandatory'checkbox. This allows you to insert without a value for the primary key
    - Check 'Refresh after Insert'. This obtains the value from the database generated by the trigger.
    - Check 'Updateable While New'. Id is only updateable when inserting.
    Click finish to complete the wizard. Save all and recompile the project.
    Now let's test our work.
    In the navigator right-click the application module and select 'Test..'. This will launch
    BC4J's built in tester. Connect to the application.
    In the tester double-click the CustomerWtView view object to run a test edit form.
    After the edit form renders, navigate through the existing records using the navigate
    buttons on the edit form. Now let's insert a record to execute the trigger.
    click on the '+' button to insert a record. Enter a value in the 'Name' field and commit the change.
    Observe that a new value has automatically been inserted into the Id field.
    That's it! You have successfully used BC4J and a database trigger.
    Now let's try it without a trigger..
    USING BC4J WITHOUT A DATABASE TRIGGER
    Now edit the entity object CustomerNT so it doesn't need a database trigger.
    Similar to before, edit the entity object CustomerNt by right-clicking in the navigator.
    Click on the 'Attribute Settings' tab and edit the ID attribute.
    - Uncheck 'Mandatory'checkbox.
    - Check 'Updateable While New'.
    An additional step is also required. The Create method will have to be modified to extract
    the value of the sequence.
    In the Edit EntityObject Wizard click the Java tab and select Create method and click Finish.
    The create method is generated in your Java fil e. In the Workspace view of the Navigator,
    expand the CustomerNt entity object in the navigator. Double-click
    CustomerNtImpl.java to open it in the Source Editor. In the Structure pane, double-click
    create(AttributeList). Modify the Create method so it looks like this:
    <code>
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl s = new SequenceImpl("customer_nt_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue())); }
    </code>
    Save and compile the project.
    Now test the ViewObject CustomerNtView using the tester as before.
    In the edit form of CustomerNTView click on the '+' to insert a record. Observe that
    just as before a new value has automatically been inserted in the ID field!
    TO USE A DB TRIGGER OR NOT TO USE A DB TRIGGER.
    Using a Database trigger sometimes preferable if you have non BC4J applications
    also sharing the database. In this case it is still safest to just let the database
    update it's own primary keys.
    If you don't have any other non-BC4J applications sharing the database, then not using
    a database trigger is perfectly acceptable and can have slightly better performance.
    The important thing to remember is that the option is yours to use either approach!
    null

    Thank you for the reply Jonathon. I am using a ViewObject which
    consist of several tables. I haven't tried the DB trigger
    approach but just using the BC4 approach in overriding the
    create method.
    Here is the parent class create as a part of the
    FasNameImpl.java file which does the job correctly.
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl l_seq = new SequenceImpl
    ("SEQ_CUSTOMER_ID",getDBTransaction());
    Integer l_next = (Integer)l_seq.getData();
    setCustomerId(new Number(l_next.intValue()));
    This is when I triedpassing the value to the child table. But I
    can't figure it out. I think the link is working fine if I had a
    ViewLink deployed but it doesn't look like it's doing the job
    for ViewObject.
    I am trying to call the childclass.method
    (FasCustomer.setCustomerId(l_next);
    But I am getting error.
    Thanks a lot for your suggestions,
    Kamran
    703 696 1121

  • HT1349 I don't have an Apple product. I accidentally signed up for iCloud because I thought I could use it with my iTunes on my PC. Now it won't go away. I have deleted the software but every time I open iTunes it demands I reopen my iCloud session. Help.

    I want to get rid of iCloud. I do not currently have an Apple product but thought I could use it with iTunes and my PC. I have deleted the software. I told iTunes to take it off my account, but every time I open iTunes there it is again, asking me to log into iCloud. I can't get Apple support because I don't have an Apple product. I don't know how to get rid of this!

    This is for a Mac, but may be similar for a PC.
    How-to: Safely delete an iCloud account from your Mac or iOS device
    http://9to5mac.com/2013/07/13/how-to-safely-delete-an-icloud-account-from-your-m ac-or-ios-device/
     Cheers, Tom

  • When I connect my Iphone 5 to sync with my Itunes on my PC I get a message- This Iphone cannot be used because required software is not installed.  Run Itunes installer to remove itunes then install itunes again.

    When I connect my Iphone 5 to sync with my Itunes on my PC I get a message- This Iphone cannot be used because required software is not installed.  Run Itunes installer to remove itunes then install itunes again.

    After uninstalling and reinstalling Itunes- issue was fixed.  Thanks!

  • Can i use airport with other software than itunes?

    I have my living room speakers connected to my Airport Express.
    I can listen to my iTunes music playing it on my MacBook Air and I can use my iPhone to control it with Remote App.
    But I can't use any other software to send sound to my speakers through Airport Express.
    Is there a way to tell my computer to send all sound to Airport Express, e.g. listen to music from Youtube in my livingroom speakers?
    Thanks!

    I believe Airfoil can do that...

  • Is quality better with software for converting VHS to DVD than using an actual converter?

    Is quality better with software for converting VHS to DVD than using an actual converter?

    Not sure what you mean by "actual converter".
    If you mean if you just played a VHS tape to a DVD recorder and recorded like that... You will get close to the quality of the VHS.
    If you have a good capture software and hardware you might be able to clean the video and audio up. But VHS is pretty limited in quality.

  • My Canon MG4150 printer won't connect. Im using OS X10.7 which says is compatible. Its identifies via USB and says downloading, but then comes up with software unavailable error.

    My Canon MG4150 printer won't connect. Im using OS X10.7 which says is compatible. Its identifies via USB and says downloading, but then comes up with software unavailable error. Any ideas?

    Hi Pebbles2313,
    It sounds like you have an issue with your printer software. You may find some of the software necessary to run your printer through the following link:
    OS X: Printer and scanner software available for download - Apple Support
    http://support.apple.com/en-is/HT201465
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • My Canon MG4150 printer won't connect. Im using OS X10.7 which says is compatible. Its identifies via USB and says downloading, but comes up with software unavailable error.

    My Canon MG4150 printer won't connect. Im using OS X10.7 which says is compatible. Its identifies via USB and says downloading, but then comes up with software unavailable error.

    Try downloading the driver directly from Canon's web site.

  • Can i use Stored procedures and triggers with SDK

    hi all
    How to use the stored procedure and Triggers with SDK, can i get a sample code
    Regards
    Salah

    Hi, Salah.
    Use "Exec" in your query to run procedures.
    SAPbobsCOM.Recordset     oRS;
    oRS = (SAPbobsCOM.Recordset)pCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
    oRS.DoQuery ("EXEC YourStoredProcName");
    Triggers are not supported in SDK.
    Regards,
    Aleksey

Maybe you are looking for