Тёмный

Writing OpenPLC drivers using PSM - DS18B20 on Raspberry Pi 

OpenPLC
Подписаться 7 тыс.
Просмотров 10 тыс.
50% 1

How can you read temperature on a Raspberry Pi with no analog inputs? Today you will learn how to use OpenPLC's Python SubModule (PSM) to easily write hardware drivers to interface unsupported sensors with OpenPLC. On this video you will see a step-by-step example application adding support for the DS18B20 digital temperature sensor on a Raspberry Pi. Other sensors and hardware peripherals can be added using the same principles with PSM.
Enabling 1-Wire on the Pi 03:22
Wiring 04:15
Testing on terminal 05:25
Testing on Python 08:15
Enable PSM driver 10:52
Writing PSM code 12:40
Creating test project 19:12
Testing 22:45

Наука

Опубликовано:

 

4 янв 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@roboticaGrupo3
@roboticaGrupo3 5 месяцев назад
I am so proud of you Thiago! You are superb! I always metion you as my best intern ever!
@openplc
@openplc 5 месяцев назад
Thank you Djim! It was a pleasure working with you guys way back then
@mbunds
@mbunds 4 месяца назад
Thanks Thiago! After finally escaping from a two-year long sidetrack into cybersecurity, I used this tutorial to get the PSM OpenPLC runtime peer-to-peer started. Now, an OpenPLC runtime instance can connect to other OpenPLC runtime "peers", read their coils, discretes, input and holding registers, and update the variables within the "client" instance of an OpenPLC runtime! The primitive code I have entered into the PSM can connect to multiple peers (my "heaviest" OpenPLC runtime client connects to 13 peers), and reads of discrete inputs and coils are successful, but that's only for a single PLC so far. The PSM "peer-to-peer" code is still too rough to release, but as soon as I get connection monitoring, read cycle throttling, and exception handling fleshed out a little better, I'll post it in the OpenPLC "projects" forum.
@PauloRobertoOliveiraValim
@PauloRobertoOliveiraValim Год назад
Hi Thiago, congratulations for your work!!
@yevsya
@yevsya Год назад
On Windows 10, the editor does not start. If there are non-English folder names in the folder path. Make the choice of install rather than default no choice.
@openplc
@openplc Год назад
I’ll work at fixing this bug
@mail87523
@mail87523 Год назад
What a great project !!! How to use socket CAN with openplc on raspberry pi ???
@openplc
@openplc Год назад
OpenPLC does not support CAN bus yet.
@SlyerFox666
@SlyerFox666 Год назад
Hi and thanks for all the great video tutorials they are very useful. Can I ask if there is a way to view the status of registers/ memory allocations in Open PLC ?
@openplc
@openplc Год назад
If you’re using the Linux/Windows runtime then you can simply click on Monitoring to see the current status of all located variables. For the micro runtime (runtime running on microcontrollers) you will have to use a Modbus tool like Radzio Modbus to read the registers
@SlyerFox666
@SlyerFox666 Год назад
@@openplc Very Much Appreciated 👍
@wei1224hf
@wei1224hf 10 месяцев назад
is there any demo shows OPEN PLC works with servr motor ? EtherCAT servo motor.
@Minimum718XX
@Minimum718XX Год назад
Thanks for the great video! What if I want to use more than one DS18B20 sensor?
@openplc
@openplc 5 месяцев назад
Use the block with 2 or more outputs
@boardsdiscovery5803
@boardsdiscovery5803 Год назад
Very well explained! At the moment the problem is to have one raspberry 3 at hand.... It works on raspberry 4? I think yes because it seem OpenPlc runtime was written in python....
@openplc
@openplc Год назад
OpenPLC works with any Raspberry Pi, from the very first model to Pi 4
@wisdom09
@wisdom09 Год назад
Hello sir your videos are great..can you please give tutorial to connect LCD to ARDUINO by plc programming to display counter value.
@kennyking6325
@kennyking6325 Год назад
Friends, I am also interested in lcd readouts. With scadaBR a $67 chrome book could replace all push buttons and lcd screen? Which is a good price point, if your machine can physically support it
@openplc
@openplc Год назад
OpenPLC Runtime does not support connecting to an LCD directly like that. You will need a proper SCADA solution like ScadaBR or FUXA
@B105CAFE
@B105CAFE 9 месяцев назад
Hello Thiago! Will there be a continuation of such useful work???
@openplc
@openplc 5 месяцев назад
I might add a couple more videos soon :)
@mouadbenjdi7792
@mouadbenjdi7792 Год назад
Hi Thanks alot for this greet project and thank you for making it open source. I want to use an ESP32 with open plc but it seems like open plc can't interact with it is there anyway i can connect it? Thanks in advance
@openplc
@openplc Год назад
Just select "ESP32" from the upload window as your target board and you will be good to go.
@wasafali-ij2fq
@wasafali-ij2fq Год назад
sir tell us please how can we get pulse output in openplc for running stepper or servo motor thanks
@openplc
@openplc Год назад
Stepper and servo motors require a more precise timing, and that can be tricky to achieve with just ladder logic. You can use PWM capable outputs (for the boards that have them) with OpenPLC. OpenPLC treats them as 16-bit analog outputs, where the PWM duty-cycle is directly proportional to the analog value you place on them (0 to 65535)
@DuroLabs85
@DuroLabs85 11 месяцев назад
Hi, I am using arduino nano clones which have the CH340G usb chipset and seems like openPLC doesn't upload the code I don't get any blink on pin13 the upload window does say that the upload is done but when uploading the pin13 the inbuilt led blinks for a few milli seconds and the rx tx leds don't light up and yes I have selected the correct pin %QX0.3 for nano and the correct com port too seems like the program only resets the arduino nano when uploading doesn't actually upload the program. This is only problem for the clone nano's I have tried it on Uno (original), Arduino Micro, and esp32 all of them works but not the clone which uses CH340g can you please add support for the ch340g too.
@openplc
@openplc 5 месяцев назад
Most likely you will have to update the Arduino bootloader on your clone board
@user-fu3mm4le1q
@user-fu3mm4le1q Год назад
Hello Thiago! How are You? Congrats for Your work!! We are an electronics industry in Brazil and would like to discuss a project with you. How can we get in touch?
@caloginelaurent3493
@caloginelaurent3493 Год назад
Hello very good job , it's possible give me some program to test openplc on raspberry and esp 32,thanks !
@openplc
@openplc Год назад
You can find examples on the OpenPLC Project website in the Documentation section
@kennyking6325
@kennyking6325 Год назад
Friends, Am I wrong that python brings us away from ladder logic which I like? Can you still program with ladder logic? Is this just a work around for miss compatible hardware?
@openplc
@openplc Год назад
Not exactly. PSM was not intended to be used as a logic programming tool. The logic must still be written in PLC languages. PSM should only be used to write the code for the hardware interface (I/Os)
@boardsdiscovery5803
@boardsdiscovery5803 Год назад
The platform is wery well written. The only big problem for me is the installation in my school where we don't have the access as root. I managed to start The editor struggling with windows but for the run time i have a very big problem. Do you have some workarounds to solve the problem? Thanks
@openplc
@openplc Год назад
The editor is a portable application. You can copy OpenPLC_Editor folder from one computer to another and it will run. No need for admin access and no need to go through full installation process. For the Runtime, running without admin is tricky. The Runtime on Windows relies on Cygwin. So if you can manage to install a portable version of Cygwin, you should then be able to install OpenPLC Runtime following the manual installation procedure
@boardsdiscovery5803
@boardsdiscovery5803 Год назад
I'm thinking in alternative to install a Linux machine configured in a virtual box. But at the moment i'm not so sure It Will work...
@openplc
@openplc Год назад
@@boardsdiscovery5803 You can definitely use a VirtualBox VM with OpenPLC Runtime. I would recommend keeping the Editor on Windows as it requires a GUI to run. I did exactly that when I built the SCADA Security Lab at UAH. A clean Debian VM with no desktop environment works best as it is super lightweight. OpenPLC Runtime doesn't need any GUI to run. The good thing about this approach is that you can replicate the VM multiple times to have a virtual environment with multiple PLCs. Each VM with OpenPLC Runtime installed behaves as an individual PLC.
@boardsdiscovery5803
@boardsdiscovery5803 Год назад
@@openplc is a server! :) I had not tought about that! Great guy! Thanks!
@wasafali-ij2fq
@wasafali-ij2fq Год назад
Sir I want to download OPENPLC editor but I am unable to download and install it because after installation it opens as s pycarm project please make a video on how to download and install it please and best of luck
@openplc
@openplc Год назад
That's one of the first videos I made: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QcP2dZATJ8Q.html
@farzad2panahi
@farzad2panahi 9 месяцев назад
`sudo pip3` breaks my heart
@olegchernetsov3206
@olegchernetsov3206 Год назад
How to connect a temperature sensor to the Arduino
@openplc
@openplc Год назад
You can use one of the DS18B20 blocks for that
@kumarsaurabh3936
@kumarsaurabh3936 8 месяцев назад
Which company making open plc products
@openplc
@openplc 5 месяцев назад
Automation Direct P1AM, Controllino and Arduino (Opta) are a few examples. There are other non-official ones added by the community as well
Далее
Basics 07: Connecting OpenPLC to an HMI (ScadaBR)
28:59
Basics 04: OpenPLC on Raspberry Pi with Modbus
20:48
Просмотров 36 тыс.
How to Read Modbus Data with Python - Part 1
11:33
Просмотров 11 тыс.
Basics 03: Programming an Arduino Board with OpenPLC
16:55
OpenPLC on a UL-listed Industrial Raspberry Pi
20:51
Просмотров 4,4 тыс.
Chomsky Hierarchy - Computerphile
6:57
Просмотров 236 тыс.
How to Build Raspberry Pi Pico PLC || OpenPLC Editor
7:43