03-03-2009 06:58 AM
(I was advised to repost this on this forum rather than the general LabVIEW forum.)
Has anybody used Traditional DAQ in Visual C Sharp? I'm trying to do change detection digital input and burst mode digital output with a PCI-6533 (PCI-DIO-HS32). I'd appreciate any pointers from someone who's been there.
Before you ask, "why not use DAQmx?", testing with LabVIEW shows that DAQmx fails with some PCI-6533 cards (but not all, and only on a certain model of computer), for burst writes of 20 or greater samples (-200560 error), but Traditional DAQ works correctly.
I'm trying to configure a digital output control as follows:
axCWDO1.AllowRegeneration = false;
axCWDO1.AutoSelectProgressInterval = false;
axCWDO1.ChannelString = "0:1";
axCWDO1.Continuous = false;
axCWDO1.Device = 1;
axCWDO1.ExceptionOnError = false;
axCWDO1.Handshake().AcknowledgeModifyAmount =
CWDAQControlsLib.CWDIOAckModifyAmounts.cwdioAckAmt500ns;
axCWDO1.Handshake().AcknowledgeModifyMode =
CWDAQControlsLib.CWDIOAckModModes.cwdioAckModeDelay;
axCWDO1.Handshake().AcknowledgePolarity =
CWDAQControlsLib.CWDIOPolarities.cwdioActiveHigh;
axCWDO1.Handshake().ClockReverse = true;
axCWDO1.Handshake().RequestPolarity =
CWDAQControlsLib.CWDIOPolarities.cwdioActiveHigh;
axCWDO1.Handshake().SignalMode =
CWDAQControlsLib.CWDIOSignalModes.cwdioSignalBurst;
axCWDO1.NPatterns = SamplesToWrite;
axCWDO1.ProgressInterval = 0;
int Err = axCWDO1.Configure();
At this point, Err is -10459 (The NI-DAQ DLL could not be called due to an interface error.)
If I comment out all the configuration stuff and just call Configure(), I get I dialog box with the following:
System.Runtime.InteropServices.COMException (0x800A28A1): Configuring handshaking
The specified device is not a National Instruments product, the driver does not support the device (for example, the driver was released before the device was supported), or the device has not been configured using the Measurement & Automation Explorer.
I get this error even if I close Visual Studio, reset the Traditional DAQ driver in MAX, and close MAX before running my program.
The card in question is a PCI-6534. In MAX, this card shows up as Device 1 under Traditional DAQ.
I'm running DAQmx 8.9.0f1, and Traditional DAQ 7.4.4f7.
I'm using Visual Studio 2008 under WinXP SP3.
Thanks.
03-04-2009 10:15 AM
RonW,
Thank you for posting on the NI Forums. We don't really have any examples for using C# and T-DAQ. I was able to find this KnowledgeBase document, found here, that mentions it is "Possible" but not designed to work natively. It suggests using Active X controls to perform data acquisition, when looking at your code it looks as though that is what you are trying to do I was able to find one example in the Developer Zone, but it uses Measurement Studio, and I was not sure if you had Measurement Studio or not. That example can be found here.