Beispiel #1
0
        public static void SetAttribute(ImaqdxSessionHandle session, string name, ImaqdxEnumAttributeItem value)
        {
            Debug.Assert(session != null, "The session parameter cannot be null.");
            Debug.Assert(!session.IsInvalid, "The session parameter must be a valid handle.");
            Debug.Assert(name != null, "The name parameter cannot be null.");

            ImaqdxEnumItem enumItemValue = value.EnumItem;
            int            status        = NiImaqdxDll.IMAQdxSetAttribute(session, name, ImaqdxAttributeType.Enum, enumItemValue);

            ExceptionBuilder.CheckErrorAndThrow(status);
        }
Beispiel #2
0
        public static ImaqdxEnumAttributeItem[] EnumerateAttributeValues(ImaqdxSessionHandle session, string name)
        {
            Debug.Assert(session != null, "The session parameter cannot be null.");
            Debug.Assert(!session.IsInvalid, "The session parameter must be a valid handle.");
            Debug.Assert(name != null, "The name parameter cannot be null.");

            uint count;
            int  status = NiImaqdxDll.IMAQdxEnumerateAttributeValues(session, name, null, out count);

            ExceptionBuilder.CheckErrorAndThrow(status);
            ImaqdxEnumItem[] enumItemArray = new ImaqdxEnumItem[count];
            status = NiImaqdxDll.IMAQdxEnumerateAttributeValues(session, name, enumItemArray, out count);
            ExceptionBuilder.CheckErrorAndThrow(status);

            ImaqdxEnumAttributeItem[] enumItems = new ImaqdxEnumAttributeItem[count];
            for (int i = 0; i < count; i++)
            {
                enumItems[i] = new ImaqdxEnumAttributeItem(enumItemArray[i]);
            }
            return(enumItems);
        }
Beispiel #3
0
 public static extern int IMAQdxSetAttribute(ImaqdxSessionHandle id, string name, ImaqdxAttributeType type, ImaqdxEnumItem val);