Affichage des articles dont le libellé est NEXTION. Afficher tous les articles
Affichage des articles dont le libellé est NEXTION. Afficher tous les articles

mercredi 29 mai 2024

PLC topic now...

I have just started a small activity at a French university. I deal with the subject of BMS for all university sites. In a country like France where everything, and more particularly the university, is supposed to be 'excellence', the reality on the ground is quite different.

Incompetence, inconsistency, significant salaries and resources dedicated to managers, and crumbs to field staff (classic stratification in France between the bourgeoisie and the proletariat). The result is that it malfunctions perfectly well!


But I digress...

However, one of the aspects that has never been taken into account in the development of a coherent BMS system is the maintenance of said system. With the advent of the standardization of Ethernet type networks and the rise in power of PLCs, PLCs with RJ45 connection have become widespread.

All operations can therefore be carried out via a computer connected to a network. As a result, the 'facilities' of real-time management of the PLCs have completely disappeared. Understand that these no longer have displays at all, as could be the case on dedicated systems, particularly for heating and ventilation regulation.

Yes, but, when you are in a substation on the roof or in the basement, not only has no network socket been installed, other than the one intended for the PLC, but obviously the wifi does not work.

Okay, so we need to add a small screen locally.

There are many screen solutions, but most of the time they offer services that go well beyond the simple need to query/modify a few parameters, and are available, inevitably, at fairly high prices.

A few years ago I studied the possibility of connecting a Nextion type screen to a PLC via an RS485 link in Modbus protocol. It worked perfectly.



The basic principle is simple, to make these screens usable in an automation environment, you must be able to power it with a voltage of up to 24V, you also need an RS485 link to communicate with the controller, and a 3.3V TTL link to control the screen.

I remember that I had carried out my tests with an Atmel AVR type processor. I gave up on this type of processor a long time ago. I don't like the way they are programmed at all and I don't even know if there are real-time debugging tools.

I have since switched to Chinese RISC-V processors which offer everything you need for comfortable work, at a very attractive price. So, I started here based on a CH32V203F8P6 processor.

I also rationalized the card by putting only the components strictly necessary for the type of application targeted.

This gives this type of achievement :



What do we find there?
  • Power supply up to 24V-DC.
  • A connector for an RS485 link.
  • A connector for the connection with the screen.
  • A connector for programming the processor.
And that's all.

For programming, this will be quite easy since the 'games' consist of interrogating the PLC in MODBUS to read or write a register, and updating the information on the screen or reading the information entered on the screen.

The processor used does not have large resources, but as it mainly involves managing only a few system parameters, this will be more than enough.

And, a few days later by post:



Nice little circuit, isn't it?

I just have to find the time to assemble one of these cards in order to carry out the first tests...