Omron PLC Node-RED Serial Communication

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ค. 2024
  • PLC manufacturers have their own proprietary protocols. These methods of communication will allow you to program the controller. Other protocols will allow you to collect and log information from the programmable logic controller. Node-RED can read and write to the Omron controller using special protocol commands.
    We will connect Node-RED to the Omron CP1H PLC. A serial RS485 interface will be used for communication with the industrial controller. We will demonstrate reading and writing using Host Link (C-mode commands) to the Omron PLC. Let’s get started.
    More information can be obtained at our website. This includes all of the links mentioned in this video.
    accautomation.ca/omron-plc-no...
    Purchase your USB to RS-485 serial adapter from the following affiliate link.
    amzn.to/35UNc6v
    In this series, we started using Node-RED in some of the following ways:
    The entire series can be viewed here:
    accautomation.ca/series/node-...
    Installing the Windows Software
    accautomation.ca/node-red-ins...
    • Node-RED Installing th...
    Modbus RTU / TCP Communication
    accautomation.ca/node-red-mod...
    • Node-RED Modbus RTU / ...
    User Interface - Dashboards
    accautomation.ca/node-red-use...
    • Node-RED User Interfac...
    SQL Database Log
    accautomation.ca/node-red-sql...
    • Node-RED SQL Database ...
    SQL Database Spreadsheet Connection
    accautomation.ca/node-red-sql...
    • Node-RED SQL Database ...
    Install Node-RED on Raspberry Pi 4
    accautomation.ca/install-node...
    • Install Node-RED on Ra...
    Do-More PLC Node-RED HTTP Request
    accautomation.ca/do-more-plc-...
    • Do-More PLC Node-RED H...
    Simple Click Data Logging
    accautomation.ca/simple-click...
    • Simple Click PLC Data ...
    Node-RED Modbus TCP Handling Errors
    accautomation.ca/node-red-mod...
    • Node-RED Modbus TCP Ha...
    Raspberry Pi Serial Port Programming
    accautomation.ca/raspberry-pi...
    • Raspberry Pi Serial Po...
    We will continue with the following:
    Omron PLC Node-RED Serial Communication
    00:00 Omron PLC Node-RED Serial Communication
    01:09 Omron C-mode (Host Link)
    02:17 Omron C-mode (Host Link) Command/Response Formats
    03:46 Omron C-mode (Host Link) Command Codes
    05:02 CP1W-CIF11 RS-422A/485 Option Boards
    06:16 Waveshare USB to RS485 Converter
    06:40 Omron CP1H Program and Settings
    09:12 Node-RED Program Nodes Required
    10:23 Node-RED Omron Serial Read Flow
    14:54 Omron Hardware and USB to RS485 Converter
    16:07 Executing the Node-RED Flow to Read from the Omron
    18:05 Node-RED Omron Serial Write Flow
    19:48 Executing the Node-RED Flow to Write to the Omron
    There are several reasons why we are using Node-RED. Here are just a few.
    - Built on top of the most dependable programming language, JavaScript.
    - JavaScript is flexible and easy to work with on web browsers, server-side, IoT, IIoT projects, and more.
    - Visual flow type interface making programming easy.
    - Node will allow JavaScript code to run directly on a computer.
    - Node-RED is a free, open-source logic engine.
    - Connect to PLC, PAC, Temperature Controllers, and Process Controllers using standard protocols.
    - Save and read from databases
    - Easily make the Internet of Things (IoT, IIoT) industrial solutions.
    Node-RED provides the ability for you to quickly create custom control solutions.
    accautomation.ca/

ความคิดเห็น • 32

  • @ACCautomation
    @ACCautomation  2 ปีที่แล้ว +1

    The Omron CP1 series of programmable logic controllers (PLC) can be found here.
    accautomation.ca/series/omron-plc-cp1h-series/
    Further information on Node-RED can be found here. (IoT Enabling Software)
    accautomation.ca/series/node-red-iot-enabling-software/
    Regards,
    Garry

  • @jonathansegura9537
    @jonathansegura9537 2 ปีที่แล้ว +2

    Great information, thank you

    • @ACCautomation
      @ACCautomation  2 ปีที่แล้ว +1

      Thanks for the comment, Jonathan Segura. I'm glad you found it informative.
      Garry

  • @ritafatayati8149
    @ritafatayati8149 ปีที่แล้ว +1

    Can you tell me why in video your comunication board comm led wasnt flashing?

    • @ACCautomation
      @ACCautomation  ปีที่แล้ว +1

      Hi Rita,
      The light on the Omron communication RS485 board does flash.
      th-cam.com/video/S-IrwNJuMWo/w-d-xo.html
      If you look at this part of the video you will see it quickly flash when I select the input on Node-RED. It will not flash constantly because I am manually setting the communications only once.
      Regards,
      Garry

  • @groveroswaldovillarpandoca4067
    @groveroswaldovillarpandoca4067 2 ปีที่แล้ว +1

    Hi, thanks for the video. One question, how could the omron plc communicate through its ethernet port to the node-red? what nodes could i use?

    • @ACCautomation
      @ACCautomation  2 ปีที่แล้ว +1

      Hi Grover Oswaldo Villarpando Calle,
      The Ethernet protocol that Omron uses is called FINS. Here are the Node-Red nodes to be used.
      flows.nodered.org/node/node-red-contrib-omron-fins
      Note: I have not tried out these nodes with a controller. Let me know how you make out.
      Regards,
      Garry

    • @groveroswaldovillarpandoca4067
      @groveroswaldovillarpandoca4067 2 ปีที่แล้ว +1

      ​@@ACCautomation hello, I tell you that I made this node for ethernet fins, it works well

    • @ACCautomation
      @ACCautomation  2 ปีที่แล้ว +1

      @@groveroswaldovillarpandoca4067
      Excellent. Thanks for letting me know.
      Garry

  • @daffaatalla6054
    @daffaatalla6054 8 หลายเดือนก่อน +1

    Hi, could i ask regarding the javascript when you are read the input / output? how do i know is that (2,4) in the parameter of substr?
    currently i just confuse for that. let say my motor address in 100.05 , then what should i do to read this? thank you

    • @ACCautomation
      @ACCautomation  8 หลายเดือนก่อน +1

      Hi @daffaatalla6054,
      Here is the post for this video.
      accautomation.ca/omron-plc-node-red-serial-communication/
      You will see in the post the header code (RR) to read the CIO Memory Area of the Omron.
      I hope this helps you out.
      Regards,
      Garry

    • @daffaatalla6054
      @daffaatalla6054 8 หลายเดือนก่อน +1

      Hi@@ACCautomation thank you. then i have 1 more problem, i only can comunicate only with my PLC, then cannot use in node red. but if i use for nodered, the plc cannot upload program like serial port already used. thank you

    • @ACCautomation
      @ACCautomation  8 หลายเดือนก่อน +1

      @@daffaatalla6054
      Yes, this is the issue with serial communication. You have two options. You can have a computer with the programming package and physically switch the cable when you need to program. The second method depends on whether the Omron PLC has an Ethernet port. Use this port for programming.
      I hope this helps you out.
      Regards,
      Garry

    • @daffaatalla6054
      @daffaatalla6054 8 หลายเดือนก่อน

      Hi@@ACCautomation , thank you for the response, currently i am using Omron CQM1H-51CPU. this plc doesn't have any ethernet port. but that's okay, i can switch the cable. but i have a qtn, in your video, you are using D0 till D10. i saw in ur Cxp file doesn't have any of that in "watch", this "watch" mean in the CX programmer you press "ALT + 3" to show. let say i only have 1 input and 1 output . the address for input is 00.0, for output is 100.0, how is that in the node "omron-command" ? do i need to use Header Code : RR, Beginning word 0000, number of word : 0002? is that possible if use like this? thank you

  • @SureshKumar-pz4bl
    @SureshKumar-pz4bl 2 ปีที่แล้ว +1

    I tried at home with a CP1E and is working perfect!! . However once USB connection is removed, MODBUS communication with the CPU is ineterrupted. It seems that modbus is working only within USB connection in place with the PC ( CX Programmer running ot not ). I see also in your the video USB cable is connected .This is strange to me may be anyone knows the reason why.

    • @ACCautomation
      @ACCautomation  2 ปีที่แล้ว +1

      Hi Suresh Kumar,
      Are you sure that you are selecting the correct communication port for the connection to the Omron controller?
      In the video, CX-Programmer is running to display and monitor the ladder logic program and settings only.
      Regards,
      Garry

    • @SureshKumar-pz4bl
      @SureshKumar-pz4bl 2 ปีที่แล้ว +1

      @@ACCautomation port baud etc are fine yes but once USB cable is remved cnnection faiis strange indeed

    • @ACCautomation
      @ACCautomation  2 ปีที่แล้ว +2

      @@SureshKumar-pz4bl
      Very strange. I have never seen this before. This should be a separate communication port. I would give Omron technical support a call and inquire.
      Regards,
      Garry

    • @SureshKumar-pz4bl
      @SureshKumar-pz4bl 2 ปีที่แล้ว +1

      @@ACCautomation Strange indeed!! Same happened when connecting CP1E to my PC via CX Programmer/PLC/Direct Online/Connection Type/Serial Connection: Modbus connection with RS232 cable is fine until USB cable is connected, otherwise it fails.

    • @SureshKumar-pz4bl
      @SureshKumar-pz4bl 2 ปีที่แล้ว +1

      @@ACCautomation Hello Garry plc forgive me, it was my mistake. I didn't set Flow control XOn/Xoff Now it is fine. In CX-Programmer RS232 Port settings, it is mentioned Standard (9600: 1,7,2,E ) where 1 means XOn/XOff

  • @fun_tech
    @fun_tech ปีที่แล้ว +1

    can we use a dropdown on the UI to choose which COM PORT do we use to communicate whit the PLC ?

    • @ACCautomation
      @ACCautomation  ปีที่แล้ว +2

      Hi Reza,
      This is not possible at runtime. I think you would have this already set before starting the program. Possibly a setup flat file?
      I would set up timing and continually poll if you have multiple machines to monitor. The selection would then be on the information to display.
      discourse.nodered.org/t/serial-port-selected-dynamically-from-the-dashboard/52679
      I hope this helps you out.
      Regards,
      Garry

    • @fun_tech
      @fun_tech ปีที่แล้ว +1

      @@ACCautomation the problem is the PC was not set to be stand by the PLC 😂 it was a portable PC for work, that I think there is any possibility to user use any port of the PC when he connect to PLC, it will cause the port was different, right ?

    • @ACCautomation
      @ACCautomation  ปีที่แล้ว +1

      @@fun_tech
      The com port may change if this is a USB to Serial connection. If this is a com port (DB9) from the back of the computer, then the number will not change.
      Regards,
      Garry

    • @fun_tech
      @fun_tech ปีที่แล้ว +1

      @@ACCautomation I was tryin to write the com port on the serial configuration with the payload, but its still doesn't work
      how if I make a lot of serial com nodes, each of node is have one com port, it mean if I want to have 10 com port, I use 10 serial node with different com port configuration, is there any problem posibillity when we doing that ?

    • @ACCautomation
      @ACCautomation  ปีที่แล้ว +1

      @@fun_tech ​
      Almost every video also has a corresponding webpage post. This will cover more detail and provide the code used in the video.
      Here is the URL to the post:
      accautomation.ca/omron-plc-node-red-serial-communication/
      This should help you out.
      Regards,
      Garry

  • @diegoacosta5385
    @diegoacosta5385 2 ปีที่แล้ว +1

    Hi. I'm Diego and I still trying to write a number in a DM memory but I can not. How can I do that? I try change TX valor, change "RD" to "WD" but still not woriking.. Thanks you for your incredible tutorial and sorry for my english. I'm from Argentina.

    • @ACCautomation
      @ACCautomation  2 ปีที่แล้ว +1

      Hi Diego,
      Besides changing to the WD command, you must also make sure that the Omron PLC is in monitor mode. Write operations will not work in run mode. Normally this is set up in the registers to start the controller in monitor mode.
      I hope this helps you out.
      Regards,
      Garry