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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Proof My vi

So are you suggesting something like this instead?

0 Kudos
Message 11 of 15
(455 Views)

Yes, just prettier. 😄

You don't need to wire N because the number of iterations is fully determined by the shortest autoindexing input. I think you could even delete the FOR loop and nothing will change. 😄

 

The calibration constants could be all in a 2D array on the front panel (... but then you need the FOR loop). The resistance values could be an array indicator.

Message 12 of 15
(451 Views)

@altenbach wrote:

Yes, just prettier. 😄


I'd say that even running the automatic diagram cleanup would make it better! (That's not good.)

 

Learn to straighten those wires while you're still learning LabVIEW. It will save you a lot of headaches. Passing CLD will not happen if you wire like you did.

 

I know all the excuses. It's just temporary, it's just a tiny peace of code, I'm lazy... Clean wiring will save time in the (slightly) longer run.

 

Spot the differences:

Better Wiring.PNG

 

Note how the for loop is gone. LabVIEW will do that for you (pun intended).

Note others might do it differently. There are different flavors in style, this is something different then quality.

Note how this isn't a snippet or VI, but an image. That is intentional. You'll only learn by doing (give you the fish vs learn how to fish and all that)

Message 13 of 15
(435 Views)

Thanks, those are good tips!

 

Anyone have any thoughts on or ways to clean up the case structure that plots the waveform chart(.png)? I don't know much about the waveform functions and copied this idea from another example showing how to plot the current time on the chart. Do I need the dt part of the build waveform function? It doesn't seem to do anything when I change the value since the timing is determined by the loop and structure.

 

What about the convert to single precision float, I placed it before the waveform chart because the it will be saving something like 10,000 to 30,000 data points and I thought this would cut the memory used for that in half. Does this work as I intended?

Download All
0 Kudos
Message 14 of 15
(414 Views)

@el_ManBearPig wrote:

 

Anyone have any thoughts on or ways to clean up the case structure that plots the waveform chart(.png)?


Here's a literal translation of your code. Note that defining the waveform as SGL will force a coercion to SGL inside the loop. No conversion needed.

 

Chart.png

 

Still, I am sure there are much better ways overall....

Message 15 of 15
(406 Views)