BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


BowenM wrote:

(Disclaimer:  this was most likely written by a grad student who had never seen LV before and was just told to make it work)


Maybe (s)he was told he got paid until the job was done? In fact that's very smart.

0 Kudos
Message 1861 of 2,571
(11,082 Views)

@altenbach wrote:

@BowenM wrote:

... and was just told to make it work) 


And I guess it actually "worked" 😄


 

Capture.png

I wouldn't guess it did. Somehow I think that THAT is not the right way to calculate %charge unless the ??? units are really odd.


"Should be" isn't "Is" -Jay
0 Kudos
Message 1862 of 2,571
(11,072 Views)

@JÞB wrote:

I wouldn't guess it did. Somehow I think that THAT is not the right way to calculate %charge unless the ??? units are really odd.


The "???" array is the maximum currents for each magnet, and is used when sending the command to the power supply.  This part I'm actually surprised works because it is a topnotch local variable induced race condition.

 

Current ZOOM.png

 

Edit:  I lied... it isn't a race condition just oddly coded.

0 Kudos
Message 1863 of 2,571
(11,059 Views)

@BowenM wrote:

@JÞB wrote:

I wouldn't guess it did. Somehow I think that THAT is not the right way to calculate %charge unless the ??? units are really odd.


The "???" array is the maximum currents for each magnet, and is used when sending the command to the power supply.  This part I'm actually surprised works because it is a topnotch local variable induced race condition.

 

 

 

Edit:  I lied... it isn't a race condition just oddly coded.


Silly me! I simply expected a physics grad student to use Q for electric charge (SI Ampere Seconds) Placing ??? as Seconds.  %Ampere Seconds being rather odd


"Should be" isn't "Is" -Jay
Message 1864 of 2,571
(11,033 Views)

(seen here)

 

What kind of high-school teacher would teach the students to program like that??? 😮

 

 

OverdosingOnLocals.png

Message 1865 of 2,571
(10,905 Views)

A nickel is also 40cents which is a solid exchange.

Matt J | National Instruments | CLA
Message 1866 of 2,571
(10,900 Views)

Yes, a candy bar for two nickels sounds like a pretty good deal. 😄

0 Kudos
Message 1867 of 2,571
(10,896 Views)

@altenbach wrote:

Yes, a candy bar for two nickels sounds like a pretty good deal. 😄


But that loop will probably cause the processor to run a little hot, so don't get anything chocolate.

0 Kudos
Message 1868 of 2,571
(10,883 Views)

@Jacobson-ni wrote:

A nickel is also 40cents which is a solid exchange.


Not if you buy %0.60 chips for 1 buck and only get a nickel back


"Should be" isn't "Is" -Jay
0 Kudos
Message 1869 of 2,571
(10,876 Views)

@altenbach wrote:

(seen here)

 

What kind of high-school teacher would teach the students to program like that??? 😮

 

 

 


Didn't want to spoil your fun on the other thread but "$%0.2f" and "%d¢" (%dAlt+0162) would blow the teachers mind!  but, at least the array constants would make sense cents  

(The urge to include the pun was irresistible, Oh well!  )


"Should be" isn't "Is" -Jay
Message 1870 of 2,571
(10,861 Views)