Hi There,
I have some older VB6 code that calls the tradional DAQ driver
directly. I'm looking to transfer it to .NET and I'd like to know the
equivalent code in C#.NET. I've been searching around and haven't had
much luck yet. Hopefully someone can help me. Here's my old code in VB6:
iStatus% = Timeout_Config(iDevice%, lTimeout&)
iRetVal% = NIDAQErrorHandler(iStatus%, "Timeout_Config", iIgnoreWarning%)
iStatus% = DIG_Grp_Config(iDevice%, iGroup%, iGroupSize%, iPort%, iDir%)
iRetVal% = NIDAQErrorHandler(iStatus%, "DIG_Grp_Config", iIgnoreWarning%)
iStatus% = DIG_Block_PG_Config(iDevice%, iGroup%, 1, 1, -3, 2, 0)
iRetVal% = NIDAQErrorHandler(iStatus%, "DIG_Block_PG_Config", iIgnoreWarning%)
iStatus% = DIG_DB_Config(iDevice%, iGroup%, iDBModeON%, iOldDataStop%, iPartialTransfer%)
iRetVal% = NIDAQErrorHandler(iStatus%, "DIG_DB_Config", iIgnoreWarning%)
iStatus% = DIG_Block_In(iDevice%, iGroup%, piBuffer%(0), ulCount&)
iRetVal% = NIDAQErrorHandler(iStatus%, "DIG_Block_In", iIgnoreWarning%)
and then it makes the following call to read data in a loop:
iStatus% = DIG_DB_Transfer(iDevice%, iGroup%, piHalfBuffer%(0), ulPtsTfr&)
iRetVal% = NIDAQErrorHandler(iStatus%, "DIG_DB_Transfer", iIgnoreWarning%)
So as far as I'm understanding it, it's setting up some config stuff,
timeouts, etc, sets up a group to look at, and tells DAQ that it wants
to transfer half the read buffer into piHalfBuffer%(0). I'd like to do
the same thing in .NET. So far all I've found is code that creates say
a DigitalMultiChannelReader and ReadMultiSampleMultiLine methods. So a
sample at a time from the lines. Is there code that dumps have the
buffer to a buffer variable in DAQmx, like it does in the above
traditional DAQ code?
Thanks,
Chris