10-28-2013 11:18 AM - edited 10-28-2013 11:19 AM
Altenbach, I agree. I just know on certain RT systems (*cough cough* cRIO) I have had to switch from boolean to bitwise comparissons because the number to boolean array was hurting my timing. So, I just wanted to throw this possible solution out there in case that is a requirement for anyone. On a PC or beefy PXI controller, the readability of the boolean array plays the trump card on the bit twiddling without a doubt. But, I have seen it negatively effect performance in certain cases.
10-28-2013 11:45 AM - edited 10-28-2013 11:45 AM
Greg, Now i am thinking why number to boolean array causes problem some time on dedicated system.
Is that because you already have bits ( some value ) stored in memory and now you are building an array so basically adding a 32 bit header and following same bits again so conversion does not play any importance in terms of calculation ( actually adds overhead ) because however we interpret it computer or hardware will see only 0 and 1.
Right, wrong or absolutally wrong
10-28-2013 12:08 PM - edited 10-28-2013 12:09 PM
Someone can probably give a better answer than I, but I assume it has to do with the fact that in memory a U32 takes up 4 bytes (i.e. 32 bits), but because each boolean in LabVIEW takes up a byte, not a bit, there is some additional overhead converting from one to another. So, a 32 bit number, when converted to a boolean array now becomes 32 bytes. I don't know what the overhead associated with this is, or when it no longer becomes negligible (i guess that is application specific), but I'm just commenting on what I've seen.
10-28-2013 12:09 PM
A boolean array is very wasteful because only one of every eight bits carries any useful information. The rest just wastes memory.