Hi all, I am using Delphi to build an application to run my DAQ device through the DAQmxBase driver. I am loading the routines exported from NICAIU.DLL. The routine DAQmxBaseCreateAIVoltageChan is failing to execute, returning error code -50251, extended error "Specified software component is not available. The component was not loaded" I am declaring the routine in my code as: function DAQmxCreateAIVoltageChan(TaskHandle:TTaskHandle; PhysicalChannel: Pointer; NameToAssignToChannel: Pointer; TerminalConfig: int32; MinVal: float64; MaxVal: float64; Units: int32; CustomScaleName: Pointer): int32; stdcall; external 'NICAIU.DLL'; and I am calling as: DAQmxCreateAIVoltageChan(AITask, Buffer, nil,DAQmx_Val_Diff,MinInput,MaxInput,DAQmx_Val_Volts, nil); All the variables I have already used in other routine calls with no error. The only thing I am not sure in the call as above is the use of the nil constant as the equivalent in ANSI C of the null array of Char, but the error message does not seem to be related to this sort of error. I would appreciate if someone could give me hint as how to overcome this problem. Thanks in advance
Hi optoguru Please find attached the zip file comprising the NIDAQload.pas unit which directly imports the DAQmx routines from the NICAIU.DLL (check for this dll at \Windows\System32) and the unit ExpSetup.pas which uses the former unit to call the routines. The NIDAQload unit includes the IntializeFPU and Restore FPU routines which solves the problems with the error -50251. Notice that the NIDAQload is a translation from the C include file supplied by NI and although all the constants declarations have been translated to Delphi, some of the declarations of functions I did not use in my code have not been translated and are still commented in the file. If you need any of these latter you can translate them using similar declared routines as template. All the routines I am using in my code are working fine, but be aware that I have not tested all the routines declared in NIDAQload.pas. If you find any bug or if I can be of any further help just let me know.