예제 #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);
        }