LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refactoring a rushed PSU control program

 

I've been working with LabVIEW mostly doing tech support, fixing old programs and doing troubleshooting with hardware so I know a bit about it but I think I have picked up some bad practices and recently I had a very quick deadline to get a control program made from scratch to test some proof of concepts and it worked but It is full of redundant code. The key function of the program is to allow programmable hold times at a certain current, allowing voltage to fluctuate, and logging some sensors.

 

So it worked to control the AC to DC PSU and we got some data, and my boss wants me to add more cycles, more sensors etc. I want to take some time and refactor this so that when I add the new cycles (ramps and hold times & more sensor readings) in, there isn't so much redundant code.  I'm attaching the vi and the only thing missing are the genesys control drivers but they're pretty much just configure current, configure voltage, measure current etc. What are some resources and places to look for to refactor and clean up redundant, messy LabVIEW programs?

 

Regards,

Andrew

Andy_7_0-1717695924243.png

 

0 Kudos
Message 1 of 2
(323 Views)

My immediate first thought is to look into making a State Machine to handle your application.  It is a framework to help you break up your program into smaller parts that are reusable and allow you to loop through the states based on whatever parameters.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(311 Views)