06-02-2006 10:03 AM
"An unhandled win32 exception occurred in VB6.EXE"
Here is my C Code:
Public Declare Function DAQmxWriteDigitalU32 Lib "nicaiu.dll" (ByVal taskHandle As Long, ByVal numSampsPerChan As Long, ByVal autoStart As Long, ByVal timeout As Double, ByVal dataLayout As Long, ByVal writeArray As Long, ByRef sampsPerChanWritten As Long, ByRef reserved As Long) As Long
I put breaks in my VB code and it gets that error when trying to execute the DAQmxWriteDigitalU32 function.
Any Ideas??
06-02-2006 11:23 AM
Hi krstn-
The DAQmxWriteDigitalU32 function requires an unsigned 32-bit integer datatype which VB6 does not support. I would suggest that you use the DAQmxWriteDigitalLines function instead. Have you considered using the VB6 type library that ships with the current version of NI-DAQmx? It would prevent you from having to recreate a lot of this work yourself. Examples of how to use the .tlb are installed in \Program Files\National Instruments\NI-DAQ\Examples\Visual Basic 6.0
Hopefully this helps-
06-02-2006 01:08 PM
I tried using the DAQmxWriteDigitalLines function instead and it gave me:
"Attempted to Write digital data that is not supported"
is there any way around this?
I am using the 6534
06-05-2006 11:30 AM
Hello krstn127,
Have you looked at the Digital Output example for VB6? It installs at C:\Program Files\National Instruments\NI-DAQ\Examples\Visual Basic 6.0\Digital\Generate Values\Write Dig Chan. It uses the DAQmxWriteDigitalLines function and works with the NI 6534.
The error you are experiencing generally indicates that you are attempting to write more or less data than the number of lines you have specified. I think if you look at the example and compare it to your code, you will be able to find the problem.
Let us know if you have additional questions.
Regards,
Laura