public ListenerBoard(int boardNo) { BoardNo = boardNo; var fValue = new float[3]; ushort wTotalBoard = 0; var result = UniDAQ.Ixud_DriverInit(ref wTotalBoard); if (result != 0) { throw new ApplicationException("Error initializing driver"); } result = UniDAQ.Ixud_GetAIBuffer(0, 3, fValue); if (result != 0) { throw new ApplicationException("Buffer error"); } result = UniDAQ.Ixud_StartAI(0, 0, UniDAQ.IXUD_BI_20V, 10, 3); //10 Hz, 3 samples per call if (result != 0) { throw new ApplicationException("Error of data acquisition"); } }
public float[] ReadBuffer() { float[] fValue = new float[3]; var result = UniDAQ.Ixud_GetAIBuffer(0, 3, fValue); //float fValue = 0.0F; //result = UniDAQ.Ixud_ReadAI(0, 0, 0, ref fValue); return(fValue); }