LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulating array

Solved!
Go to solution

@crossrulz wrote:
At least the OP gave a before and after of what they wanted.  That's the only reason I had a clue about what to do.

 How did you figure out what the before and after is?

 

If he wants to transform a two-column array to a 8 column array, keeping the elements in memory order, all he needs is an array reshape. Am I missing something?

 

 

 try it!

 

Message 11 of 17
(948 Views)

And that's Altenbach for you.  Always finding the simplest and most efficient way to do something.

 

I didn't realize that the memory order was being kept.  Now that I see it, it makes complete sense.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 17
(939 Views)

Sorry, I ignored the "in a for loop" requirement. Sometimes I break the rules! 😄

Message 13 of 17
(932 Views)

@altenbach wrote:

Sometimes I break the rules! 😄


I've been known to break the rules as well.  Usually for the better.  Besides, they are more like guidelines anyways.Smiley Wink


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 17
(927 Views)

Zepiii wrote:

It works!


In my test, this code does not work correctly, mostly because your array diagram constant in the upper left is 438x2. It needs to be an empty array! (In addition to the problem with "index array").

 

You also don't process the entire input array, but trim it after 50 columns, discarding more thant half of the data.

 

Here is a corrected version (LV 2010) as well as two alternatives discussed earlier. Let me know if you have any questions. I also placed some potentially useful green diagram comments.

0 Kudos
Message 15 of 17
(902 Views)

 Register name                                                                                                      type              modbus location

FAULT uint16_t 300004
TEMPA uint8_t None
TEMPB uint8_t None
TEMPA/TEMPB uint16_t 300005

 

 

I'd like to search through an string array and if i find a uint8 variable I'd like to create a new row entry which is TEMPA/TEMPB   MSB,LSB uint16 like above.

Then continue the search. I have 300 variables in this string array and need to pull out all of the unit8 variables in this fashion and put them into uint16 for modbus registers transmission.

I dont need to append to the current array, creating a new array from the old one is preffered. 

I can then search through the final array and link the uint16s with modbus registers if  location != none 

 

How can i do this ? Any ideas?

 

James

0 Kudos
Message 16 of 17
(839 Views)

James,

 

Your request has nothing to do with the old thread to which you appended your post, except the title.

 

Please start a new thread and reference this one. You will also get better answers if you show what you have tried and state what does not work about it.

 

Lynn

0 Kudos
Message 17 of 17
(833 Views)