11-15-2012 03:02 PM
I am creating a workspace object using Labview 2011.
Once the object is placed in the workspace and the channel is selected, I would like to be able to programmatically make decisions based on the selected channel. Is there a vi somewhere in the Veristand API that provides channel info from the existing workspace objects?
If not, does someone have a method for extracting that info?
Thanks
11-16-2012 12:30 AM
You may use the "get alias" or "get system node children" to retrieve channels from the running gateway.
11-16-2012 09:07 AM
It looks like those two vi's return the whole list of channels. I'm interested in identifying which specific channel was selected for the workspace object.
To clarify, bear with me...
When an object is placed on the workspace a dialog pops up that allows the user to browse for a channel to associate with that object. In the code that I'm writing for the custom object, I want to make a decision based on what channel the user selected. The vi that generates the pop up dialog does not provide that as an output and it doesn't appear to be something that would be easy to dig out of there. So I thought there might be a vi in the Veristand API that allows you to look at what specific channel was selected for a particular workspace object.
Thanks
11-19-2012 03:20 PM
Pmac,
We don't have the exact functionality you are looking for currently impletment but the screen file is just a xml document that you could parse to find out this information. It isn't the easiest to look up but if you add things one at a time your should be able to watch all the changes and pull out the corresponding data.
Feel free to post the idea to the idea exchange
http://forums.ni.com/t5/Additional-NI-Software-Idea/idb-p/nisoftware/label-name/veristand
Thanks,
11-19-2012 03:31 PM
Kyle's suggestion won't work, unfortunately. The screen file is XML, but the data about the controls on the screen is encoded binary data. You would not be able to make sense of it.
We don't have any APIs to get the data that you want. You could create your own control based on the Decoration - Free Label template, or perhaps one of the controls on the VeriStand add-ons page. This provides a lot more flexibility, but you also have to program more yourself, such as the configuration dialog, because the custom control template does not provide this.
11-20-2012 07:22 AM
Thanks for your replies.
11-29-2012 07:56 PM
pmac,
I was recently contemplating a similar scenario and a helpful Applications Engineer was kind enough to point me to this:
NI VeriStand Add-On: Channel Select Dialog
Works like a charm and I think it will get you a long way towards the custom workspace object you're looking to create.
11-30-2012 05:58 AM
It looks like that does get me closer to what I'm trying to do. I'll give it a go.
Thanks
11-30-2012 11:13 AM
I put this on the block diagram of my custom object (per the installation instructions) and tied an indicator to the "Channel Path" output. When I drop the custom object on the workspace I get a .NET exception dialog telling me basically, that a referenced item does not exist.
Did you see this error or am I doing something wrong?
Thanks
11-30-2012 11:21 AM
Sorry, I forgot to mention something about that tool:
When I downloaded it, it was not working properly, I had to edit it slightly.
I then had to feed the VI my custom device reference as an input. The .NET API probably changed slightly from when this was first built.
Sorry for the omission!