Raspberry PI Revolution - Programming with Node-Red

Поділитися
Вставка
  • Опубліковано 7 жов 2024
  • An introduction to programming the Kunbus Revolution PI using various modules and communicating between a RevPi Connect and a RevPi Core 3 via an Ethernet/IP gateway module
    This is a first level programming example, so I do not go into to much depth but it is a technical video and is an hour long. you have been warned.
    I will show how to configure flows on node red to interact with the Rev Pi expansion using AIO and DIO modules and also the Ethernet/IP gateway module that supports Modbus in addition to Ethernet/IP
    You will see how to create dashboard (WEB UI) screens to show what is happening and also perform basic control of IO, even on the remote machine.
    All Node-Red flows etc will be posted to design spark so you can re-produce the sample on your own system. I will add links as soon as they are there.
    All parts for this tutorial were kindly provided by RS-Components
    Links to all components will be added soon.

КОМЕНТАРІ • 20

  • @TheMadMagician87
    @TheMadMagician87 5 років тому

    Great intro to the Revolution Pi in this video series, thanks!

  • @muhammadatif1696
    @muhammadatif1696 5 років тому

    Great!
    as you have mentioned in the description of this video that All Node-Red flows etc will be posted to design spark so you can re-produce the sample on your own system. I will add links as soon as they are there.
    so, can you please share all node-red flows?
    Thanks!

  • @crismancich
    @crismancich 3 роки тому

    You can now go without the piTest.
    The new Buster image has NodeRed pre-installed and offers nodes to interact with the IOs.

  • @sagaradhau1526
    @sagaradhau1526 3 роки тому

    Hi Thanks for video, any installation guide for this Pi connect. To avaoid chimeny effect Or heat dissipation. Please suggest.

    • @TheBreadboardca
      @TheBreadboardca  3 роки тому

      Being a DIN rail mounted product I would say it is designed to expect to be mounted vertical in a way that would be the same when in a case on a wall

  • @sutheshnaidu5364
    @sutheshnaidu5364 5 років тому +1

    Hi sir can you send your node red code for the temperature reading

    • @TheBreadboardca
      @TheBreadboardca  5 років тому +1

      This is the flow for reading the Analog input Temp sensor and the RTD including display of it
      [{"id":"3bc96220.e611de","type":"ui_chart","z":"25772a45.d1a976","name":"","group":"30cd6b17.dabee4","order":0,"width":0,"height":0,"label":"RTD Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#ff0000","#aec7e8","#142cfa","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1170,"y":200,"wires":[[],[]]},{"id":"6f8b57dc.1141e8","type":"function","z":"25772a45.d1a976","name":"","func":"//var input = parseFloat(msg.value1);
      msg.payload = msg.payload/100;
      if (msg.payload > 100){msg.payload=\"\"}
      return msg;","outputs":1,"noerr":0,"x":1010,"y":200,"wires":[["3bc96220.e611de","6b741948.56da98"]]},{"id":"6c3df6ed.e45b08","type":"switch","z":"25772a45.d1a976","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Encoder","vt":"str"},{"t":"eq","v":"Temperature","vt":"str"},{"t":"eq","v":"RTD","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":870,"y":140,"wires":[["63146c4d.b20dd4"],["574d23bb.fbf4ec"],["6f8b57dc.1141e8"]]},{"id":"6b741948.56da98","type":"debug","z":"25772a45.d1a976","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1170,"y":320,"wires":[]},{"id":"63146c4d.b20dd4","type":"ui_numeric","z":"25772a45.d1a976","name":"","label":"numeric","tooltip":"","group":"123f1e74.5fa762","order":0,"width":0,"height":0,"passthru":true,"topic":"Encoder","format":"{{msg.payload}}","min":0,"max":"32768","step":1,"x":1060,"y":100,"wires":[[]]},{"id":"574d23bb.fbf4ec","type":"function","z":"25772a45.d1a976","name":"","func":"//var input = parseFloat(msg.value1);
      msg.payload = msg.payload/100;
      return msg;","outputs":1,"noerr":0,"x":1010,"y":160,"wires":[["8b1563b7.c4733","6b741948.56da98"]]},{"id":"902593be.92518","type":"function","z":"25772a45.d1a976","name":"","func":"var value = parseInt(msg.payload) == NaN ? 0 : parseInt(msg.payload);
      msg.payload = value;
      return msg;","outputs":1,"noerr":0,"x":710,"y":100,"wires":[["6132fe03.4414c","6c3df6ed.e45b08","fde14686.8beb28"]]},{"id":"8b1563b7.c4733","type":"ui_chart","z":"25772a45.d1a976","name":"","group":"30cd6b17.dabee4","order":0,"width":0,"height":0,"label":"Zero Touch IR Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#ff8000","#aec7e8","#142cfa","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1200,"y":160,"wires":[[],[]]},{"id":"42466a42.b6c1d4","type":"exec","z":"25772a45.d1a976","command":"piTest -1 -q -r ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"piTest Read","x":550,"y":100,"wires":[["902593be.92518"],[],[]]},{"id":"6132fe03.4414c","type":"link out","z":"25772a45.d1a976","name":"PiTest","links":["f6cc4bbf.c82a98"],"x":835,"y":60,"wires":[]},{"id":"fde14686.8beb28","type":"debug","z":"25772a45.d1a976","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":890,"y":20,"wires":[]},{"id":"7e0b9f33.2b913","type":"inject","z":"25772a45.d1a976","name":"","topic":"Temperature","payload":"InputValue_1","payloadType":"str","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":80,"wires":[["42466a42.b6c1d4"]]},{"id":"f4a2e0bf.b5a5b","type":"inject","z":"25772a45.d1a976","name":"","topic":"","payload":"InputValue_2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":120,"wires":[["42466a42.b6c1d4"]]},{"id":"d745fb68.60e9a8","type":"inject","z":"25772a45.d1a976","name":"","topic":"Encoder","payload":"Counter_1","payloadType":"str","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":300,"y":40,"wires":[["42466a42.b6c1d4"]]},{"id":"12b11536.d15f3b","type":"inject","z":"25772a45.d1a976","name":"","topic":"RTD","payload":"RTDValue_1","payloadType":"str","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":160,"wires":[["42466a42.b6c1d4"]]},{"id":"30cd6b17.dabee4","type":"ui_group","z":"","name":"LAB Temperature","tab":"c21d8268.2e9a","disp":true,"width":"6","collapse":false},{"id":"123f1e74.5fa762","type":"ui_group","z":"","name":"Encoder","tab":"c21d8268.2e9a","disp":true,"width":"6","collapse":false},{"id":"c21d8268.2e9a","type":"ui_tab","z":"","name":"RevPI Connect","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
      Have fun

    • @sutheshnaidu5364
      @sutheshnaidu5364 5 років тому

      @@TheBreadboardca Thank you so much

  • @ren00ab
    @ren00ab 5 років тому

    He hi, I have some problems trying to connect my DIO, I guess I have some missundetanding with the term of "common" like PLC, I know the inputs are +24 V sensitive. Maybe you have some schematic wiring about it. I'll really appreceiaty it. Thanks

    • @TheBreadboardca
      @TheBreadboardca  5 років тому

      The trick with these is that you must connect a separate supply to the IO. the power to the module logic is completly isolated from the IO and therefor it would appear as floating to the inputs. you could wire the IO supplies in parallel to the module supply if thats ok with your installation.

    • @TheBreadboardca
      @TheBreadboardca  5 років тому

      forgot a link to the pinout revolution.kunbus.com/wp-content/uploads/manuell/Pinout_IO_modules.pdf

    • @ren00ab
      @ren00ab 5 років тому

      ​@@TheBreadboardca okok Thanks, I already connected separately the porwer and the IO supply, so I tried to connect a push button from the Input to a +24V but i didn't see any change in the state I even wired it directly and didn't works. Any thoughts?

  • @squalazzo
    @squalazzo 5 років тому

    hi, what's that SONOFF node in your nodered palette? Can't find it...

    • @TheBreadboardca
      @TheBreadboardca  5 років тому

      it is simply a subflow... here :)
      [{"id":"898abb8.06b2548","type":"subflow","name":"SONOFF","info":"","category":"","in":[{"x":180,"y":140,"wires":[{"id":"9a777985.881598"}]}],"out":[{"x":900,"y":80,"wires":[{"id":"25607b40.4eed94","port":0}]},{"x":900,"y":120,"wires":[{"id":"9a777985.881598","port":"1"}]},{"x":900,"y":160,"wires":[{"id":"a4320087.8d098","port":0}]},{"x":900,"y":200,"wires":[{"id":"ce94a5ef.160c28","port":0}]}],"outputLabels":["STATE","POWER","SENSOR","RESULT"]},{"id":"9a777985.881598","type":"switch","z":"898abb8.06b2548","name":"tasmota","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"STATE","vt":"str"},{"t":"cont","v":"POWER","vt":"str"},{"t":"cont","v":"SENSOR","vt":"str"},{"t":"cont","v":"RESULT","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":300,"y":140,"wires":[["d804d0d1.24b7c"],[],["cf9daa54.4c1dd8"],["ce94a5ef.160c28"]],"outputLabels":["","Power","Sensor",""]},{"id":"7fe77cc0.e7b964","type":"function","z":"898abb8.06b2548","name":"","func":"if (msg.payload.DS18B20)
      {
      msg.payload.type='Environment';
      msg.payload.Temperature = Math.round(msg.payload.DS18B20.Temperature);
      msg.payload.Humidity = 0;
      msg.payload.Pressure = 0;
      }
      else if (msg.payload.AM2301)
      {
      msg.payload.type='Environment';
      msg.payload.Temperature = Math.round(msg.payload.AM2301.Temperature);
      msg.payload.Humidity = Math.round(msg.payload.AM2301.Humidity);
      msg.payload.Pressure = 0;
      }else if (msg.payload.DHT11)
      {
      msg.payload.type='Environment';
      msg.payload.Temperature = Math.round(msg.payload.DHT11.Temperature);
      msg.payload.Humidity = Math.round(msg.payload.DHT11.Humidity);
      msg.payload.Pressure = 0;
      }
      else if (msg.payload.BME280)
      {
      msg.payload.type='Environment';
      msg.payload.Temperature = Math.round(msg.payload.BME280.Temperature);
      msg.payload.Humidity = Math.round(msg.payload.BME280.Humidity);
      msg.payload.Pressure = Math.round(msg.payload.BME280.Pressure);
      }
      else if (msg.payload.ENERGY)
      {
      msg.payload.type='Energy';
      msg.payload.Total = msg.payload.ENERGY.Total;
      msg.payload.Yesterday = msg.payload.ENERGY.Yesterday;
      msg.payload.Today = msg.payload.ENERGY.Today;
      msg.payload.Period = msg.payload.ENERGY.Period;
      msg.payload.Power = msg.payload.ENERGY.Power;
      msg.payload.ApparentPower = msg.payload.ENERGY.ApparentPower;
      msg.payload.ReactivePower = msg.payload.ENERGY.ReactivePower;
      msg.payload.Factor = msg.payload.ENERGY.Factor;
      msg.payload.Voltage = msg.payload.ENERGY.Voltage;
      msg.payload.Current = msg.payload.ENERGY.Current;
      }
      return msg;","outputs":1,"noerr":0,"x":570,"y":160,"wires":[["a4320087.8d098"]]},{"id":"cf9daa54.4c1dd8","type":"json","z":"898abb8.06b2548","name":"","x":450,"y":160,"wires":[["7fe77cc0.e7b964"]]},{"id":"d804d0d1.24b7c","type":"json","z":"898abb8.06b2548","name":"","x":450,"y":80,"wires":[["25607b40.4eed94"]]},{"id":"25607b40.4eed94","type":"moment","z":"898abb8.06b2548","name":"","topic":"","input":"payload.Time","inputType":"msg","inTz":"ETC/GMT","adjAmount":0,"adjType":"days","adjDir":"add","format":"lll","locale":"en_CA","output":"payload.Time","outputType":"msg","outTz":"America/Toronto","x":740,"y":80,"wires":[[]]},{"id":"ce94a5ef.160c28","type":"json","z":"898abb8.06b2548","name":"","x":450,"y":200,"wires":[[]]},{"id":"a4320087.8d098","type":"moment","z":"898abb8.06b2548","name":"","topic":"","input":"payload.Time","inputType":"msg","inTz":"ETC/GMT","adjAmount":0,"adjType":"days","adjDir":"add","format":"lll","locale":"en_CA","output":"payload.Time","outputType":"msg","outTz":"America/Toronto","x":740,"y":160,"wires":[[]]}]
      Enjoy

  • @ivanchonin6747
    @ivanchonin6747 3 роки тому

    How fast is this system?Do you think it can be used for industrial automation ?

    • @TheBreadboardca
      @TheBreadboardca  3 роки тому

      These are for industrial Automation already, that is what there designed for

    • @TheBreadboardca
      @TheBreadboardca  3 роки тому

      The higher level PI portion runs at the speed of the Compute module 3, all the IO modules run with their own MPU and communicate via a backplane, this is the same as Automation Direct, PLC Next and many other Industrial PLC's running with Linux as the higher level OS. Remember Industrial Control is more about being predictable and reliable, not necessarily real time, in fact most Industrial Controllers are not really "Real Time" and in fact take several milliseconds through each loop through the logic programmed into them.

    • @ivanchonin6747
      @ivanchonin6747 3 роки тому

      @@TheBreadboardca Do you think we can have the same speed as shown in our PLC project here - ua-cam.com/video/YW3au3yBwAg/v-deo.html ? Here we use Unitronics PLC. Note the time when the button is pressed and the sound from the pneumatic valve some 6-7 meters away from the panel.
      I see Kunbus system much more up-to-date and modern. Abloslutely ready for remote monitoring and control but still do not know how it will act if a flowmeter sends thousand of pulses every second - how accurate the Kunbus sistem will close the valve at sertain point? What do you think?

    • @TheBreadboardca
      @TheBreadboardca  3 роки тому +2

      @@ivanchonin6747 The RevPi DI module can count upto 2KHz according to its datasheet, revolution.kunbus.com/wp-content/uploads/manuell/datenblatt/Datasheet_RevPi_DI.pdf, as does the DIO module revolution.kunbus.com/wp-content/uploads/manuell/datenblatt/Datasheet_RevPi_DIO.pdf so it looks like it should work for you. I found the RevPi folks quite responsive to technical questions so if you need more detail beyond the datasheet I am sure they will help you out with confirming performance requirements for your scenario.

    • @ivanchonin6747
      @ivanchonin6747 3 роки тому

      @@TheBreadboardca Thank you for answer. I think it worth trynig.