Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

byte filter can-frame

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

0 Kudos
Message 1 of 2
(6,247 Views)

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!

Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 2 of 2
(6,231 Views)