Neil Pate Posted February 15, 2016 Report Share Posted February 15, 2016 (edited) Hi, I have created some code to programatically replace the pictures in a boolean. I am applying my logic to a strict typedef and it works nicely. However my changes to this typedef do not seem to be propagated properly to a VI that uses the control. In my solution the front panel of the VI with the control is open, and I have a reference to the control I wish to modify. From there I get the typedef control, and then update it using the LabVIEW resource functions. After that I update call the Update Typedef method. In the project I sometimes get a message that the file has changed if I then try and open the .ctl, and if I allow that the new skinning is indeed working, however in the original FP the control still contains the existing pictures. In the typedef I cannot apply changes as this menu operation is disabled. I have tried mass compiling and it to does not seem to pick up the new changes. Any ideas what I am doing wrong? Edited February 15, 2016 by Neil Pate Quote Link to comment
hooovahh Posted February 15, 2016 Report Share Posted February 15, 2016 Unless I'm misunderstanding something, the type def is doing just what it should and not updating unless the data type of the control changes. If you are only replacing the pictures in a boolean, but not the actual data type, then an update won't be forced on the instances of the control. Only a Strict Type Def will apply changes to all instances of the control, even if a cosmetic change is made. Quote Link to comment
shoneill Posted February 15, 2016 Report Share Posted February 15, 2016 You can go through the code, find all instances of the typedef and replace them with itself, this will actually bring them into sync. I've done this in the past, just make sure to get the Typedef path and then replace the control with it's own typedef (from path). Quote Link to comment
Neil Pate Posted February 15, 2016 Author Report Share Posted February 15, 2016 Unless I'm misunderstanding something, the type def is doing just what it should and not updating unless the data type of the control changes. If you are only replacing the pictures in a boolean, but not the actual data type, then an update won't be forced on the instances of the control. Only a Strict Type Def will apply changes to all instances of the control, even if a cosmetic change is made. It is a strict typedef. You can go through the code, find all instances of the typedef and replace them with itself, this will actually bring them into sync. I've done this in the past, just make sure to get the Typedef path and then replace the control with it's own typedef (from path). Something like this? Does not seem to work for me. I can get it to work if I open the typedef, change it from strict to plain, apply changes, change back to strict and re-apply changes. Then everything is in sync. Quote Link to comment
hooovahh Posted February 15, 2016 Report Share Posted February 15, 2016 Sorry I misread your opening paragraph to say it worked with a Strict type, but not a normal type def. There is a private method for a VI class type, for Synchronize In All Contexts, not sure if this can be applied to the control VI and have it work or not. Synchronize Private Method.vi 2 Quote Link to comment
Neil Pate Posted February 15, 2016 Author Report Share Posted February 15, 2016 Smashing! That method does work, but it looks like the FP containing the control should not be open when this occurs, so it does not seem to be like clicking "Apply". Dunno, maybe I am still doing something wrong. Anyway, although this is a bit of a pain I think I can make this work now. Thanks Shaun Quote Link to comment
shoneill Posted February 15, 2016 Report Share Posted February 15, 2016 Sorry I misread your opening paragraph to say it worked with a Strict type, but not a normal type def. There is a private method for a VI class type, for Synchronize In All Contexts, not sure if this can be applied to the control VI and have it work or not. I missed that too. Quote Link to comment
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.