Mikkel Posted September 9, 2007 Report Posted September 9, 2007 Hi I am making a system, where it makes sense to put one or more XControls (XValue) inside another XControl (XCalculation). I am seeing (at least) the following problems in trying to get this to work: 1. The 'Container State / Run Mode?' is always True in the XValue XControls. 2. The state for the XValue XControl is not saved - the 'Convert State For Save.vi' for this XControl is never called, when inside XCalculation. I have worked my way around point 1 (by checking the contents of the shortcut menu, which changes when running, ugly!) and I'm starting to work around point 2 by having the XCalculation XControl store the states for the embedded XValues, but before I spend too much time getting this to work, I would like to hear if anyone have seen theese problems, and may have a elegant solution? It should be mentioned that the project is using LabVIEW 8.0.0, but I am open to using a newer version of LabVIEW, if this solves the above problems. -Mikkel Edit: Just tested it - seems like version 8.2.1 and 8.5 do the same as 8.0.0. Quote
Mikkel Posted September 14, 2007 Author Report Posted September 14, 2007 Ok, nobody answered my post, so I sent the same question to NI support, and here is the response. -Mikkel -- Here is what R&D had to say: 1. The 'Container State / Run Mode?' is always True in the XValue XControls. Container State/Run Mode? reflects the state of the VI that hosts the XControl. In this case, because the inner XControl is owned by a Facade VI which is always in run mode whenever the outer XControl is in use, the state is always TRUE. One way to cleanly handle this situation is for the inner XControl to export a property called "Run Mode" which can then be set by the outer XControl whenever it reacts to Exec State change. The shortcut menu approach is not reliable, especially if LV changes the way it builds the shortcut menu in future. 2. The state for the XValue XControl is not saved - the 'Convert State For Save.vi' for this XControl is never called, when inside XCalculation. The Convert State For Save is called when the host VI is saved. In this case, the host VI for the inner XControl is the Facade VI of the outer XControl. The current architecture of XControls does not save the Facade VI along with the instance of the XControl due to various reasons (memory usage, revisioning etc..). This is something we will address in future. No promises of an immediate fix because this requires a major architecural change. The short term workaround is as the customer suggested. The outer XControl need to extract the states of the inner XControl and save it with it s own state. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.