LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

StateMachineStates file overwritten

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(2,507 Views)
Solution
Accepted by topic author Dark Hollow

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
Message 2 of 5
(2,505 Views)

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.

 

 

0 Kudos
Message 3 of 5
(2,493 Views)

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

0 Kudos
Message 4 of 5
(2,476 Views)

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
0 Kudos
Message 5 of 5
(2,467 Views)