LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copied Control Custom Auto-Increment

Who knows if this is possible...it would save some clean up work down the road so thought I'd ask!

If you have a large portion of code that you *need* to have a second copy of where the logic is very similar - you can copy/paste, and all the control/indicators/structures are autoincremented.  So Control "Test" copied makes "Test 2" etc.  Anyone know of a way to change that string thats added to every control?

So if I was to copy "Test" I could have it's copy become "Test X" instead of "Test 2", where I define X?

More practically, if I had 100 of those instead of them all becoming their own incremented value - they all have X after them?
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 1 of 4
(2,586 Views)
You can not define "X"
0 Kudos
Message 2 of 4
(2,581 Views)
I'd say that in general, if you need to copy that many controls (more than a couple times, which wouldn't be that hard to clean up manually) that you need an automated method to do the clean up, that is a pretty good sign that you may need to rethink your architecture and look at arrays, clusters, and combinations thereof so that your code can be more modular.  Smiley Wink
0 Kudos
Message 3 of 4
(2,566 Views)
Its the values within the clusters that need to be changed and only for readability and data management.  Per your recommendation, I'm not sure how to make it more modulalar, its already making heavy use of all the structures you mention.  Performance is excellent with 2-3% cpu usage peak (other than a huge spike when its first executed lol)

The situation came up where the GUI that was created, needed to be duplicated in the same tab control but the data in corresponding locations has to be identified unique so the SQL managing the databases can differentiate for manipulation and correct data flow. 🙂 On the other end, its more readable IMHO - should another engineer need to modify my code down the road.  I don't claim its perfect, but given the client's current topology, and specific requirements of what I can and can't modify - Its handy for time contraints anyhow 🙂

An engineer here at work has a saying, no matter how you do it in labview, its never right lol.
Have to be very careful with wording lol its a great forum but can be a bit-overly critical lol
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 4 of 4
(2,537 Views)