예제 #1
0
        /// <summary>
        /// 配置串口通信的数据位数
        /// </summary>
        /// <param name="databits">
        /// 串行通信数据位数,取值范围:5-8
        /// </param>
        /// <returns>
        ///  返回值:0,配置成功,负数,配置失败
        /// </returns>
        public int ASLSeDATAtBITS(int databits)
        {
            int state;

            state = ClassVisa.viSetAttribute(g_i32VisaIO, ClassVisa.VI_ATTR_ASRL_DATA_BITS, databits);
            return(state);
        }
예제 #2
0
        /// <summary>
        /// 配置串口的奇偶校验位
        /// </summary>
        /// <param name="parity">
        /// 输入变量:奇偶校验类型
        /// ClassVisa.VI_ASRL_PAR_NONE - 0  - No parity bit exists,
        /// ClassVisa.VI_ASRL_PAR_ODD  - 1  - Odd parity should be used,
        /// ClassVisa.VI_ASRL_PAR_EVEN - 2  - Even parity should be used,
        /// ClassVisa.VI_ASRL_PAR_MARK - 3  - MARK  Parity bit exists and is always 1,
        /// ClassVisa.VI_ASRL_PAR_SPACE - 4  - SPACE Parity bit exists and is always 0.
        /// </param>
        /// <returns>
        /// 返回值:0,配置成功,负数,配置失败
        /// </returns>
        public int ASLSetPARITY(int parity)
        {
            int state;

            state = ClassVisa.viSetAttribute(g_i32VisaIO, ClassVisa.VI_ATTR_ASRL_PARITY, parity);
            return(state);
        }