Skip to content

Using array nodes

A simple array is defined with a sine signal wave. The scenario is to filter and map values.

Objective

To filter the elements which are greater than 0 from an array and map them by adding an added value of 100. Also, it is required to display the sine wave generated in the message payload.

Procedure

To connect the array node with the signal wave, follow these steps:

  1. From the node palette, drag and drop the following nodes from the respective palette to the working area:

    • Inject node
    • Generate node
    • Filter node
    • Map node
    • Debug node

    Connect the nodes in a flow as shown below:

    Connect all nodes

  2. Double click on "inject" node to edit the properties. For more information, refer to Editing nodes.

  3. Double click on "generate" node to edit the properties.

    • Enter the "Name".
    • In the "Mode" section, you can select any one of the options from the dropdown menu.
    • In the "Period" section, you can select any one of the options from the dropdown menu.
    • In the "Basis unit" section, you can select any one of the options from the dropdown menu.
    • To add the signal, click plus.
    • Click "Done".

      Edit generated node

  4. Double click on "filter" node to edit the properties.

    • Enter the "Name".
    • Enter the "Filter function".
    • Click "Done".

      Edit filter node

  5. Double click on "map" node to edit the properties.

    • Enter the "Name".
    • Enter the code in the "Map function".
    • Check the box "Multiline function body", if required.
    • Click "Done".

      Edit map node

  6. Save and execute the flow.

The values are mapped in the objects and the necessary sine wave has also been generated in the message payload:

Output


Last update: March 18, 2025