08-15-2012 09:20 AM
Hey everyone,
Right now, I am trying to create a digital array several thousand samples long full of 0's - I am planning to write over them with 1's at specific points so that I can create a digital waveform.
Is there any function or set VI on labview that I can use to create a digital array?
Thanks a lot,
Mitchell
08-15-2012 09:29 AM
What do you mean by digital? Do you simply mean that your values will consist of only 0s and 1s. LabVIEW does not have a bit array. You can create an array of Boolean values or a byte array. The Boolean array would be the closest to a bit array though internally each element will be an 16-bit value.
08-15-2012 09:34 AM
Use "initialize Array" from the array palette:
08-15-2012 09:43 AM
Sorry about that - yes, I do mean that the array should only consist of 0's and 1's - if I used initialize array, connect it to a number representing my samples, and connect it to a false boolean would that mean everything would start at 0 value?
08-15-2012 09:55 AM
There is only EITHER Boolean or Numeric to choose from. As Mark Yedinak said - using 8Bit Numeric will save you 50% of memory as Booleans are represented by 16 bits of data. In case you want to write the digital waveform to a DAQmx device - this works with U8 arrays. So you best use that.
08-15-2012 09:59 AM
Yes, initialize array can take a Boolean as it's element data. You could also use an 8-bit number as your data type.
08-15-2012 10:02 AM
...as could be seen in the above attached picture of my first post:
http://forums.ni.com/ni/attachments/ni/170/689250/1/InitializeArray.PNG
08-15-2012
10:05 AM
- last edited on
05-05-2025
09:56 AM
by
Content Cleaner
08-15-2012 10:11 AM
not quite sure what you want, but you need a U16 to represent your several thousands value(65,536)...a U8 only represents a 255 value
08-15-2012 10:23 AM