LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What are the values for DAQmx_Dev_CI_TrigUsage?

Could someone tell me what the values of DAQmx_Dev_CI_TrigUsage correspond to when calling DAQmxGetDeviceProperties in CVI 8.0.1?  The NI-DAQmx Reference does not list the values.

Thanks,

Mark
0 Kudos
Message 1 of 9
(4,250 Views)
Hi Mark,

The DAQmx_Dev_CI_TrigUsage values correspond to the triggers that will work for a counter output task.

This explanation is located in DAQmx C reference help.  Under NI-DAQmx C Properties »  List of  Device Properties
 
Indicates the triggers supported by this device for an counter input task.

Please let me know if you have any further questions regarding this issue.

Have a marvelous Monday,

Michael

Applications Engineering
National Instruments
0 Kudos
Message 2 of 9
(4,230 Views)
Hi Michael,

I understand what DAQmx_Dev_CI_TrigUsage means.  If you go to DAQmx C reference help, under NI-DAQmx C Properties »  List of  Device Properties
, you will see that that no corresponding values are listed.  For example, in my program I call DAQmxGetDeviceProperties("Dev1", DAQmx_Dev_CI_TrigUsage, &triggerUsage) in a callback function, and the output I get is 2.  I need a list of what 0,1,2,... correpond to.

Thanks,

Mark
0 Kudos
Message 3 of 9
(4,223 Views)
"DAQmxGetDeviceAttribute" is the function I meant above (not the nonexistent "DAQmxGetDeviceProperties").
0 Kudos
Message 4 of 9
(4,224 Views)
The output value from the function call is an OR-ed value of the following bits that are defined in the header file:

DAQmx_Val_Bit_TriggerUsageTypes_Advance
DAQmx_Val_Bit_TriggerUsageTypes_Pause
DAQmx_Val_Bit_TriggerUsageTypes_Reference
DAQmx_Val_Bit_TriggerUsageTypes_Start
DAQmx_Val_Bit_TriggerUsageTypes_Handshake
DAQmx_Val_Bit_TriggerUsageTypes_ArmStart

If 0 is returned, that means no trigger type is supported.
0 Kudos
Message 5 of 9
(4,194 Views)
I see the lines you're referring to now in the NIDAQmx.h file, but you have to be more specific when you say it's an OR-ed value of the above defined bits.  I'm not sure how an OR operation helps unless the integer output is telling me what is not supported.  If you're comparing some value from the device to all possible supported triggers, wouldn't an AND operation be more appropriate?  Actually, what is being compared by OR?  In summary, there's at least one step you're leaving out and I'm still not sure to what a value of 2 (or anything that isn't 0) corresponds.

Thanks,

Mark
0 Kudos
Message 6 of 9
(4,183 Views)
Hey Mark,

Looking at the NIDAQmx.h file you can see the following code.

DAQmx_Val_Bit_TriggerUsageTypes_Advance  (1<<0) // Device supports advance triggers

DAQmx_Val_Bit_TriggerUsageTypes_Pause    (1<<1) // Device supports pause triggers

DAQmx_Val_Bit_TriggerUsageTypes_Reference(1<<2) // Device supports reference triggers

DAQmx_Val_Bit_TriggerUsageTypes_Start    (1<<3) // Device supports start triggers

DAQmx_Val_Bit_TriggerUsageTypes_Handshake(1<<4) // Device supports handshake triggers

DAQmx_Val_Bit_TriggerUsageTypes_ArmStart (1<<5) // device supports Armstart triggers

The 0 through 5 refer to how far to the left the one will be bit shifted.  Idp referred to it being Or-ed and all that means is that you could have a one at all these bits.  So if you are getting an output of two, then in binary your output is

00000010

This would correspond to you having pause triggers supported.  If you can give me some more information about the device you are using then I could let you know if this is expected behaviour. 

Have a great day,
Michael D
Applications Engineer
0 Kudos
Message 7 of 9
(4,164 Views)
Your explanation is exactly what I was thinking, which is why it's confusing to me.  I'm using a PCI-6259 with two counter channels.  I was under the impression from the NI 625x spec sheet that at least start, reference, and pause triggers were supported for this device.  I've been trying to configure triggering and I keep getting errors.  Maybe this is a clue why.  I'd love to hear any information you may have to share.

Thanks,

Mark
0 Kudos
Message 8 of 9
(4,157 Views)
Hi Mark,

I have gotten your card and seen the same behavior you were describing.  I looked into the issue a bit more and the only trigger type that a counter task will support is the pause trigger.  I found that I was able to get the same implementation as a start trigger out of the pause trigger as long as I thought about how the application was setup.  Those triggers types are supported for other task types, if you switch to an analog input task you would see that the result of the DAQmx_Dev_AI_TrigUsage value gives a 12.  This means your card is fine, and the best way to proceed is trying to use a pause trigger to implement your application.  A pause trigger works like a gate.  Please let me know if you need further help related to what this function has been outputting.

Have a great day,

Michael D

Applications Engineering
National Instruments
0 Kudos
Message 9 of 9
(4,136 Views)