02-23-2023 04:29 PM
I am using VS2019 and Measurement studio 2019 to try to control PXIe5172 Oscilloscope. As in any physical scope, there is two option for trigger: Normal and Auto (normally there is a Single option too)- these options also shows on the NI instrument SFP GUI as shown below. I am trying to find how to set these trigger modes in my code but am unable to find anything. after setting the TriggerType and TriggerSource. Why does NI make this so hard to find the information or I am missing something?
Thank you very much in advance
02-26-2023 06:36 PM
I eventually figure this out. It is not that clear so I have the solution here incase someone has the same question as I did.
I can't believe they hide it behind the "ScopeTriggerModifier" while everything else related to trigger is clearly identifiable by name such as slope, source and so on.
/// <summary>
/// Set trigger mode to either auto or normal
/// </summary>
/// <param name="triggerMode"></param>
/// <returns></returns>
public int SetTriggerMode(TriggerMode triggerMode)
{
switch (triggerMode)
{
case TriggerMode.Auto:
Pxie5172Scope.Trigger.Modifier = ScopeTriggerModifier.Auto;
break;
case TriggerMode.Normal:
Pxie5172Scope.Trigger.Modifier = ScopeTriggerModifier.None;
break;
}
return GetErrorCode();
}