12-12-2012 09:48 AM
Hello people,
I have a problem with a CRIO that I´m trying to install in some vehicles. The CRIO is used to acquire data from analogical sensors in the systems and then send this data to the company webservice. The problem is that the library created using the "Import Webservice" tool doesn´t work in CRIO systems. The question is how I send data to this webservice using my CRIO?
Thanks for the Help.
12-18-2012 10:11 AM
Web Services allow you to monitor and control an application running on a cRIO. The Web Service must have an entirely separate memory space to the main application. For this reason the usual methods of communication between two VI's such as single process shared variables will not work correctly.
To successfully transfer data between the application VI and the Web Service VI you must use a seperate set of variables for the Web Service and alias these to the set used by the main application.
The Figure below shows a project which contains the two variables, one for the application and one for the web serivce:
As an example if you have a numeric indicator called Temperature in the main application that you would like to monitor from the Web Service then you need to create two variables. The first variable will be a network published shared variable that will only be used within the main application and you will pass the Temperature data into this. You then create a second network published shared variable of the same data type to use in the Web Service VI. You enable aliasing on this variable and bind it to the previously created variable.
The figure below shows the variable creating screen, notice the option at the bottom to bind to a project variable. The Web Service variable should be bound to the project variable.
The aliased variable will be updated with the same data as the variable it is bound to. This aliased variable will allow the web service to receive the Temperature data passed into the variable in the main application. You will need to create two variables for each of the items you wish to transfer between the main application and Web Service.