04-26-2013 11:20 AM - edited 04-26-2013 11:35 AM
@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!
04-26-2013 11:45 AM
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.
04-26-2013 12:00 PM
Sorry, I ignored the "in a for loop" requirement. Sometimes I break the rules! 😄
04-26-2013 12:17 PM
@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.
04-29-2013 10:42 AM
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.
06-26-2015 08:07 PM
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
06-26-2015 08:17 PM
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