Home > Back-end >  Help: cut with NIDAQmx nicaiu Delphi DAQmxCreateAIVoltageChan returns in a DLL - 200088 error
Help: cut with NIDAQmx nicaiu Delphi DAQmxCreateAIVoltageChan returns in a DLL - 200088 error

Time:10-13

The main application error code is as follows:
 
Procedure TForm1. Button1Click (Sender: TObject);
Var
TaskHandle: Longint;

IntErrCode: Integer;
The begin
//ErrorNULLPtr=$FFFCF064;
//ErrorInvalidDeviceID=$FFFCF1E4;//- 200220
//ErrorInvalidTask=$FFFCF268;//- 200088

//c: taskHandle 0 x6deb1cc0 void *
//Delphi: taskHandle 0 x6deb1cc0
//c: & amp; TaskHandle 0 x0012ff54 void * *
//Delphi: @ TaskHandle 12 f58c

IntErrCode:=DAQmxCreateTask (' @ TaskHandle);
Memo1. Lines. The Add (+ Format 'ErrCode:' (' % x '[intErrCode]));

//c: taskhandle=0 x6deb1cc0
//Delphi: deb1cc0 taskhandle $6//1844124864
FFFFFFFF////c: DAQmx_Val_Cfg_Default - 1 Default
//Delphi: DAQmx_Val_Cfg_Default=$FFFFFFFF
//c: 10348 c/286/DAQmx_Val_Volts Volts
//Delphi: DAQmx_Val_VoltageUnits1_Volts=$0000286 c

IntErrCode:=DAQmxCreateAIVoltageChan (taskHandle, 'Dev1/ai0', ' ',
DAQmx_Val_Cfg_Default, 10.0, 10.0, DAQmx_Val_VoltageUnits1_Volts, ");
Memo1. Lines. The Add (+ Format 'ErrCode:' (' % x '[intErrCode]));

end;

End.

When running DAQmxCreateTask intErrCode returns 0, is normal;
DAQmxCreateAIVoltageChan running to the calling function, the return to FFFCF268 intErrCode, namely: - 200088, I checked the, is reported to ErrorInvalidTask error, the prototype function declaration (XNIDAQmx. Pas) statement is as follows:
 unit XNIDAQmx; 

Interface
USES the
Windows, ActiveX, Classes, Graphics, StdVCL, Variants, SysUtils, XNIDAQmxCAPI_TLB;

//typedef void * TaskHandle;
//int32 __CFUNC DAQmxCreateTask (const char taskName [], TaskHandle * TaskHandle);
The function DAQmxCreateTask (taskName: PChar; TaskHandle: PLongint) : Longint; Stdcall; External 'nicaiu. DLL';

//int32 __CFUNC DAQmxCreateAIVoltageChan
//(TaskHandle TaskHandle, const char physicalChannel [], const char nameToAssignToChannel [],
//int32 terminalConfig, float64 minVal, float64 very much,
//int32 units, const char customScaleName []);
//DAQmxCreateAIVoltageChan (taskHandle, "the WLS - 13 bc5dc/ai0", "", DAQmx_Val_Cfg_Default, 10.0, 10.0, DAQmx_Val_Volts, NULL))
The function DAQmxCreateAIVoltageChan (taskHandle: Longint; PhysicalChannel: PChar;
NameToAssignToChannel: PChar; TerminalConfig: DAQmxInputTermCfg;
MinVal: Double; Very much: Double; Units: DAQmxVoltageUnits2; CustomScaleName: PChar) : Longint;
Stdcall; External 'nicaiu. DLL';

The function DAQmxCfgSampClkTiming (taskHandle: Longint; Source: PChar; Rate: Double;
ActiveEdge: DAQmxEdge; SampleMode: DAQmxAcquisitionType; SampsPerChan: Longint) : Longint; Stdcall; External 'nicaiu. DLL';
The function DAQmxStartTask (taskHandle: Longint) : Longint; Stdcall; External 'nicaiu. DLL';
The function DAQmxReadAnalogF64 (taskHandle: Longint; NumSampsPerChan: Longint; Timeout: Double;
FillMode: DAQmxFillMode; ReadArray: an array of double; ArraySizeInSamps: Longint;
SampsPerChanRead: Integer; Reserved: Pointer) : Longint; Stdcall; External 'nicaiu. DLL';

The function DAQmxGetErrorString (errorCode: Longint; ErrorString: PChar;
BufferSize: Longint) : Longint; Stdcall; External 'nicaiu. DLL';
The function DAQmxGetExtendedErrorInfo (errorString: PChar; BufferSize: Longint) : Longint;
Stdcall; External 'nicaiu. DLL';


Debugging for several days, I couldn't find the reason, please help to check the reason for the error, thank you,

CodePudding user response:

You should be not installed acquisition card, to see if your device under Dev1/ai0 if this error will quote this create wrong,
  • Related