| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | using System;using System.Collections.Generic;using System.Linq;using System.Runtime.InteropServices;using System.Text;using System.Threading.Tasks;namespace NNCapTest.API{    //采集配置参数    public struct st_ad_para_c    {        /// <summary>        /// dds频率 -无需配置        /// </summary>        ulong udds;        /// <summary>        /// 采样率        /// </summary>        ulong uSampleFreq;        /// <summary>        /// /窄带中心频率	DDC有效-偏移频率        /// </summary>        ulong uDDCFreq;        /// <summary>        /// 采样类型 0-ADC 1-DDC        /// </summary>        byte uSampleMode;        /// <summary>        /// 触发模式 0-内触发 1-外触发        /// </summary>        byte uTrigMode;        /// <summary>        /// 时钟源 0-内时钟 1-外时钟 2-外参考        /// </summary>        byte uClockSrc;        /// <summary>        /// 保留        /// </summary>        byte ures;        /// <summary>        /// 抽取倍数        /// </summary>        uint uExtTimes;    }    static class CapCore    {                private const string dllName = @"Api\CPC2007_ADCardx64.dll";        [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)]        public static extern IntPtr c_createdevice();        [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)]        public static extern int openDev_c(IntPtr ptr);        [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)]        public static extern int initDev_c(IntPtr ptr);        [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)]        public static extern int control_ad_para_c(IntPtr ptr, st_ad_para_c para, bool blSend = true);        [DllImport(dllName, CallingConvention = CallingConvention.Cdecl)]        public static extern int closeDev_c(IntPtr ptr);    }}
 |