11-04-2012 10:59 AM
I have come a little distance into my sbRIO system with a handful of actors for measurement, control and application.
The system will only have a Machine-Machine Interface, specifically a SCPI protocoll, transported over serial or or TCP.
And such a structured protocoll, translates pretty well into Message Objects (it would be nice if either our GDS tool or NIs Message Maker had a specific API for creating mesasge classes from XML).
Up until now I have been using the Linked Network Actor method shown in the AF-cRIO example. And I am really pleased with its robustness, whenever I get it to work, its hard to break.
But, of course there is a but, I've spent a lot of time troubleshooting the setup, getting it to work, keeping it working as the app grows, seeing to it that the right messages are sent across the net and so on.
I am now considering a Web Service interface, and when doing so, have one basic question:
In my Web Service VIs (running in the web server App instance), whats the best way to send messages to / get messages from my Interface Actor ?
What i'm going to try first is using VI-server to call a repository VI in the .rtexe which holds the message-enqueuer/message-dequeuer refs. and in the same way run the Send methods for the specific messages.
Whatd'ya think?
/Marcus
11-05-2012 11:44 AM
Marcus Johnson wrote:
What i'm going to try first is using VI-server to call a repository VI in the .rtexe which holds the message-enqueuer/message-dequeuer refs. and in the same way run the Send methods for the specific messages.
Whatd'ya think?
Since web services run in a separate application instance, I think that's pretty much how you'll need to do it. I tried this approach a couple of years ago, and I seem to recall that it worked well. (I was experimenting, so that code didn't go into an actual application.)
Web services are command-response, so you will want to use Reply Messages to query your actor system.
11-19-2012 04:28 PM
You might also try an approach of downloading niACS's example of how to communicate between actors running on a desktop and actors running on RT and use that exact same model to establish communication between the web service and the interface.
11-20-2012 07:53 AM
Whould you be so kinda as to provide a link to the example? I seem to fail at searching.
11-20-2012 10:52 AM
rpodsim wrote:
Whould you be so kinda as to provide a link to the example? I seem to fail at searching.
01-30-2013 10:28 AM
I was able to get this working as part of research for LabVIEW Work-Dispatcher utilizing the. Here are the things I had to change from the default 2012 actor framework project to get it working.
Build Settings
Implementation Notes
All the other rules for creating web methods apply (controls and indicators on connector pane, avoiding illegal characters in this control, etc). Attached is the project I got this working in. Please note this project is as-is and I didn't spend any time cleaning it up (sorry guys) so it includes some shared variables I used to instrument and debug my code.
Cheers!
Mark
01-30-2013 10:41 AM
Hi MarkBlack
There is missing file "Instrument Variables.lvlib" in the attachment file.
01-30-2013 11:40 AM
Ha, sorry about that. A new zip archive is attached.
10-21-2014 11:15 AM
Hey Marcus,
It looks like this thread died with no resolution. What did you end up going with? I am running into the same issue and am considering using the LNA as AQ suggested above, but I started first with building an entire heiarchy around an engine polling a bunch of shared variables which are exchanging data between the web services and the main application. In the past, I have used shared variables for communication with applications on a host because they are 1) easy and 2) can be manipulated using the system manager. Since I am working on my first application using web services, I am a little nervous about completely ditching this approach and hence I am using shared variables to communicate with web service and which can also be used to communicate with a host. This feels a little hacky to me, so I am looking for a better approach before I sink too much time into this. Hence the desire to find out what your resolution was (or for that matter anyone else's who may have encountered this problem and found a reasonable solution).
Cheers, Matt
10-21-2014 02:33 PM
The second zip I posted should work. It was build using LabVIEW 2012. It should still work in LabVIEW 2013, but its untested.
In LabVIEW 2013 and newer Web Services can communicate with LabVIEW applications using globals, queues, notifiers and other type of inter-process communication. You no longer have to use Shared Variables and other network inter-process communication to move data between your Web service and your app. This idea works well with the actor framework, and my example should be able to be augmented to make this happen.
Good luck!