cancel
Showing results for 
Search instead for 
Did you mean: 

StateMachineStates file overwritten

SOLVED
Dark Hollow
Member
Solved!

StateMachineStates file overwritten

I have two VIs.  Both are state machines.  Each is in it's own folder.  When I compile the first VI, all is well.  When I compile the second VI, all is well.  Then when I return to the first VI, it won't run.  The StateMachineStates1 file is overwritten with the state names from the second VI.  And the second VI has no such file in it's folder.  Looks like in both cases, the file is stored in the folder for the first VI.

 

I've looked through the menus and don't see a path setting or option to address this.  Any thoughts out there?

 

DH

4 REPLIES 4
Ben
Knight of NI Knight of NI
Knight of NI
Solution

Re: StateMachineStates file overwritten

open the second (with the first closed) then open the typed states control and do a save as... to the right place.

 

Save the top level VI.

 

VI's remember where their sub-VI where and look there first IF the VI is not already loaded.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
altenbach
Knight of NI

Re: StateMachineStates file overwritten

What exactly do you mean by "compile"? (That term is ambiguous and often misused with repect to LabVIEW)

 

Could you do a clear step-by-step description on what you are doing?

 

Do you get load warnings at some points, e.g. that something is loaded from a different place.

 

As Ben said, most likely the two VIs share a type definition with the same name but located in different places (StateMachineStates1.ctl?) and it is still in memory when the second one loads.

 

 

Highlighted
Dark Hollow
Member

Re: StateMachineStates file overwritten

I suspect that I cut and pasted the first state machine to the second application and edited it from there.  Been a while, so I forget.  There was no such file in the second application, since LabVIEW was using the first one for both.

 

Thanks,

 

DH

Ben
Knight of NI Knight of NI
Knight of NI

Re: StateMachineStates file overwritten

To do a "global" check you can use the VI hiarchy screen and use the option "show full path in label" then you can float over the sub-VIs and check that you are calling VIs from where you THINK you are calling them.

 

Also...

 

When "copying" from another project it is often useful to create a source distribution in the project (configure to duplicate hiarchy to new location). When the source distribution is built, LV will pick-up all of the related VIs drop them in a new location and avoid crosslinking. It will even let you prefix the saved VIs if yu want.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel