# Reading data from global variables using an iodata in node

You can read data from global variables and inject them into a flow.

## NOTICE

Using multiple data-handling nodes with small polling intervals may overburden the CPU and slow down the device. Whenever possible, use only one node to handle all data and modify the data using other nodes.

## NOTICE

The output format of the iodata in node depends on the IEC 61131-3 data type of the related global variable, e. g. INT may yield a positive or negative integer while WORD always yields a positive integer.

1. You must create global variables in the real-time application and deploy the changes, before you can use these global variables in Node-RED.

1. Open Node-RED.
2. Add an iodata in node from the Weidmüller category to the workspace.
3. Double-click the iodata in node to open the Edit node dialogue.
4. In the drop-down list Mode, select whether you want to fetch a single global variable or all global variables.
5. If you selected the single variable mode, select the variable you want to fetch in the drop-down list Variable.

6. ## NOTICE

   If the desired variable is not displayed, check whether you have created that variable and deployed the changes.

7. In the frame Polling, specify the polling interval by entering a value in the text box and selecting a unit from the drop-down list.

8. ## NOTICE

   Specify polling intervals as large as possible to reduce CPU load.

9. Click Done to apply your changes.
10. Add more nodes to the workspace and connect them to a flow with the iodata in node being the first node.

1. After deploying the flow, the iodata in node injects a message containing the variable data into the flow at the specified polling interval.