示例#1
0
        private static void ThrowError(NISwitchExecutiveHandle handle, int code, string errorMessagePrefix = null)
        {
            int    codeFromGetError;
            string errorString = GetError(handle, out codeFromGetError);

            throw new DriverException(errorString, code);
        }
示例#2
0
        public static NISwitchExecutiveHandle CreateFromCHandle(IntPtr handle, bool ownsHandle)
        {
            NISwitchExecutiveHandle switchHandle = new NISwitchExecutiveHandle(ownsHandle);

            switchHandle.SetHandle(handle);
            return(switchHandle);
        }
示例#3
0
        internal static bool HasErrorClearIfDoes(NISwitchExecutiveHandle handle, int status)
        {
            bool hasError = HasError(status);

            if (hasError)
            {
                ClearError(handle);
            }
            return(hasError);
        }
示例#4
0
        private static string GetError(NISwitchExecutiveHandle handle, out int errorCode)
        {
            int size = 0;

            niSE_GetError(handle, out errorCode, null, out size);
            var msg = new StringBuilder();

            if (size > 0)
            {
                msg.Capacity = size;
                niSE_GetError(handle, out errorCode, msg, out size);
            }
            return(msg.ToString());
        }
示例#5
0
 private static extern int niSE_OpenSession(string resourceName, string options, out NISwitchExecutiveHandle instrumentHandle);
示例#6
0
 private static extern int niSE_GetError(NISwitchExecutiveHandle vi, out int errorCode, StringBuilder errorDescription, out int errorDescriptionBufferSize);
示例#7
0
 private static extern int niSE_GetAllConnections(NISwitchExecutiveHandle vi, StringBuilder routeSpec, out int routeSpecSize);
示例#8
0
 private static extern int niSE_ExpandRouteSpec(NISwitchExecutiveHandle vi, string spec, ExpandOptions expandOptions, StringBuilder expandedRouteSpec, out int expandedRouteSpecSize);
示例#9
0
 private static extern int niSE_IsConnected(NISwitchExecutiveHandle vi, string spec, out ushort isConnected);
示例#10
0
 private static extern int niSE_ConnectAndDisconnect(NISwitchExecutiveHandle vi, string connectSpec, string disconnectSpec, long multiconnectMode, long operationOrder, ushort waitForDebounce);
示例#11
0
 private static extern int niSE_DisconnectAll(NISwitchExecutiveHandle vi);
示例#12
0
 private static extern int niSE_Disconnect(NISwitchExecutiveHandle vi, string spec);
示例#13
0
 private static extern int niSE_Connect(NISwitchExecutiveHandle vi, string connectSpec, long multiconnectMode, ushort waitForDebounce);
示例#14
0
 private NISwitchExecutive(NISwitchExecutiveHandle sessionHandle, string resourceName, string options)
 {
     _sessionHandle = sessionHandle;
     _resourceName  = resourceName;
 }
示例#15
0
        internal static void ClearError(NISwitchExecutiveHandle handle)
        {
            int notUsed;

            GetError(handle, out notUsed);
        }