Skip to content

Node-RED Flow Examples

How to read an analogue input?

Copy this flow and take it to Node-Red.

[
   {
      "id":"498995e7.9b914c",
      "type":"tab",
      "label":"Flow 2",
      "disabled":false,
      "info":""
   },
   {
      "id":"c1f65e40.87604",
      "type":"12AI",
      "z":"498995e7.9b914c",
      "name":"",
      "modNumEnabled":false,
      "modNum":"1",
      "modConfig":"1e10c374.fa242d",
      "x":112.94998168945312,
      "y":330.0332946777344,
      "wires":[
         [
            "8438b994.14d738"
         ]
      ]
   },
   {
      "id":"8438b994.14d738",
      "type":"switch",
      "z":"498995e7.9b914c",
      "name":"Voltage",
      "property":"payload.voltage.index",
      "propertyType":"msg",
      "rules":[
         {
            "t":"eq",
            "v":"0",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"1",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"2",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"3",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"4",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"5",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"6",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"7",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"8",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"9",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"10",
            "vt":"str"
         },
         {
            "t":"eq",
            "v":"11",
            "vt":"str"
         }
      ],
      "checkall":"true",
      "repair":false,
      "outputs":12,
      "x":282.8833312988281,
      "y":330.8833312988281,
      "wires":[
         [
            "a086861c.9c93d8"
         ],
         [
            "5405272b.ed1b28"
         ],
         [
            "a59d74f1.7a7c98"
         ],
         [
            "4d0fd8e5.2feed8"
         ],
         [
            "3c867b66.f0d624"
         ],
         [
            "2adfc4ab.73330c"
         ],
         [
            "d3dffb73.60b578"
         ],
         [
            "481d23fa.f286cc"
         ],
         [
            "33b7e78f.437288"
         ],
         [
            "e9c8574f.311fd8"
         ],
         [
            "2d6bdf64.1f2f4"
         ],
         [
            "cebae789.420718"
         ]
      ]
   },
   {
      "id":"2aa0e5fd.a8972a",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":616.066650390625,
      "y":81.51667785644531,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"a086861c.9c93d8",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":484.06671142578125,
      "y":81.88333129882812,
      "wires":[
         [
            "2aa0e5fd.a8972a"
         ]
      ]
   },
   {
      "id":"612351d6.a9cac",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":613.9999694824219,
      "y":128.4166717529297,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"5405272b.ed1b28",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":482.0000305175781,
      "y":128.7833251953125,
      "wires":[
         [
            "612351d6.a9cac"
         ]
      ]
   },
   {
      "id":"86a2b167.83178",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":613.9999694824219,
      "y":177.4166717529297,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"a59d74f1.7a7c98",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":482.0000305175781,
      "y":177.7833251953125,
      "wires":[
         [
            "86a2b167.83178"
         ]
      ]
   },
   {
      "id":"9aacccf2.5b5bf",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":613.9999694824219,
      "y":225.4166717529297,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"4d0fd8e5.2feed8",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":482,
      "y":226.78330993652344,
      "wires":[
         [
            "9aacccf2.5b5bf"
         ]
      ]
   },
   {
      "id":"c29f4a2a.b5cca8",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":613.9999694824219,
      "y":277.4166717529297,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"3c867b66.f0d624",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":482.0000305175781,
      "y":277.7833251953125,
      "wires":[
         [
            "c29f4a2a.b5cca8"
         ]
      ]
   },
   {
      "id":"4316897a.dc77d8",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":612.9999694824219,
      "y":325.4166717529297,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"2adfc4ab.73330c",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":481.0000305175781,
      "y":325.7833251953125,
      "wires":[
         [
            "4316897a.dc77d8"
         ]
      ]
   },
   {
      "id":"409a4053.65d89",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":610.9999694824219,
      "y":372.4166717529297,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"d3dffb73.60b578",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":479.0000305175781,
      "y":372.7833251953125,
      "wires":[
         [
            "409a4053.65d89"
         ]
      ]
   },
   {
      "id":"66dfd3eb.cd62dc",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":608.88330078125,
      "y":418.8833312988281,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"481d23fa.f286cc",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":476.88336181640625,
      "y":419.24998474121094,
      "wires":[
         [
            "66dfd3eb.cd62dc"
         ]
      ]
   },
   {
      "id":"bc912b24.eb0758",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":608.88330078125,
      "y":466.8833312988281,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"33b7e78f.437288",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":476.8833312988281,
      "y":468.2499694824219,
      "wires":[
         [
            "bc912b24.eb0758"
         ]
      ]
   },
   {
      "id":"7df2e3e6.2adebc",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":608.88330078125,
      "y":518.8833312988281,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"e9c8574f.311fd8",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":476.88336181640625,
      "y":519.2499847412109,
      "wires":[
         [
            "7df2e3e6.2adebc"
         ]
      ]
   },
   {
      "id":"75058bc3.09e504",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":607.88330078125,
      "y":566.8833312988281,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"2d6bdf64.1f2f4",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":475.88336181640625,
      "y":567.2499847412109,
      "wires":[
         [
            "75058bc3.09e504"
         ]
      ]
   },
   {
      "id":"27595cff.46ef64",
      "type":"ui_slider",
      "z":"498995e7.9b914c",
      "name":"",
      "label":"slider",
      "tooltip":"",
      "group":"f1a90a04.67b3c8",
      "order":0,
      "width":0,
      "height":0,
      "passthru":true,
      "outs":"all",
      "topic":"topic",
      "topicType":"msg",
      "min":0,
      "max":10,
      "step":1,
      "x":605.88330078125,
      "y":613.8833312988281,
      "wires":[
         [

         ]
      ]
   },
   {
      "id":"cebae789.420718",
      "type":"function",
      "z":"498995e7.9b914c",
      "name":"",
      "func":"msg.payload = msg.payload.voltage.value;\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "x":473.88336181640625,
      "y":614.2499847412109,
      "wires":[
         [
            "27595cff.46ef64"
         ]
      ]
   },
   {
      "id":"1e10c374.fa242d",
      "type":"12AI-Config",
      "z":"",
      "name":"Time Interval",
      "sampleRatePeriodMs":"200",
      "modeI1":"voltage",
      "modeI2":"voltage",
      "modeI3":"voltage",
      "modeI4":"voltage",
      "modeI5":"voltage",
      "modeI6":"voltage",
      "modeI7":"voltage",
      "modeI8":"voltage",
      "modeI9":"voltage",
      "modeI10":"voltage",
      "modeI11":"voltage",
      "modeI12":"voltage",
      "eventMode":"interval",
      "intervalMs":"1500",
      "threshold":"1",
      "lowLimit":"",
      "highLimit":"10"
   },
   {
      "id":"f1a90a04.67b3c8",
      "type":"ui_group",
      "z":"",
      "name":"Default",
      "tab":"107b9000.73e74",
      "order":1,
      "disp":true,
      "width":"6",
      "collapse":false
   },
   {
      "id":"107b9000.73e74",
      "type":"ui_tab",
      "z":"",
      "name":"AI7PR2 Controls",
      "icon":"dashboard",
      "disabled":false,
      "hidden":false
   }
]