Jump to content

Get list of available triggers from DAQmx


Sparc

Recommended Posts

If you are setting up a task in NI-Max, on the "Triggering" tab, if you select "Digital Edge" from "Trigger Type" on the right a new control will appear and let you select from a list of choices like "/Dev1/PFI1".

How can you programmatically get a list of these values?

I know that list of type "DAQmx Terminal" from the "I/O -> DAQmx Name Controls" LabVIEW pallet. It's also known as "NI Terminal" in the floating help window.

The "DAQmx Terminal" control does not have a property node for this, nor does it have an invoke node. The DAQmx function pallet has property nodes for channels and physical channels, but not one for terminals.

I know it can be done in LV. The question is can mere mortals do it. I submit "\Program Files\National Instruments\MAX\Assistants\DAQ Assistant\plugIns\triggering.llb\DAQmxAssistant_subGetAvailableTriggerSources.vi" as evidence. Too bad this VI won't open in any version of LabVIEW I have (7.1, 8.0, 8.2.1, 8.5).

Thanks for your help.

Link to comment

I'd prefer to do this with just LabVIEW but the NationalInstruments.DAQmx .NET assembly has this:

DaqSystem.Local.LoadDevice("<device name>").GetTerminals()

Which returns the information I'm looking for.

Anybody have anything better?

[Edit: Add following error information]

Great. Guess what happens when you try to use GetTerminals() twice?

Error 1172 occurred at Error calling method

NationalInstruments.DAQmx.Device.GetTerminals

of ObjectId handle: 0x759114C

for obj 0x2086D77[Device]

in domain [LabVIEW Domain for Run]

and thread 3176,

(System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

Inner Exception: System.InvalidOperationException:

You may only create one instance of a type of Query List once during the lifetime of your application.

) in Device Terminals using dotNet.vi

Works fine the first time. The second time it throws this error. Its great if you only have one device. Not so great if you have more than one (as even changing the Device name doesn't help).

VI attatched in LV 8.5.

Download File:post-1232-1225849484.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.