07-31-2014 05:35 PM - edited 07-31-2014 05:35 PM
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.
Solved! Go to Solution.
07-31-2014 05:55 PM
@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.
07-31-2014 06:30 PM
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.
08-01-2014 12:23 PM
Thanks guys. The terminology can get a little messy and I appreciate the clarification! The VI works pefectly. Problem solved.
-LWolfe