LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing a state machine?

Solved!
Go to solution

I am fairly new to using state machines and am hoping there is a simple solution to this question. I have one state machine that is saved (ie StateMachine1.ctl). I created a new state machine (StateMachine2.ctl) and want to replace all instances of StateMachine1 with StateMachine2 in my VI. Is there a simple way of changing the state machine without losing all the linked instances?

 

Thanks.

LWolfe.

0 Kudos
Message 1 of 4
(2,575 Views)

@LWolfe wrote:

I am fairly new to using state machines and am hoping there is a simple solution to this question. I have one state machine that is saved (ie StateMachine1.ctl). I created a new state machine (StateMachine2.ctl) and want to replace all instances of StateMachine1 with StateMachine2 in my VI. Is there a simple way of changing the state machine without losing all the linked instances?

 

Thanks.

LWolfe.


Let's make sure we are using the correct terminolgy here.  It seems that what you are calling a "state machine" is really a custom control, probably typedef'd and because it was typedef'd, probably an enum.  I like to make mistakes like that, mistakenly calling something by the name of something else very closely associated with it.  🙂

 

So is your question really, "How do I replace one custom control with another?"

 

In this case, it might be just easier to modify your first control and forget about using the second.  Assuming again that it is a typedef'd enum control, modifying the typedef'd enum that is already part of your state machine will ensure that the changes are propagated to all the other places.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(2,566 Views)
Solution
Accepted by topic author LWolfe

I remember making a VI to find instances of one type def control and replace them with another.  Very similar to what you are describing.  It used scripting and it was surprisingly not hard to do.  Ah, and I managed to find it.


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 3 of 4
(2,556 Views)

Thanks guys. The terminology can get a little messy and I appreciate the clarification! The VI works pefectly. Problem solved.

 

-LWolfe

0 Kudos
Message 4 of 4
(2,498 Views)