LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

34970A drivers...

I've downloaded the driver for this DAQ from the ni website.
I 've successfully spoken to the device and have opened and closed channels.
I've configured channels for measurements and have recieved values.
 
I was wondering...how can you convert the value recieved to a double?
 
I've done the following...
 
static ViChar daqmeasure[256];
double measure;
 
 
measure = atof(daqmeasure);
 
 
I am getting the following failure....
"Missing terminating null in string argument"
What doe s this mean?
 
Also, has anyone used the DAQ for measurements? If so can I get help?
 
ThanksNAdvance
0 Kudos
Message 1 of 2
(3,261 Views)
In the C programming language, a string must be terminated by a zero or "null" character.

The error message means that the argument you supplied for atof (ASCII to floating point) doesn't have a null character at the end of it.  Essentially, the function can't tell how long the string is that contains the ASCII representation of the value.

How did you get the ASCII value into the array?  Once you get the ASCII value, you likely have some way of knowing how many characters are there.  Assign the next array element to be null or 0. 

daqmeasure[ASCII size] = '\0';

Menchar


0 Kudos
Message 2 of 2
(3,260 Views)