From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing 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,324
(638 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

 

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2312 of 2,324
(440 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,324
(319 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,324
(315 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,324
(315 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?

0 Kudos
Message 2316 of 2,324
(301 Views)

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

 

altenbach_0-1632152914707.png

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 2317 of 2,324
(281 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,324
(278 Views)

@JÞB wrote:
see where?

 

Right above in Wiebe's posts. 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2319 of 2,324
(274 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

0 Kudos
Message 2320 of 2,324
(237 Views)