09-10-2008 07:54 AM
hi all,
i have discovered a little error in the terminal example i posted earlier.
The String going to the Terminal TextBox has some 0's in it.
Reason:
Text is transmitted in variable Length CAN-Frames. The DataLength field specifies how many bytes are valid.
The ncRead vi however outputs always 8 Bytes (the max content of a CAN-Frame), of which only the "DataLen" amount of Bytes are valid.
The rest is set to 0's.
The Question is now:
Howto filter out the 0-bytes out of the string (or byte-array) ?
or
is there such a thing like "variable length array. length = DataLenInfo from ncRead" ?
Is there a quick way to use a script (math script) to do the job?
thanks
09-11-2008 05:57 PM
Hey wrapper!
To filter out the data I would use something like "delete from array" in the arrays palette under Programming. The data outputted from ncRead is an array, so you can easily manipulate it according to your needs with the array manipulation functions!! Thanks!