LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anything need to be added to a dll that is not required in an executable to create a DAQmx task successfully?

Does anything need to be added to a dll that is not required in an executable to create a DAQmx task successfully? I have no problem making an .exe that creates a DAQmx task but I get floating point errors in DAQmxCreateAIAccelChan when I attempt to do this in a dll. One example is in the following autogenerated code.

/**************************************************************************/
/* WARNING: This file was automatically generated. Any changes you make */
/* to this file will be lost if you generate the file again. */
/**************************************************************************/
#pragma DisableUnreferencedIdentifiers
#include
#include

#define DAQmxErrChk(functionCall) {DAQmxError = (functionCall); {if (DAQmxError < 0){goto Error;}}}
#define DEFAULT_TIMEOUT DAQmx_Val_Infinite
#define ONE_SAMPLE_PER_CHANNEL 1
#define DEFAULT_DATA_LAYOUT DAQmx_Val_GroupByChannel
#define DEFAULT_FILL_MODE DAQmx_Val_GroupByScanNumber
#define SINGLE_ELEMENT_SIZE 1


/**************************************************************************/
/* Begin Generated Code */
/**************************************************************************/
int32 CreateDAQTaskInProject(TaskHandle *taskOut0)
{
int32 DAQmxError = 0;
TaskHandle taskOut;

DAQmxErrChk(DAQmxCreateTask("DAQTaskInProject", &taskOut));
// floating point error occurs in the following call
DAQmxErrChk(DAQmxCreateAIAccelChan (taskOut, "Dev1/ai0",
"Acceleration", DAQmx_Val_PseudoDiff, -5, 5, DAQmx_Val_AccelUnit_g,
1000, DAQmx_Val_mVoltsPerG, DAQmx_Val_Internal, 0.001,
""));

DAQmxErrChk(DAQmxCfgSampClkTiming(taskOut, "",
1000, DAQmx_Val_Rising,
DAQmx_Val_FiniteSamps, 100));

*taskOut0 = taskOut;

Error:
return DAQmxError;
}

/**************************************************************************/
/* End Generated Code */
/**************************************************************************/
0 Kudos
Message 1 of 1
(2,501 Views)