En In this opportunity we will carry out tests with a Programmable Logic Controller, in this case a PLC FP-X C14R compact Panasonic brand, we will control it from the IoT Ubidots platform.
On this occasion we use 2 very interesting features of the Ubidots platform.
- Device Types: Creation of advanced properties for our devices.
- Bulk data: Creation of hundreds of devices with only one csv file.
More information : Ubidots.com
Update Ubidots Libraries V3.0.0 for ESP8266 modules
I present the latest update of Arduino IDE libraries for ESP8266 and the Ubidots IoT Platform, this version 3.0.0 presents improvements, such as TLS 2.0 and more functionality in its API constructors and functions.
Integrations with Panasonic PLC
If you look at my site and Youtube channel for a long time I have done several tests with this brand of PLC, then some tests.
Panasonic PLC features
In my case I want to integrate the Panasonic PLC specific reference FP-X C14R which has variations in hardware and then we will indicate how to add features of this device on the Ubidots platform.
Materials
- PLC FP-X C14R Panasonic or families FP0, FP0R, FP2SH.
- Converter MAX232 (Serial RS232 to TTL).
- Module ESP8266 NodeMCU.
Device Types
This utility of Ubidots allows to create or pre-configure devices with specific characteristics and properties, we know that Ubidots has a large list of hardware available, but what happens if we want our device to be “personalized”, device types allows us to do this work.
Note: For a more detailed explanation I recommend to see the official documentation of Ubidots .
Recommendation: For a more detailed explanation step by step I recommend watching the full video I Integration PLC Panasonic Control – Device Types – Bulk upload devices with Ubidots: available on our Youtube channel PDAControl.
Create new Type Device
Name and appearance
- colors and icons
Device properties
In my case I created:
- Name or Reference, change according to the PLC family.
- Power Supply, can be at 110VAC or 24VDC
- among other parameters.
Variables
Although I can create them from the device, I can pre-configure them to scalarize and parameterize directly from Variables.
In my case I will only create for the moment the 6 Outputs to relay that I will control.
Test delivery
The test example with curl allows you to test, the new device.
Recommendation: For a more detailed explanation step by step I recommend watching the full video I Integration PLC Panasonic Control – Device Types – Bulk upload devices with Ubidots: available on our Youtube channel PDAControl.
Device Types Created
Bulk upload devices
Ubidots has this perfect utility for the massive creation of devices, through a csv file that you download configured according to your requirements, and loads to ubidots and allows to have 200 devices easily, I have used it in previous tutorials.
Configure Bulk upload devices
After creating our device Types, select. “Bulk upload devices”.
- Download template CSV File.
Download “Template CSV File” is a template with fields to pre-configure your devices.
Note: I recommend to see the official documentation of Ubidots , since some error would load but it would not work.
Recommendation: For a more detailed explanation step by step I recommend watching the full video I Integration PLC Panasonic Control – Device Types – Bulk upload devices with Ubidots: available on our Youtube channel PDAControl.
The file comes in white, in this case I will create 2 devices.
Upload, upload or attach file to Ubidots.
Verify the log of events of Ubidots , to validate that if the devices were added correctly, in case of failure it will return an error file.
Recommendation: For a more detailed explanation step by step I recommend watching the full video I Integration PLC Panasonic Control – Device Types – Bulk upload devices with Ubidots: available on our Youtube channel PDAControl.
Devices
In the devices tab our 2 new custom devices must be created.
By exploring our devices, we can see the properties and attributes created from Type devices and Bulk upload devices.
Arduino IDE Code
The example has been taken as Recover the last value for the control for module ESP8266 and some adaptations and modifications have been made, such as the generation of a Mewtocol protocol fragment for the activation of 6 outputs from Y0 to Y5.
Warning: this code is an unguaranteed sample of the Mewtocol protocol, please do not use it in control applications, it has only been created as a sample for fast integration without frame verification, use at your own risk.
Note: I will leave the code at the end of the article available as a sample.
the explanation of the code will be in a next tutorial.
Complete Test
We will perform a test of one of the created devices.
Technically ESP8266 connects to Ubidots and reads the status of the variables associated with the outputs, and ESP8266 generates a fragment of the Mewtocol Protocol, for the activation of outputs, communicating through RS232.
Dashboard
The idea is to implement the entire Mewtocol protocol in Arduino IDE or preferably ESP-IDF for the ESP32 modules, to integrate this industrial hardware with platforms such as Ubidots designed for industrial applications.
Using Ubidots we will control the 6 Outputs to Rele of our PLC, from a dashboard that we have previously created and address to our test variables.
Recommendation: For a more detailed explanation step by step I recommend watching the full video I Integration PLC Panasonic Control – Device Types – Bulk upload devices with Ubidots: available on our Youtube channel PDAControl.
Final Test
AC load control from Ubidots.
Conclusions and recommendations
As they observed in the tests with the Devices types module, it has an applicability for people who design or manufacture their own platforms, whether hardware, software or firmware for IoT implementation with Ubidots.
allows the customization of our equipment, both aesthetic and functional.
The tests with the Bulk upload module, I recommend to read the official documentation of ubidots, for the creation of the CSV template, take into account that the “label” of the device must be unique in my case use the serial of the PLC .
In general it is a practical and quick method to create many devices, without having to add one by one, to a big point in favor of ubidots, we know that the device can be created and generate its own variables, but in what personalization is more Reliably use the CSV file.
Regarding the implementation of activation of outputs between the ESP8266 and the Panasonic PLC, from my point of view it is a very basic sample implementation without guarantees for a real process, since in this case I have only created a fragment of the mewtocol protocol.
To future implementation
Although it has been planned to create or implement a library in Arduino IDE or ESP-IDF or mongoose OS at least the main part of the Mewtocol protocol referring to DT, R, Digital Inputs, Digital Outputs, Analog Outputs and Analog Inputs, for now in planning.
Thanks to Ubidots.com