banner



How To Store And Use Values In Register

Flow to Save Multiple Register Values

Estimated reading fourth dimension: 2 minutes

Use Example for Saving Register Values from Multiple PLCs

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

Note: Fifty-fifty though information is collected at regular intervals, drove from each annals does not happen simultaneously. In club to aggregate multiple values, separate processing blocks are needed to save values to global variables, which then can be accessed by all flows, functions, and nodes.

Instance Flow for Saving Multiple Values

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

The following example saves annals values to a comma-separated-values file. A similar method could be used to salve values in a MySQL database.

Steps to Create a Flow to Save Values from Multiple Inputs

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

See also…

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

To save values from multiple registers to a CSV file:

  1. Interrogate a PLC register for a value.
    1. Use a Datahub Subscribe node.
    2. Configure the node with a DeviceHub raw topic.
    3. This will exist Output 1. The nerveless value volition be the first global value to be saved, as described in Step two.

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

  3. Edit the Role node and add together the following lines to save the value to a Global Variable (output1), which can exist accessed past other flows, nodes, and functions:

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

                    var temp = (JSON.parse(msg.payload)).value; global.set("output4",nothing); render msg;                              
  5. Employ an Inject node to inject a timestamp every 10 seconds to read the global variable values.

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

                    //create CSV var temp = global.get("output1") + "," + global.become("output2") + ","+global.go("output3") + ","+global.get("output4"); msg.payload = temp; return msg;                              
  8. Wire a File node to the Function node and edit it, equally shown below.
    Note: Be sure to Salve the period.

Configure the FTP Server Service

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

How To Store And Use Values In Register,

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

Posted by: mckenzienotilen.blogspot.com

0 Response to "How To Store And Use Values In Register"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel