10-13-2009 09:53 PM
I wrote a VB.NET app that interfaced with 16+ CRIOs via STM Protocol. I used code similiar to what I will post with this for a client awhile back. This is dumbed down, but will work just fine.
I will try to rewrite it in C# soon. Next week I hope to port those classes to java (Android) but I can only test it with test samples as I have no phone yet. I think a java app on a phone would be cool for when we get true wifi on Android phones. That would rock!
10-14-2009 08:13 AM
Before I go post a sample project for network variables that is similiar to this....here is a quickie to help you decide on STM or NetVars.
When to use STM Protocol:
When to use Network Variables
As you see, you probably want to only use STM Protocol for a professional app. NetVars are good for quick and dirty applications, and tend to suffer under load and get asynch with the clients from time to time and spin out of control at the worst times. Having done many projects with both, we don't like Network Variables and consider them to be scary at this time.
10-14-2009 09:34 AM
Here is a small VB.NET project that uses network variables.
You probably need to reconnect the references. I deleted the dlls and references in the debug directory. You need to go to project properties and add references for NI Common dll and NI network Variables DLL. That is all you should need to do to use this. In the event that this really messed up the project, create a new VB project and just copy the code over. Its not rocket science so don't panic. It's really idiot proof.
10-14-2009 02:49 PM
I would just mention that since LabVIEW 8.6, the read node for a Network Published Shared Variable has a blocking mode that will indicate whether the data returned is new. You should no longer need to keep around a copy of the data and do your own checks.
You can accomplish the same thing in older versions of LabVIEW by using the DataSocket API to read shared variable data, but this does require significantly more coding.
J.D. Robertson
National Instruments