====== Data source ====== #;; Patron Neuron Gate Unipi 1.1 Axon #;; Data source is a simplified definition of a PLC used in another solution. The basis of the definition are the communication parameters for connection to the PLC (local or proxy) and the *.exs file containing the definition of variables. This solution is suitable for use where it is necessary to connect several previously separate solutions that have been created either by the interaction of several programmers or by splitting an already too large assembly. It is recommended to have the solution in [[creating-new-project-hidden#switching_to_full_mode|Full mode]] before continue. ===== Usage ===== SSCP communication \\ Whatever the reason for using the data source, the SSCP protocol can also be used for data exchange between PLCs. More information can be found in the separate article [[multiple-unipi-through-sscp-hidden|]]. ---- SCADA \\ Thanks to the data source, adding PLCs to Mervis SCADA is possible without merging into one large solution. This is useful especially to keep clarity, logical division or if each PLC is managed/programmed by a different programmer. /*This use is described in detail in the [[separate-scada-solution-hidden|]] article.*/ ---- Webserver \\ The connection of the data source to the local web HMI, which is created as a webserver terminal, is possible in a similar way to the PLC. In this way, it is possible to display information from a PLC from another solution in one interface. Further information can be found in a separate [[creating-external-hmi-hidden|]] article. ===== Adding a data source to the solution ===== Adding a data source to the solution is done by selecting the **System** line at the top of the left solution panel, right-clicking and selecting **Add Data Source** from the context menu. {{ :en:sw:01-mervis:data-source:data_source_01_add_source.png?direct |}} The **Data Source** item will be added to the solution. {{ :en:sw:01-mervis:data-source:data_source_02_source_in_solution.png?direct |}} ==== Names ==== It is quite difficult to identify the PLC connected to the solution as a data source, so it is recommended to set a descriptive name for the data source and include details about the source solution (name, version, compile date, etc.) in a note. Both can be set in the data source properties in the right panel. In the example, the data source was named according to the source PLC (Axon S105). {{ :en:sw:01-mervis:data-source:data_source_03_change_name.png?direct |}} ==== Setting properties ==== For each data source it is necessary to define SSCP communication parameters that depend on the application. ---- Local For local communication, all PLCs must be on the same local area network (LAN). Locally, the data source can be used for [[multiple-unipi-through-sscp-hidden|data exchange via the SSCP protocol]] or for connection to an [[creating-external-hmi-hidden|external web terminal]]. However, a locally defined data source cannot be used for a SCADA terminal because the SCADA server is not running on the local network but in the cloud. For local communication, the IP address and a few other parameters available in the source solution are sufficient. * **Target address**: IP address of the source PLC * **TCP port**: 12346 (12347 for SSL) * **SSCP address**: usually 1 {{ :en:sw:01-mervis:data-source:data_source_04_parameters_local.png?direct |}} ---- Proxy Connecting a data source is also possible via [[connecting-to-unipi-via-mervis-proxy-hidden|Mervis Proxy]]. The proxy connection is ideal for connecting to SCADA, or for exchanging data via SSCP protocol in a large site where individual PLCs are either on separate networks or connected via [[lte-configuration-hidden|LTE]]. The connection to the proxy server must be active on the source PLC. The proxy setup is described in [[connecting-to-unipi-via-mervis-proxy-hidden|separate article]]. To connect via Mervis Proxy, you must set the following in the data source properties: * **Target address**: proxy.unipi.technology * **TCP port**: 12348 (12349 for SSL) * **Certificate validation**: optional for SSL, details [[ssl-certification-validation-hidden|here]] * **SSCP address**: mostly 1 {{ :en:sw:01-mervis:data-source:data_source_05_proxy_parameters.png?direct |}} ==== .exs file ==== In general, an .exs file is an executable image (Shark Executable Image). In this case it can be said that it is a definition of all variables that are available in a PLC (inputs, outputs, in the program). This file is generated together with the solution files in the **bin** directory, every time the solution is compiled. First, it is necessary to select the data source in the left panel of the solution to display the data source properties in the right panel. In the properties, the *.exs file from the chosen solution is selected for the "Executable Image Path" parameter: {{ :en:sw:01-mervis:data-source:data_source_06_exs_file.png?direct |}} **WARNING!** When moving solution folders, take extra caution and reattach the *.exs file if the path is unlinked. Otherwise, you will not be able to compile the solution or use the data source variables.