03-14-2018 11:51 AM - edited 03-14-2018 11:52 AM
So are you suggesting something like this instead?
03-14-2018 11:54 AM - edited 03-14-2018 11:57 AM
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.
03-15-2018 03:10 AM
@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:
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)
03-15-2018 08:53 AM - edited 03-15-2018 08:55 AM
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?
03-15-2018 10:58 AM
@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.
Still, I am sure there are much better ways overall....