LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Maximum size for FileToArray?

Hello,
I like to generate a waveform, e.g a triangle for testing purposes. The
problem is: I need 524288 words with 9 bits. I tried the ArrayToFile and
FileToArray functions, but they seemed to be limited to 100000 entries.
Is it a bug or a feature?
Greetings,
Michael
0 Kudos
Message 1 of 3
(3,083 Views)
Hello

I tried the following peice of code

#include
#include

double test[530000]={0};
double test1[530000]={0};
int i=0;
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
for(i=0;i<530000;i++)
test[i]=i;

ArrayToFile ("c:\\test.txt", test, VAL_DOUBLE, 530000, 1,
VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS,
VAL_CONST_WIDTH, 10, VAL_ASCII, VAL_TRUNCATE);

FileToArray ("c:\\test.txt", test1, VAL_DOUBLE, 530000, 1,
VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_ASCII);

return 0;
}


It seemed to work ok with 530,000 doubles. Let me know if I missed anything.

Thanks

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,083 Views)
Thank you for the code. But in fact the problem was the debugging mode
of cvi.
[unable to allocate system resources]
Compiled, there are no errors anymore.
Greetings,
Michael
0 Kudos
Message 3 of 3
(3,083 Views)