krstn127
2006-06-02 15:10:10 UTC
Hi,
I got the following C code working, and am trying to convert it to use in my Visual Basic 6.0 program. I get the following error:
"An unhandled win32 exception occurred in VB6.EXE"
Here is my C Code:
int32 error=0; TaskHandle taskHandle=0; uInt32 data[8]={5,4,5,4,5,4,5,4}; char errBuff[2048]={'\0'};
DAQmxErrChk (DAQmxCreateTask("",&taskHandle)); DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines)); DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"OnBoardClock",300000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000)); DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,8,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)); DAQmxErrChk (DAQmxStartTask(taskHandle));
In my VB code I have a Public Declare statement for the Write Function:
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??
I got the following C code working, and am trying to convert it to use in my Visual Basic 6.0 program. I get the following error:
"An unhandled win32 exception occurred in VB6.EXE"
Here is my C Code:
int32 error=0; TaskHandle taskHandle=0; uInt32 data[8]={5,4,5,4,5,4,5,4}; char errBuff[2048]={'\0'};
DAQmxErrChk (DAQmxCreateTask("",&taskHandle)); DAQmxErrChk (DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines)); DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"OnBoardClock",300000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000)); DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,8,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)); DAQmxErrChk (DAQmxStartTask(taskHandle));
In my VB code I have a Public Declare statement for the Write Function:
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??