I am using NI USB 6008 device. Looking at NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Acq-Int Clk\
So I want to modify the line that has
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,1000,10.0,DAQmx_Val_GroupByChannel,data,1000,&read,NULL));
as
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,numsamps,TimeouT,DAQmx_Val_GroupByChannel,data,numsamps,&read,NULL));
where the corresponding variables have been defined before like:
Int_t xx=2;
const Int_t numsamps = const_cast<Int_t&>(xx);
int32 error=0;
TaskHandle taskHandle=0;
int32 read;
float64 data[numsamps];
float64 RatE = float64(raTE);
float64 TimeouT = float64(numsamps)/RatE;
But when I try to compile I get this error message:
$ nmake -f makefile.mak
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
cl -D_MT -D_DLL -MDd -EHsc -nologo -G5 -GR -MD -DWIN32 -DVISUAL_CPLUS
PLUS -D_WINDOWS -IC:\ROOT/include -O2 -c SNatInDAQ.cpp
cl : Command line warning D9025 : overriding '/MDd' with '/MD'
cl : Command line warning D9002 : ignoring unknown option '-G5'
SNatInDAQ.cpp
SNatInDAQ.cpp(261) : error C2057: expected constant expression
SNatInDAQ.cpp(261) : error C2466: cannot allocate an array of constant size 0
SNatInDAQ.cpp(261) : error C2133: 'data' : unknown size
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 8\VC\BIN\c
l.EXE"' : return code '0x2'
Stop.
What does it mean 'expected constant expression'? How can I get around this?
What I want to do is pass the size of that data array from another function.