====== Examples ====== ===== Modbus TCP Client Using CloudAccess ===== {{:en:mervis-scada:70-generator:modbus_excel.png?direct&800|}} * A well formatted mapping file needs to be created * Download example: {{ :en:mervis-scada:70-generator:ca_modbus.xlsx |}} * **Important** * Use unique GUIDs * Online generator: https://guidgenerator.com/online-guid-generator.aspx * Do NOT use public IP address for communication. Use [[en:mervis-cloudaccess:|CloudAccess]] instead * Go to https://generator.mervis.info, select mapping file and paste parameters (or select .txt file) * **Important** * Use unique GUID for a new project * Use correct Mervis DB info * Working DB URL * User name, password * Unique "Root" key for each project ==== Modbus ==== === Supported data types === | Bit | | UInt8 | | SInt8 | | UInt16 | | SInt16 | | UInt32 | | SInt32 | | Float32 | | Float64 | | SInt48 | | UInt48 | | SInt64 | | UInt64 | === Supported Modbus functions === ^ Function ^ Code ^ | ReadCoils | 1 | | ReadDiscreteInputs | 2 | | ReadHoldingRegister | 3 | | ReadInputRegister | 4 | ^ Function ^ Code ^ | WriteSingleCoil | 5 | | WriteMultipleCoils | 15 | | WriteSingleRegister | 6 | | WriteMultipleRegisters| 16 | ==== Generator Parameters ==== --sourceType MervisDb --projId ecd6fa5d-78c1-4120-9b11-23521bee7688 --projName "AnyNameWouldDoModbus" --projTimeZone "Europe/Prague" --mdbConnStr "rcwaredb://uuuuuser:ppppasword@db.mervis.info:443/?protocol=https,endpoint=RcWareDbHttpsAccess,uriaccess=db/imports5/RcWareDbAccess" --mdbDpNameKey {FixedName} --mdbSourceKeys "(Root|ahoj|true)" --mdbTreeLevelKeys Level1/Level2 --outputDirectory ecd6fa5d-78c1-4120-9b11-23521bee7688 --useDbV2 --mdbUnitKey Unit --mdbExportOnlyIdKeys --dbWriteModeOn --dbWriteModeSamplingInterval 180 --dbEnableWriteFromDriver --dbWriteModeDecimals 2 --notSortDataPoints --dpVisualDecimals 2 --mdbReadGroupUpdateInterval 10 ===== MervisDB project with Datapoint Transformations and Alarms ===== * A well formatted mapping file needs to be created * Download example: {{ :en:mervis-scada:70-generator:mervisdb_example.xlsx |}} * **Important** * Use unique GUIDs * Online generator: https://guidgenerator.com/online-guid-generator.aspx * When you extend this example with a Driver and DriverChannelParameters, do NOT use public IP address for communication. Use [[en:mervis-cloudaccess:|CloudAccess]] instead * Go to https://generator.mervis.info, select mapping file and paste parameters (or select .txt file) * **Important** * Use unique GUID for a new project * Use correct Mervis DB info * Working DB URL * User name, password * Unique "Root" key for each project ==== Generator Parameters ==== --sourceType MervisDb --projId e519e6ab-3971-4504-ba2a-9db81c723c1e --projName "ExampleMervisDb" --projTimeZone "Europe/Prague" --mdbConnStr "rcwaredb://uuuuuser:ppppasword@db.mervis.info:443/?protocol=https,endpoint=RcWareDbHttpsAccess,uriaccess=db/imports5/RcWareDbAccess" --mdbDpNameKey {FixedName} --mdbSourceKeys "(Root|ahoj|true)" --mdbTreeLevelKeys Level1/Level2 --outputDirectory e519e6ab-3971-4504-ba2a-9db81c723c1e --useDbV2 --mdbUnitKey Unit --mdbExportOnlyIdKeys --dbWriteModeOn --dbEnableWriteFromDriver --dbWriteModeDecimals 4 --dpVisualDecimals 3 ===== SSCP Client with PLC communication ===== * A well formatted mapping file needs to be created * Download example: {{ :en:mervis-scada:70-generator:sscp_plc_example.xlsx |}} * **Important** * Use unique GUIDs * Online generator: https://guidgenerator.com/online-guid-generator.aspx * Go to https://generator.mervis.info, select mapping file and paste parameters (or select .txt file) * **Important** * Use unique GUID for a new project * Use correct Mervis DB info * Working DB URL * User name, password * Unique "Root" key for each project ==== SSCP ==== Information regarding defining SSCP driver columns in mapping file: [[https://kb.mervis.info/doku.php/en:mervis-scada:70-generator:20-help?tns#sscp_driver_columns_used_with_driversscp|SSCP Driver Columns (used with Driver: SSCP)]] ==== Generator Parameters ==== --sourceType MervisDb --projId ed18bc18-972a-457a-bc4b-fa96f3a14fb9 --projName "ExampleSSCP" --projTimeZone "Europe/Prague" --mdbConnStr "rcwaredb://uuuuuser:ppppasword@db.mervis.info:443/?protocol=https,endpoint=RcWareDbHttpsAccess,uriaccess=db/imports5/RcWareDbAccess" --mdbDpNameKey {FixedName} --mdbSourceKeys "(Root|ahoj|true)" # is ignored --mdbTreeLevelKeys Level1/Level2 --outputDirectory ed18bc18-972a-457a-bc4b-fa96f3a14fb9 --useDbV2 --mdbUnitKey Unit --mdbExportOnlyIdKeys --dbWriteModeOn --dbEnableWriteFromDriver --dbWriteModeDecimals 4 --dpVisualDecimals 3 ===== Client Connecting to PLC via Proxy Using Metadata ===== * The Project Generator connects to the PLC through a proxy. The project is generated using metadata downloaded from the PLC. * Go to https://generator.mervis.info, enter the parameters (or select a .txt file). * **Important** * Use a unique GUID for a new project. ==== Generator Parameters ==== --sourceType SharkPlc --projId f6f6cfdd-7b7e-4fef-94ad-1cc573c4919f --projName "ExamplePLC" --projTimeZone Europe/Prague --connectionType Proxy --proxyId iiiiiii --host proxy.mervis.info --port 12349 --ssl true --plcUser uuuuuuu --plcPassword ppppppp --mdbDpNameKey {VariableName} --mdbUnitKey Unit --outputDirectory f6f6cfdd-7b7e-4fef-94ad-1cc573c4919f ===== Amit WebSocket - Integration ===== * In addition to using DB-net via the Mervis service [[en:mervis-proxy:db-net|Amit Proxy]], Amit now offers native support for the [[en:mervis-cloudaccess:00-start#amit_-_websocket_communication|Mervis CloudAccess]] technology and its own **WebSocket** protocol directly in the latest controllers. * The **Mervis SCADA project** is generated solely using an Excel mapping ''XLSX'' file, which must contain all the necessary data for creating all data points. * You can generate the **mapping file** using the helper application ''AmitWebSocketUtil.exe'' directly from the project uploaded to the PLC * Example mapping file available for download: [[https://drive.google.com/open?id=1090Oc1m3f8P97I7t-ls9uPD-w7iagSHc&usp=drive_fs|mapping-amit.xlsx]] * **Procedure** * Configure communication to the CloudAccess server in the PLC: [[en:mervis-cloudaccess:00-start#amit_-_websocket_communication|DetStudio - CloudAccess configuration]] * Generate a CSV file based on the example below and save it as XLSX * Optionally adjust the file according to your needs * Go to https://generator.mervis.info, enter the parameters (or select a .txt file) and upload your XLSX mapping file ==== AmitWebSocketUtil ==== * Download: [[https://drive.google.com/open?id=1090Oc1m3f8P97I7t-ls9uPD-w7iagSHc&usp=drive_fs|AmitWebSocketUtil.exe and mapping-amit.xlsx]] .\AmitWebSocketUtil.exe ^ --host cloudaccess.mervis.info ^ --port 23000 ^ --use-cloud-access true ^ --ca-channel iiiii^ --ca-user uuuuu ^ --ca-password ppppp ^ --output-file amit_websocket_variables.csv ^ --hash-string AmitWSTest ^ --comm-params "{\"host\": \"cloudaccess.mervis.info\", \"port\": 80, \"useCloudAccess\": \"true\", \"cloudAccess\": {\"host\": \"cloudaccess.mervis.info\", \"port\": 23000, \"ssl\": \"true\", \"channelId\": \"iiiii\", \"user\": \"uuuuu\", \"password\": \"ppppp\"}" ==== Generator Parameters ==== * Use a randomly generated Project ID (generator: https://guidgenerator.com/online-guid-generator.aspx) * Enter a valid ChannelID, username, and password for connecting to the CloudAccess service * Enter the correct username and password for Mervis DB --sourceType MervisDb --projId f481fd8d-fb10-443f-9747-62458e42aaa --projName "amit-ws-test" --projTimeZone "Europe/Prague" --mdbConnStr "rcwaredb://amit_ws_example:amit_password@db.mervis.info:443/?protocol=https,endpoint=RcWareDbHttpsAccess,uriaccess=db/imports4/RcWareDbAccess" --mdbDpNameKey {FixedName} --mdbSourceKeys "(Foo|bar|false)" --mdbTreeLevelKeys {FixedLevel1} --mdbExportOnlyIdKeys --outputDirectory f481fd8d-fb10-443f-9747-62458e424aaa --useDbV2 --mdbCommErrorIntervalMultiple 2000 --dbWriteModeOn --dbWriteModeSamplingInterval 180 --dbWriteModeDecimals 2