AnsweredAssumed Answered

How to work with trigger programmatically?

Question asked by antonk on Sep 12, 2016

I'm looking for a way to call some trigger functionality in C++/COM code. I've spent quite a while looking through all the IIvi* com interfaces for IIviScope, IIviDriver, etc as well as AgilentInfiniium driver sources, but still I cannot figure all the functionality I need. I work with a few scopes, e.g DSO-X 3xxx, DSO9xxxx, DSO7xxxx.


Below is the code, which I've done (to share the approach to know it's correct) and not done (to ask how to do it). I assume that my scope pointer is created and initialized, like this:

IIviSessionFactory factory(__uuidof(IviSessionFactory));

IIviScopePtr scope = factory->CreateDriver(my_scope_logical_name); // the name created beforehand in NI MAX

scope ->Initialize(my_scope_logical_name, VARIANT_FALSE, VARIANT_FALSE, ""); // Why should I use the same name again?


Here they are:

1 Arming the scope:
scope ->Measurements->Initiate();  // This works OK, but why it's so different with setting the scope to run mode?


2 Setting scope in run mode:

scope ->Measurements->Abort(); // Otherwise the next line fails

scope ->Measurements->Continuous = VARIANT_TRUE; // This works OK, but can I make it simpler?


3 Force trigger (actually I need to press the Force Trigger button programmatically)

scope->Trigger->??????  // I don't know how to do it. Please help me. Thank you