07-09-2008 05:26 PM
07-09-2008 05:35 PM
Just to respond more specifically to your question:
Your original request: "How do I write my VI so that it takes as an input references to the shared variables? Can someone please give me an example?"
To clarify - your VI would have a text control "VariableReference" wired to the VI connector pane.
Some other VI would call your VI with the DataSocket reference string, such as "psp:\\localhost\Untitled Library 1\Numeric1". You'd feed this into a DataSocket Open, then a DataSocket Read and a Close. You'd do another DataSocket Open and then a write to the Boolean output version. You can pass that output reference string into the VI as well, or just use some string manipulation to change "Numeric1" into "Boolean1" in the full URL.
I hope I have answered the question you intended!
Mike
07-09-2008 05:38 PM
Yes, the DataSockets work across the network to a shared variable engine running on a different machine.
I think you will find this very easy to add to your existing VI.
Mike
07-09-2008 05:42 PM
07-09-2008 06:03 PM
07-10-2008 09:07 AM
07-10-2008 10:55 AM
07-10-2008 02:13 PM
07-10-2008 02:17 PM
It now looks to me like you simply need a "good old-fashioned shared variable". One that is statically defined - defined while you are editing your program. I don't think you need to "programmatically reference shared variables" - that is dynamic variable binding and not something you would use if you don't need it. I think the use of the word "programmatically" threw us off.
I think what you want to do is exactly what NI intended. Read this document several times - it takes a while to soak in and figure out which parts are relevent and which are not, but still it gets the point across: http://zone.ni.com/devzone/cda/tut/p/id/4679
As a shortcut, try this: open a new project. Right-click on the top-most item in the project explorer - the "Project:" node. Right click it and select "NEW->Targets and Devices". You should find your RT system. After adding it it should appear after the "My Computer" node in the project explorer. Then right-click the RT system node and select "NEW->Library". Then right-click the library and select "create bound variables". You should be able to navigate to the variables available on the RT system.
Caveat: These details may not be exactly right, but at least it should help you become more familiar with all the different ins and outs of the shared variable system. Let me know if this helps or hinders.
Mike
07-10-2008 02:46 PM