From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-24-2010 10:35 AM
I have a string array with elements as follows:
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 5E 00 00 00
00 00 50 00 30 00 33 00
34 00 39 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
The array I want to use to replace values with is:
43 4E 31 30 30 33 30 30 31 41
Where 43 goes in the 3rd row fifth position
Where 4E goes in the 3rd row seventh position
Where 31 goes in the 4th row first position
Where 30 goes in the 4th row third position
Where 30 goes in the 4th row fifth position
Where 33 goes in the 4th row seventh position
Where 30 goes in the 5th row first position
Where 30 goes in the 5th row third position
Where 31 goes in the 5th row fifth position
Where 41 goes in the 5th row seventh position
So the final array looks as follows:
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 43 00 4E 00
31 00 30 00 30 00 33 00
30 00 30 00 31 00 41 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Is there an easy way to replace an element of a string within an array with another element of a string within a different array?
Thank you.
Solved! Go to Solution.
03-24-2010 10:47 AM
03-24-2010 10:53 AM
With the replace array subset I was only able to replace an entire row in my array, not just a single element.
03-24-2010 12:09 PM
I've attached the concept for one approach, but it seems like there should be a better method.
03-24-2010 01:33 PM
chuck72352 wrote:With the replace array subset I was only able to replace an entire row in my array, not just a single element.
Not true. Re-read the documentation on that function.
Now try to re-write your VI...
03-24-2010 01:59 PM
My array is 1D, which I believe means each row is a single element. If I understand the documentation correctly for the "replace array subset", I can only replace an element, not a portion of a single element.
For example in my array, a single element might be: 01 02 03 04 05 06 07 08. Therefore I could replace it with 01 01 01 01 01 01 01 01 for example, but I dont see a way to for example change only the 03 to for example 0A without replacing the element with 01 02 0A 04 05 06 07 08.
03-24-2010 02:30 PM
03-24-2010 02:40 PM
Nathand,
Thank you, that's kind of what I thought, I was hoping that there might be a better approach.
03-24-2010 03:20 PM - edited 03-24-2010 03:25 PM
Try this
Omar
03-24-2010 03:38 PM
It's not quite working. Output array 2 has blanks in the positions where characters are expected.