Norm Kirchner Posted June 21, 2004 Report Share Posted June 21, 2004 I'm attempting to script a change to a custom control typedef. Doing so would require opening a ref to a .ctl file or the control within it. But is this possible? I'm about to jump off the diving board, Does anyone know if the pool is empty? Quote Link to comment
PJM_labview Posted June 22, 2004 Report Share Posted June 22, 2004 Hi Norm, While I have not tried this, I bet you will need to get reference to the control define in your ctl file (the same way if it was a control alone on a vi). From there you should be able to operate on the FP control elements (cluster, numeric, boolean..) programatically. PJM Quote Link to comment
jpdrolet Posted June 22, 2004 Report Share Posted June 22, 2004 There are some limitations. I don't remeber the details now but you can't create a control on a ctl file. It must be a VI file. In LabVIEW 7 I once attempt to create/modify a typedef and realized after making all the hard work, it was not possible to make that on a ctl.... Quote Link to comment
Norm Kirchner Posted June 22, 2004 Author Report Share Posted June 22, 2004 Well gents, good news. I started down the path and I am going along ok. I was able to create a ref to the .ctl file just like a .vi Open a ref to the FP then the [controls] and then typecast the single ctl ref to the correct one for the typedef. So far so good, but what I'm looking to do now is create a decoration of an image. But I can't seem to find the right combination of style & object class to create the new object. So far I have been able to create other decorations like flat boxes, labels, chisled lines. :question: Here's the code challenge of the day. What is the correct combination to create a picture decoration? On your marks, get set, go :!: Quote Link to comment
PJM_labview Posted June 22, 2004 Report Share Posted June 22, 2004 Norm, I think trying to generate a picture decoration will be difficult. It would require programmatically accessing edit>inport picture from file. From there you can use copy and paste from clipboard scripting function. The difficulty reside in getting that picture in the clipboard (as I dont think they are any valid setting of style & object class that can be use with the new VI object primitive). It is possible to have a VI open the target image file and to display it in a picture indicator, but if you copy this to the clipboard using LV scripting funtion, you do not only copy the image, but all the attributes of the picture control and you end up pasting a picture control in your target VI. One possible way to do it, would be to create a separate exe file (in labview) that will be called from the development environement. That program will open a image file, diaplay it in a picture control then script copy to cipboard then exit. Back in labview you *might* end up with just the image and not the attribute and you can then script the paste to your target control. This is a convoluted solution that rely on executable, so I am not too excited about it. May be someone will come up with a better idea. PJM Quote Link to comment
Norm Kirchner Posted June 22, 2004 Author Report Share Posted June 22, 2004 :thumbup: I'm working on the programming interface that allows this to happen a little easier. All that is necessary is that the user have a VI with only the image that they want placed on the front panel. From that point, w/ the scripting tools, we can open the vi, select all, copy selected, and then paste selected into the appropriate owner (FP, page, etc) 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.