Wouter Posted November 26, 2010 Report Share Posted November 26, 2010 (edited) Hello, I have a "numeric control" wired to a "build array function". Now what I want to achieve is to get the reference of the wire which is connecting the "numeric control" with the "build array function". When I have this reference I delete the "numeric control" and re-route the now broken wire to a new control. My question... How do I do this? I tried all sort of combinations with the available reference that were provided to me by the property node. vi_script.vi test.vi -edit- the vi snippets don't seem to work... test.vi vi_script.vi vi_script_control_get_position.vi vi_script_delete.vi Edited November 26, 2010 by Wouter Quote Link to comment
SuperS_5 Posted November 27, 2010 Report Share Posted November 27, 2010 Hi, The VI as it stands seams to work for me. However, there is a method in the invoke node (replace) that makes the diagram simpler Quote Link to comment
crelf Posted November 27, 2010 Report Share Posted November 27, 2010 Does the control to be routed to already exist? If not, replace the old one with the new one - much more straightforward. Edit: SuperS_5 got there before me Quote Link to comment
SuperS_5 Posted November 27, 2010 Report Share Posted November 27, 2010 (edited) Sorry, I didn't look carefully enough. I see your problem now. The replace method does work though. Edit: Looks like we are racing Edited November 27, 2010 by SuperS_5 Quote Link to comment
SuperS_5 Posted November 27, 2010 Report Share Posted November 27, 2010 (edited) I have not had any time to play with scripting before, and still don't. I am very excited about it though, so have been playing with this problem. I have found out how to connect a wire, in the case that you didn't want to delete the original control. However, apparently the seemingly easy way of deleting the wire segment, "is not yet implemented." (That is directly from the error cluster) Rewiring all of the segments after deleting the wire is the alternative. Edited November 27, 2010 by SuperS_5 Quote Link to comment
Wouter Posted November 27, 2010 Author Report Share Posted November 27, 2010 Sorry, I didn't look carefully enough. I see your problem now. The replace method does work though. Edit: Looks like we are racing Oh that is really nice that makes things a lot easier now (: for my universal solution: http://decibel.ni.com/content/docs/DOC-14274 Quote Link to comment
Wouter Posted November 27, 2010 Author Report Share Posted November 27, 2010 Ah a shame the replace thing doesn't work on all cases. If you want to replace a control, for example, you can only replace it by a other control but not by a constant or indicator. There are some few exceptions however... for example you can replace a constant by a control... this is the result: xD Quote Link to comment
ShaunR Posted November 27, 2010 Report Share Posted November 27, 2010 Ah a shame the replace thing doesn't work on all cases. If you want to replace a control, for example, you can only replace it by a other control but not by a constant or indicator. There are some few exceptions however... for example you can replace a constant by a control... this is the result: xD You can use the "Toggle" or "Change to Control" properties for this. http://www.screencast.com/users/Phallanx/folders/Jing/media/6d33f01c-4961-4c88-9944-e3290ab349a0 1 Quote Link to comment
Wouter Posted November 27, 2010 Author Report Share Posted November 27, 2010 You can use the "Toggle" or "Change to Control" properties for this. http://www.screencast.com/users/Phallanx/folders/Jing/media/6d33f01c-4961-4c88-9944-e3290ab349a0 That is really nice. I just only thought of it that I don't need to change control to constants or indicators or the other way around for my application, however still thanks for the webcast. Now I know how to do that for when I need it. Quote Link to comment
Wouter Posted November 28, 2010 Author Report Share Posted November 28, 2010 Does anyone know if it is possible to change the "owner" of a control? For example... I have a numeric control. Now I want to change that to a array of numeric controls. Now what I want to do is kind of "encapsulate" the numeric control by a array so that I don't have to replace/delete control for the array and then insert the numeric control. Quote Link to comment
SuperS_5 Posted November 28, 2010 Report Share Posted November 28, 2010 You can use "Owner Refum" input on create object vi, or move method of invoke node. Quote Link to comment
Yair Posted November 28, 2010 Report Share Posted November 28, 2010 I have a numeric control. Now I want to change that to a array of numeric controls. Now what I want to do is kind of "encapsulate" the numeric control by a array so that I don't have to replace/delete control for the array and then insert the numeric control. I believe there's already an RCF or Quick Drop plugin which does this (probably the latter). Try searching for "convert to array" or something along those lines. Quote Link to comment
Wouter Posted December 3, 2010 Author Report Share Posted December 3, 2010 You can use "Owner Refum" input on create object vi, or move method of invoke node. Yes but I would like to switch the two blocks in your diagram... So what I want to do: - Select the constant/indicator/controller from the diagram - Create the array and put that existing constant/indicator/controller in the array (without losing wire connections). So basically wrapping the existing controller with a array. 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.