08-30-2008 12:48 PM - edited 08-30-2008 12:48 PM
So we have a 1D array of U8 that we need to recast as little endian U16 array.
The worst way (top of image) takes 15 minutes to execute for 3M elements (!!!) AND produces
incorrect and meaningless results due to the fact that leading zeroes in binary are dropped and x0000 later removed with string operations..
Here's the wrong way (top of image)
We have a complete lack of understanding of datatypes and of the distinction between formatted strings vs flattened strings.
A quick, and probably correct (!), alternative is shown at the bottom of the image (10).
(Adapted from this post)
09-04-2008 04:51 PM
09-05-2008 02:30 AM
What are you complaining about? That's a beautifull piece of art! You have to admire the craftmanship!
09-05-2008 09:05 AM
09-05-2008 10:32 AM - edited 09-05-2008 10:33 AM
To do some simple scaling af an array with two elements, we could either do:
Your pick! 😄
Of course for clarity we would place all formula statement on a single line and resize the formula not so most of it is hidden. (See original code).
Thi\us we we will never notice that we accidentally multiply instead of substract.
(guessing here, but if the second statement is really "D=(C*0.8996)*26.667;", why would we need the brackets?)
(also adapted from the same as above)
09-05-2008 04:04 PM
Anthony de Vries wrote:What are you complaining about? That's a beautifull piece of art! You have to admire the craftmanship!
LOL, but I also want to see the upgrade after he adapts the code to 128 channels. 😄
In my alternative, the only thing you need to change is a single diagram constant. 🙂
(...or, if the array of scaling constants is correctly sized, just take it's array size instead and the entire code scales automatically)
09-08-2008 09:03 PM
Something SMercurio noticed...
A typical Rube... not that it is easy to figure out how to simplify.. 😉
from: http://forums.ni.com/ni/board/message?board.id=170&thread.id=354222
09-11-2008 01:42 PM
There's so much white space on the block diagram that it should all be used... or NOT!!
Here's the thread.
09-12-2008 01:08 AM
09-12-2008 01:32 AM