## 3 Proposed Scheduler to integrate the MES and AIV
### LabVIEW-MES Communication  
This section provides details about how LabVIEW communicates with MES webservices. As mentioned before, the webservice development is out of the scope of this paper and the webservices needed for this project are developed and provided by the industrial partner. For this section,an example of a single MES webservice named _'WebserviceA'_ is considered, that provides details about the status of pickup locations. The same method is valid for all the webservices mentioned in Section 3.3. Firstly, the mentioned webservice is imported into LabVIEW using the WSDL (WebService Description Language) link. The WSDL link describes information about the specific webservice. This information includes the available operations (functions or methods) and data types. The successful import operation of webservice loaded the equivalent LabVIEW VI (Virtual Instrument) along with some additional VIs, which are necessary to build a communication link with the MES. Most parameters of the imported webservice are not simple values but are references to the.NET objects, this is shown in the front panel of VI in Figure 4. This VI cannot be used as-is because we need the request and response objects to communicate with the MES. So, the VI is edited using.NET functions in LabVIEW to create the request and response.NET objects and to set properties or to call methods on those objects. The block diagram to add request and response objects is given in Figure 5 and explained below. To create the request object for the selected webservice _'WebserviceA'_, the constructor node is used with the object _'WebserviceAREQ'_. This constructor node is connected to the property node, which displays the request parameters of the webservice. Here, the request parameters are _'operation'_ and _'resourced'_. The _'Operation'_ input can be configured with PICK (for PICK operation) or DROP  
Figure 4: Front panel of _‘WebserviceA’_ webservice (before edits). Figure 5: Block diagram to edit LabVIEW VI of imported webservices. (for DROP operation). The _resourced_ is a virtual representation of the physical location so it can be configured with PICK1 to represent pickup location 1 or DROP1 to represent drop-off location 1. The _resourced_ is selected based on the configured operation. The scheduler supports a number of pickup and drop-off locations (for details, see Section 3.3). Details about the selection of pickup and drop-off locations are given in Sections 3.3.2 and 3.3.6, respectively. Another constructor node is created with the '_WebserviceA_' object, which connects with the invoke node through the property node, to invoke a method called '_WebserviceA_'. The invoke node connects with open and close webservice VIs. The invoke node is connected to a new property node to return the response of '_WebserviceA_' method. This response is read by the property node of '_WebserviceARSP_' object. The response terminals of this property node are connected to LabVIEW indicators, while '_FOR Loop_' and '_Nested Loop_' are used to extract the response. The number of '_FOR loop_' depends on the number of pickup or drop-off locations. Similarly, the number of '_Nested loop_' depends on the number of products at the relevant pickup or drop-off locations. In the case of multiple loops, all '_FOR Loop_' will be connected to resourcelist, and all '_Nested Loop_' will be connected with sfcList (as shown in Figure 5) but the difference will be the Loop count. The information about the maximum number of pickup and drop-off locations and the maximum number of product support at each location should be known in advance to develop the scheduler accordingly. The edited VI front panel of the '_WebserviceA_' webservice is shown in Figure 6, where details of the product ready are shown under sfcList. In Figure 6, the _resourced_ response represents the location where the product is placed and _resourceStatus_ response represents the status of that location. If there is no product to pick at PICK1, then sfcList fields will be empty.