LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Motors - Code is getting messy... I'm not smart enough to use arrays and clusters.

Hi,

Attached file is a "simulation" of 4 motors lifting weight. (8 motor in real application)
This is very simple... just randon numbers... I did it to test my graphing habilities... (Wich I knew were pretty weak).

Every selected motor lifts 1 mass at a time and waits for the others do the same (so we have a cooling time)
When all motor have lifted all masses... we change the parameters (param1 start - end) and repeat the opperation...
This way we get different parameters plots on the same graph to compare the best params.

My concern is that we'll have 8 motor (3 graphs each) and the way I'm doing right now would demand 24 shift registers, lots of wires, space...
Complet
e mess in short words...

1) Is there a eficient way of doing that... put things together in arrays or clusters?

2)Is it possible to have a plot update every time the motor lifts a mass? I can only plot it when all motors have done lifting all masses...

Many thanks in advance!

Erick
0 Kudos
Message 1 of 3
(2,264 Views)
Best thing to do is to create a subVI that contains a while loop and an uninitialised shift register. with this shift register you can store you motor data within a 2D array. So to obtain/store the data for motor2, graph3 you would index array number 5 and then output the subarray into an indicator.
Your subarray would need just 3inputs(action, array index, array data) and 1output vastly simplifying your program.
0 Kudos
Message 2 of 3
(2,264 Views)
I agree with Satans Little Helper about the unitialized shift registers. There are a couple of docs online (advanced search) but LabVIEW Performance and Memory Management covers this and explains how to get better performance out of your code.
0 Kudos
Message 3 of 3
(2,264 Views)