From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

@Paul

Well my understanding was that at compile time the build array from constants and array constant are equivalent (in the runtime version),

and I've had problems with updating typedef enums when the constants are in arrays in the past - sometimes I've lost all of the values I had set when someone flicks it over between typedef and strict type def (I think is the use case), or it could be removing items.
The method I provided is one that doesn't mess up at edit time when dev changes are made, easily shows changes in SCC and seems to compile nicely - but then my enum arrays only tend to be less than 20 items long for state machines / commands (more than 4 is rare).

 

Rube is my specialty though😏

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2311 of 2,571
(4,093 Views)

While 1D arrays are sometime called "vectors", a 1D array with two elements is not a vector in the xy plane unless we define it like that and implement all the trigonometry when processing it as such.

 

Instead, we could just use a complex datatype that does everything under the hood correctly.

 

(seen here)

 

Compare:

 

altenbach_0-1630257740050.png

 

 

 

0 Kudos
Message 2312 of 2,571
(3,895 Views)

Huge screen.png

 

Yes, that white box is my screen size (1366X768, minus window border en menu), shown in the navigation window...

 

What duplicate code? All the loops are different!

 

Glad it isn't my problem. My code lives in the class VIs in the top row, on the right.

Message 2313 of 2,571
(3,774 Views)

You need a navigation pane for the navigation pane 😅

A map on the BD to let you know where you are.

0 Kudos
Message 2314 of 2,571
(3,770 Views)

wiebe@CARYA wrote:

 

Yes, that white box is my screen size (1366X768, minus window border en menu), shown in the navigation window...

 

What duplicate code? All the loops are different!


This might be acceptable programming in LabVIEW if it were targeting an FPGA.  Well maybe not, since the FPGA has had various reference support for a while now and could even be cleaner there with subVIs.

0 Kudos
Message 2315 of 2,571
(3,770 Views)

In there defense, I just found a newer version. By coincidence, there are no files in the project, except the old main...

 

It's 'better' (but far from good):

 

Huge screen 2.png

 

Man! If you're going to put so much work in refactoring, why not make it good?

Message 2316 of 2,571
(3,756 Views)

If your navigation window looks like a CPU die, something is wrong 😄

 

altenbach_0-1632152914707.png

 

Message 2317 of 2,571
(3,737 Views)

@altenbach wrote:

If your navigation window looks like a CPU die, something is wrong 😄

 

altenbach_0-1632152914707.png

 


See where?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2318 of 2,571
(3,734 Views)

@JÞB wrote:
see where?

 

Right above in Wiebe's posts. 

0 Kudos
Message 2319 of 2,571
(3,730 Views)

JÞB tells me my code is ripe for Rube-Goldberg

lazy.png

 

 

and simplified version by altenbach

AeroSoul_0-1632204343460.png

 

EDIT:

Getting nominated for Rube-Goldberg must be akin to getting nominated for Golden Raspberry Award

Message 2320 of 2,571
(3,693 Views)