![]() This is where the Node-RED dashboard package we installed earlier comes into use, in your palette, under Dashboard look for a node called ui_switch it should look like this:ĭrag and drop this node onto the flow, double click on the ui switch node to open its settings: In this case we will use a property of msg called payload and we will set payload to be the new value that we want a Digital Output to become. In Node-RED msg are messages which are passed between nodes containing any data we choose. Once we have successfully set up 8 write nodes, addressed to 8 separate digital outputs we need a node to generate a msg.payload with specified On and Off values to alter the state of these digital outputs. Setting up a toggle button for a Digital Output ![]() To save time you can CTRL+C and CTRL+V the first node we set up: So therefore address 1 will be used to address digital output 1 and so on: The first write node we created used address 0, meaning that it is addressing digital output 0. We can use the same settings as above to create our following 7 Modbus-write nodes, however for each node you will need to change the address by increments of 1. Controlling All Digital Outputs from Node-RED We currently have one write node set up and configured to address digital output 0, we now need to create more. Then you know you have successfully created a Modbus TCP connection to your ED device. Once you have selected deploy, please navigate back to your ED device web page where you will see this banner: Selecting this deploys the nodes to the Node-RED server, essentially executing the code. Once you have done this, click the deploy button in the top right corner of the screen: The TCP port (you wrote this down earlier).Then on the server tab, edit it to add your device. Set the address to 0 (as we are addressing output 0).Set the FC option to FC 5: Force Single Coil.Give your node an appropriate name, for example Digital Outputs.Controlling Digital Output 0 from Node-REDĭrag and drop the Modbus-Write node onto the workspace, then double click on the node to open its settings: In our case, writing coils simply means setting digital outputs on or off. The purpose of this node is to connect to a Modbus TCP device to write coils/registers at each incoming message. To locate the Modbus nodes you can either scroll down the palette or index them by the search bar: To do this open Node-RED, go to: We need to configure the Modbus-Write node, this can be found in the Modbus tab of your palette. ![]() Now that we have successfully configured our ED device to talk Modbus TCP, we can create our flow in Node-RED.įirst we will create a way to read and control outputs on the ED. Your Brainboxes ED device is now configured to communicate in Modbus TCP. Select the Modbus TCP tab and take note of the TCP port, as you will need it later on, by factory default this should be 502. Once in the protocol tab you need to change the Current Protocol to Modbus TCP. Once on the web interface, please navigate to the Protocol Tab which can be found on the left-hand side of the web interface: Please take note of your IP address as you will need it later on. Help on finding the IP address of your Brainboxes device can be found here: How do I connect to a Remote IO device? To do this please navigate to your device’s web configuration page, which can be accessed by entering in your device’s IP address into your web browser. However, this guide will work for any ED device.īefore you get started you need to make sure that your ED device is set up correctly, here we are using Modbus TCP to control and read IO lines, so you need to make sure your device is set to the correct protocol.Īll Brainboxes devices are shipped from the factory in the ASCII protocol, so this step is important for this example to work. In this example we will be using a Brainboxes ED-588 which has 8 dedicated input channels and 8 dedicated output channels. Configuring your Brainboxes Remote IO Device ![]() Node-RED can be used on a PC or alternatively you can access a Node-RED instance on your BB-400. This FAQ will explain how Modbus TCP can be used with Node-RED to control the IO lines. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |