09-23-2013 06:36 AM
Hi I am trying to convert an ViInt32 array to a ViChar array string. The pulse pattern generator that we used previously went obsolete, and the replacement uses a different way of downloading the pattern into memory.
This is what I have:
ViInt32 data_buffer [16384]; // A buffer that contains 16384 of 1's and 0's. i.e. [1,1,1,1,0,0,0,0.....] This pattern is built using multiple loops.
The new device wants it to be a ViChar[ ]. // For example, [11110000.......]
Is there any way to easily convert my integer array of 16384 1's and 0's into a character string?
Thanks!
09-23-2013 11:04 AM - edited 09-23-2013 11:06 AM
ViChar should behave like a normal string, that is you should be able to do something like this:
ViInt32 a[16384]; ViChar b[16384]; int i; for (i = 0; i < 16384; i++) { b[i] = 48 + a[i]; }
The output is a chan of characters "0" and "1" mirroring the content of the int array.