I tried using the "Appisconnect From Slave" Method on a project with a RIO target (MyRIO) currently connected and the method completes without any error but it does not disconnect the target in my project. I tried playing around, selecting different items in the project window and even making the project window top-most and active before making the call with no success.
How is this method meant to be used? What if I have multipl targets in my project?
Solved! Go to Solution.
I think this issue is due to the reference you are using with the method. At first I had the same issue but once I connect the "Open Aplication Reference" to the "Disconnect From Slave" method
I was able to disconnect my cRIO of the LabVIEW project
Correct me if I'm wrong but according to your screenshot, it appears that you are actually running the VI on the cRIO. Is that really what is expected? The request has to come from the execution on the target.
I will try your trick from the "My Computer" environment later but in a way, your suggestion would explain how LV picks which target to disconnect.
Anyonre from NI can add any information about this feature? There is very little documentation that I could find on the topic.
ok -this question originally came from a LAVA post and I'll copy paste the response I posted there even if it not all relevant here in case someone else needs it!
I played around some more with the functionality today and it really seemed that the invoke Node called "App:Disconnect From Slave" had to be called from within the RT target itself to work, as suggested on the NI forum. Then I tried some other tests to see if it is possible to Run a VI directly on a RT target (that is in your project). At first, I thought that it was not possible and couldn't figure it out until I found this link: http://forums.ni.com/t5/LabVIEW/Loading-and-Running-a-VI-on-a-cRIO-from-a-PC/td-p/796657 . I think that this actually gives you your solution by explaining that each target has its own application instance (also search for "Working with Application Instances" as a "Concept" in the LV[2014 in my case] help file). The way to acquire them is (or at least my way since I couldn't directly give the IP address of the RIO) was:
- App-> Project.ActiveProject -> Targets -> [Index proper one] -> Application -> "Disconnect From Slave"
- "Project.ActiveProject" appears to be a VI scripting (bue background)
- The "Application" property node is located near the very end of the list
This silently disconnects the cRIO and may be able to remove your popup if done shortly after requesting the RT to restart. With the same App reference, you can also programmatically launch a VI to the Target from the Host (same as pressing the Run arrow with cRIO target selected.) It could definitely be useful for you as well if you need to delay the restart to prevent the pop up. I mean, Deploy your application to the CompactRIO with the "Run As Startup" enabled, then get the App reference and run a simple VI that resets the CompactRIO after a few seconds of delay. During that time, call the "Disconnect From Slave" Invoke Node and your pop-up should be gone...
Let me know if this works for you!