04-19-2013 12:54 PM - edited 04-19-2013 12:56 PM
I had edited my post but you got to it first : I should add, I guess I could have a constant array and index it
@altenbach wrote:
@for(imstuck) wrote:
On FPGA you could make a case structure with a constant in 17 cases, or you could use scale by a power of 2. Good thing it wasn't a 64 bit number....
I'm curious if there's another way to get a 0 as the first element without using the select (and without a build array after the loop). Any takers?
What's the point of your code? Since all inputs are constant, you might as well create a lookup table and use no code at all. (most likely that's what the compiler does anyway ;))
04-19-2013 01:24 PM - edited 04-19-2013 01:30 PM
Whats the point of the select anyway? 2^-1 =0.5 rounded away from odd to fit an integer type and...
Fits on a postage stamp
04-19-2013 01:54 PM
found this one here...look into the "cv.vi" file of the llb
04-27-2013 12:18 AM - edited 04-27-2013 12:24 AM
Here is code where the programmer is having problems about the "colors" being wrong for the plots when trying to change the visibility. Actually the labels are wrong because they are rebuilding the array.
Cluster to Array instead of Build Array. The 13 case case structure to rebuild an array for 0 to 12 items selected. The Index Arrays inside of that have all of their constants wired. Overall unnecessary array manipulation. This could all be cleaned up to this. But it still doesn't solve the problem.
But knowing what the programmer really wants, all they need to do is set the visibility property of each plot. And you get this. Problem Solved.
04-28-2013 12:03 AM
@RavensFan wrote:
But knowing what the programmer really wants, all they need to do is set the visibility property of each plot. And you get this. Problem Solved.
Is LV 2012 (or was it introduced in 2011?) being used? If so, it could be done with no code and just enabling the visibility checkboxes that are built in.
04-28-2013 10:47 AM
His VI was saved in LV 2011. I don't remember which version of LV introduced the checkboxes in the legend. The visibility property node may not have even existed for individual plots until the checkboxes were introduced. I don't know.
If the built-in checkboxes exist and they are okay for the programmer, then there is no need for even that final amount of code. But I went on the assumption that they still wanted a separate means of programmatically changing the visibility.
05-09-2013 05:00 PM - edited 05-09-2013 05:01 PM
A case structure with two cases, packed with the same local variables and the same code (except for the presence/absence of a +1 in one place. All terminals just sitting there disconnected. (top left in picture)
A literal translation is shown at the bottom right.
(of course once we figure out what this code is supposed to do, a one-liner the size of a postage stamp might be sufficient :D)
05-15-2013 03:27 AM
@JÞB wrote:
Whats the point of the select anyway? 2^-1 =0.5 rounded away from odd to fit an integer type and...
Fits on a postage stamp
I like bit twiddling when possible, reminds of assembler and stuff where i started, so:
/Y
05-15-2013 04:05 AM
05-15-2013 08:03 AM
Nice tweak to mine, haven't thought about Logical shift being able to take arrays. 😄
/Y