08-03-2017 08:54 PM
Hi,
I have a question on what is the fastest- less memory way to remove a specific pattern in a 1D array
For example in 1D U8 Array I would like to delete ( and count the number) whenever I have 3 consecutive 0xFF
For instance : 0xFF 0x2 0x3 0xFF 0xFF 0xFF 0x2 0x3 0xFF 0xFF 0xFF becomes 0xFF 0x2 0x3 0x2 0x3 and I had this pattern 2 times in my array
Many thanks
08-03-2017 09:26 PM - edited 08-03-2017 09:27 PM
If you're considering only U8 arrays, I'd suggest the Search and Replace String option.
This link might also be useful: How to Convert Between Hexadecimal and ASCII in LabVIEW?
08-03-2017 09:28 PM
Question: What happens if there are 4 or more in a row.
I'd just program it in a loop. Search 1-D array for FF. See if the next two elements are also FF. If so, delete from array. Search 1-D array from that point on for next FF. Stop when you get to the end of the array.
08-04-2017 09:08 AM
08-04-2017 01:48 PM
@cbutcher wrote:
If you're considering only U8 arrays, I'd suggest the Search and Replace String option.
This link might also be useful: How to Convert Between Hexadecimal and ASCII in LabVIEW?
Let's make this a bit simpler:
And I'm quite sure this is much more efficient than Bens solution (Byte Array to String and String to Byte Array are basically no-op functions).
08-04-2017 02:43 PM