08-12-2012 04:25 PM
Hello all,
I'm working on receiving bytes in from VISA serial. I'm starting to try to manipulate them, starting with grabbing off the first byte...wanting to turn it to a U8 number I"m thinking to evaluate it.
I'm trying to use a subarray to pick off the first row 8 bits long. I would think picking off one row off a 2D array would result in a 1D array, in this case...one that is 8bits long.
But when I try to hook a boolean array to number, it complains that it is being hooked to a 2D array...I'm not sure I understand where the 2nd dimension is coming from?
Suggestions?
Thank you,
cayenne
Solved! Go to Solution.
08-12-2012 04:35 PM
It has to be a 2-D array. Suppose you were picking off 2 rows, it has to be a 2-D array. You can't change the datatype on a wire during run-time. It has to be determined at compile time.
If you only want the first row, then the correct function to use would be Index Array. Index off the first row.
08-12-2012 04:56 PM
@Ravens Fan wrote:
It has to be a 2-D array. Suppose you were picking off 2 rows, it has to be a 2-D array. You can't change the datatype on a wire during run-time. It has to be determined at compile time.
If you only want the first row, then the correct function to use would be Index Array. Index off the first row.
Thank you for the reply.....at first I was having some problems with the Index Array...started trying to delve deeper into the help screens...I think I have it.
If I want the first row, I just put that index in (0).....and leave the colum part unwired...that will give me the entire first row...right?
Does this look to be about what you were describing?
Thank you....almost there...
C
08-12-2012 05:04 PM - edited 08-12-2012 05:05 PM
Yes. That would be it. But I'd argue to do it on the blue wire before the For Loop. There is no reason to do the conversions on the entire array in the For Loop when you are only using the first number. And since you are just converting it back to a number anyway, why bother converting it to a boolean array?
08-12-2012 05:15 PM
@Ravens Fan wrote:
Yes. That would be it. But I'd argue to do it on the blue wire before the For Loop. There is no reason to do the conversions on the entire array in the For Loop when you are only using the first number. And since you are just converting it back to a number anyway, why bother converting it to a boolean array?
Thank you.
This is just a sample of the actual vi...I'm also going to be converting the whole thing to strings to display on a large test indicator element on the gui...hence that loop part....
But good suggestion, I was doing the display first....and now moving to parsing out the data...so, some re-design is called for.
Thank you again for the excellect help and suggestions!!
cayenne