banner



How To Use Values In Register

Menstruum to Salvage Multiple Register Values

Estimated reading time: two minutes

Use Case for Saving Register Values from Multiple PLCs

  • Collect raw data from various PLC registers.
  • Aggregate the data at regular intervals.
  • Save the aggregated data for use by other applications.

Note: Even though information is collected at regular intervals, collection from each register does non happen simultaneously. In order to amass multiple values, divide processing blocks are needed to save values to global variables, which then tin be accessed by all flows, functions, and nodes.

Case Catamenia for Saving Multiple Values

Goal: Collect data from different types of inputs and use multiple nodes in a flow to salvage values in a database or simply salvage values to a CSV file.

The post-obit example saves register values to a comma-separated-values file. A like method could be used to salve values in a MySQL database.

Steps to Create a Flow to Relieve Values from Multiple Inputs

The procedure shown here is a high-level description of the steps that need to be taken. Use these steps as a ground for configuring a flow specific to your requirements.

Come across also…

A similar method can be used to save values to a MySQL database. Meet Save Multiple Register Values to MySQL.

To save values from multiple registers to a CSV file:

  1. Interrogate a PLC annals for a value.
    1. Apply a Datahub Subscribe node.
    2. Configure the node with a DeviceHub raw topic.
    3. This volition be Output ane. The nerveless value will be the first global value to be saved, as described in Footstep ii.

  2. Wire a Function node to the Datahub Subscribe node.

  3. Edit the Part node and add the following lines to salvage the value to a Global Variable (output1), which can be accessed by other flows, nodes, and functions:

                    var temp = (JSON.parse(msg.payload)).value; global.set up("output1",temp); return msg;                              
  4. Repeat steps 1 through 3 for other PLC registers, resulting in Datahub Subscribe nodes: Output 2 through Output four (for this instance).
    Annotation that in some cases, you may have a demand to set a value to Null, equally shown in the following case.

                    var temp = (JSON.parse(msg.payload)).value; global.prepare("output4",null); return msg;                              
  5. Use an Inject node to inject a timestamp every 10 seconds to read the global variable values.

  6. Wire a Function node to the Inject node.
  7. Edit the Function node to gear up the format for the CSV file.

                    //create CSV var temp = global.become("output1") + "," + global.get("output2") + ","+global.get("output3") + ","+global.go("output4"); msg.payload = temp; return msg;                              
  8. Wire a File node to the Role node and edit information technology, every bit shown beneath.
    Note: Be sure to Save the catamenia.

Configure the FTP Server Service

Once the CSV file has been populated, export the file via the OT Link Platform FTP Server Service. Meet FTP Server.

Source: https://techlibrary.hpe.com/docs/otlink-wo/Flow-to-Save-Multiple-Register-Values.html

Posted by: johnsondeprectuod.blogspot.com

0 Response to "How To Use Values In Register"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel