Presentation on theme: "WEB SERVICES in LabVIEW María del Campo IFCA-CSIC, Spain October 22, 2009, Garching."— Presentation transcript:
WEB SERVICES in LabVIEW María del Campo email@example.com IFCA-CSIC, Spain October 22, 2009, Garching
LabVIEW is a graphical programming environment which offers unrivaled hardware integration and advanced analysis and data visualization tools. Main features: Easy and quick programming. Hardware integration. Advanced analysis. Multiple targets and OS. Multiple programming approaches. Professional User Interfaces. Multicore programming. Support and Services. What is LabVIEW?
LabVIEW Web Services Remotely monitor and control LabVIEW applications using custom thin clients, from any Web-enabled device. Establish machine-to-machine communication using standard HTTP protocols. Stream any standard MIME data types, such as text, images or videos.
LabVIEW Web Services RESTful architecture, which provides: Firewall-friendly communication. Minimal additional markup. Defined by: URI MIME data type Set of operations supported using HTTP methods
Instrument monitoring applications, as.exe files. Set of LabVIEW web services built and deployed, available through POST and GET HTTP methods. ECOHYDROS APPLICATION: Server side
Client side very simple: Base myREST class implementing basic HTTP operations over a certain WS endpoint. This class is extended for each kind of sensor/service adding methods for creating and managing specific parameters/responses for each sensor/service. Standalone Java implementation with no requirements for additional libraries. package myREST; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; ECOHYDROS APPLICATION: Client side
Messages interchanged with the Labview WS intended to be syntactically very simple. Proccesing complex messages from LabView side adds unneccesary overload to the VI implementations. Important to consider the time response of each device, which can result in a timeout error from the server. Easy solution: Tune the value of the HTTP connection ReadTimeOut in java. // Initializes the connection conn = (HttpURLConnection) serverAdd.openConnection(); conn.setRequestMethod("GET"); conn.setDoOutput(true); // Timeout to be set accordingly to the Tribox sampling rate conn.setReadTimeout(100000); conn.connect(); ECOHYDROS APPLICATION: Issues