Skip to content

Commit

Permalink
UML StateChart
Browse files Browse the repository at this point in the history
  • Loading branch information
runtimevic committed Oct 28, 2023
1 parent 928b897 commit aa0ec6d
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 94 deletions.
9 changes: 5 additions & 4 deletions Assets/publicacion.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Hola,
Seguimos con el curso de 👩‍💻 OOP IEC 61131-3 PLC 👨‍💻,
ya esta disponible el Video numero 31 de Youtube:
en este video veremos la explicación de UML - Diagrama de Clases Relaciones
ya esta disponible el Video numero 32 de Youtube:
en este video veremos la explicación de UML - Diagrama de Estado - State Chart

👉 https://youtu.be/2cPa-f8-BFY
👉 https://youtu.be/Gq_wvuDBgZ4

🐙 Repositorio de GitHub:
- 👉 https://github.com/runtimevic/OOP-IEC61131-3--Curso-Youtube
Expand Down Expand Up @@ -49,7 +49,8 @@ Lista de Videos del Curso OOP Programación Orientada a Objetos IEC61131-3 PLC:
- 029 - https://youtu.be/vKxAeP34hGI
- 030 - https://youtu.be/s2NV8Yt_rdY
- 031 - https://youtu.be/2cPa-f8-BFY
- 032 -
- 032 - https://youtu.be/Gq_wvuDBgZ4
- 033 -

Se busca colaborador para la traducción de la documentación al idioma que desee... 👀

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://www.plcopen.org/xml/tc6_0200">
<fileHeader companyName="Beckhoff Automation GmbH" productName="TwinCAT PLC Control" productVersion="3.5.13.21" creationDateTime="2023-10-22T21:56:08.9317514" />
<contentHeader name="OOP_Curso" modificationDateTime="2023-10-22T21:56:08.9404979">
<fileHeader companyName="Beckhoff Automation GmbH" productName="TwinCAT PLC Control" productVersion="3.5.13.21" creationDateTime="2023-10-28T13:22:48.2872608" />
<contentHeader name="OOP_Curso" modificationDateTime="2023-10-28T13:22:48.2970201">
<coordinateInfo>
<fbd>
<scaling x="1" y="1" />
Expand All @@ -22,6 +22,66 @@
<types>
<dataTypes />
<pous>
<pou name="_32_MAIN" pouType="program">
<interface>
<localVars>
<variable name="fbUmlSC">
<type>
<derived name="FB_UML_SC" />
</type>
</variable>
</localVars>
<documentation>
<xhtml xmlns="http://www.w3.org/1999/xhtml">
### This sample project contains the following elements.

- FB_UML_SC: This FB represents a simulation to save a text as XML or text format, and to publish it afterwards to a client and to a master.
The underlying state machine is implemented with the help of UML State Chart.

The behavior is not really programmed.
Only the wrapper/basic structure of the state machine is implemented.

Each time, when an ENTRY/DO/EXIT action is called, a correspondent counter variable is increased.

- Visualization: The visu shows the state of the counters, so that you can see how often an ENTRY/DO/EXIT action has been called.
You can use the buttons to switch between the states.
</xhtml>
</documentation>
</interface>
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">fbUmlSC();</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/interfaceasplaintext" handleUnknown="implementation">
<InterfaceAsPlainText>
<xhtml xmlns="http://www.w3.org/1999/xhtml">(*
### This sample project contains the following elements.

- FB_UML_SC: This FB represents a simulation to save a text as XML or text format, and to publish it afterwards to a client and to a master.
The underlying state machine is implemented with the help of UML State Chart.

The behavior is not really programmed.
Only the wrapper/basic structure of the state machine is implemented.

Each time, when an ENTRY/DO/EXIT action is called, a correspondent counter variable is increased.

- Visualization: The visu shows the state of the counters, so that you can see how often an ENTRY/DO/EXIT action has been called.
You can use the buttons to switch between the states.
*)
PROGRAM _32_MAIN
VAR
fbUmlSC : FB_UML_SC;
END_VAR
</xhtml>
</InterfaceAsPlainText>
</data>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>2925790c-2510-456f-9526-75c747cefdba</ObjectId>
</data>
</addData>
</pou>
<pou name="FB_UML_SC" pouType="functionBlock">
<interface>
<localVars>
Expand Down Expand Up @@ -484,66 +544,6 @@ END_VAR</xhtml>
</data>
</addData>
</pou>
<pou name="_32_MAIN" pouType="program">
<interface>
<localVars>
<variable name="fbUmlSC">
<type>
<derived name="FB_UML_SC" />
</type>
</variable>
</localVars>
<documentation>
<xhtml xmlns="http://www.w3.org/1999/xhtml">
### This sample project contains the following elements.

- FB_UML_SC: This FB represents a simulation to save a text as XML or text format, and to publish it afterwards to a client and to a master.
The underlying state machine is implemented with the help of UML State Chart.

The behavior is not really programmed.
Only the wrapper/basic structure of the state machine is implemented.

Each time, when an ENTRY/DO/EXIT action is called, a correspondent counter variable is increased.

- Visualization: The visu shows the state of the counters, so that you can see how often an ENTRY/DO/EXIT action has been called.
You can use the buttons to switch between the states.
</xhtml>
</documentation>
</interface>
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">fbUmlSC();</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/interfaceasplaintext" handleUnknown="implementation">
<InterfaceAsPlainText>
<xhtml xmlns="http://www.w3.org/1999/xhtml">(*
### This sample project contains the following elements.

- FB_UML_SC: This FB represents a simulation to save a text as XML or text format, and to publish it afterwards to a client and to a master.
The underlying state machine is implemented with the help of UML State Chart.

The behavior is not really programmed.
Only the wrapper/basic structure of the state machine is implemented.

Each time, when an ENTRY/DO/EXIT action is called, a correspondent counter variable is increased.

- Visualization: The visu shows the state of the counters, so that you can see how often an ENTRY/DO/EXIT action has been called.
You can use the buttons to switch between the states.
*)
PROGRAM _32_MAIN
VAR
fbUmlSC : FB_UML_SC;
END_VAR
</xhtml>
</InterfaceAsPlainText>
</data>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>2925790c-2510-456f-9526-75c747cefdba</ObjectId>
</data>
</addData>
</pou>
<pou name="Kaffemaschine" pouType="program">
<interface>
<localVars>
Expand Down Expand Up @@ -630,79 +630,79 @@ END_VAR
</addData>
</interface>
<actions>
<action name="ActEntry">
<action name="ActDo">
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml" />
<xhtml xmlns="http://www.w3.org/1999/xhtml">nGrind := nGrind + 10;</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>469d6e6b-6804-4513-8413-36e267dcf356</ObjectId>
<ObjectId>2b93c7e8-b8ff-4186-9c45-38d385f21193</ObjectId>
</data>
</addData>
</action>
<action name="ActShutdown">
<action name="ActEntry">
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">bShutDown := FALSE;
bPowerUp := FALSE;</xhtml>
<xhtml xmlns="http://www.w3.org/1999/xhtml" />
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>6bc0da1a-cc39-486c-a6b3-357f9df974be</ObjectId>
<ObjectId>469d6e6b-6804-4513-8413-36e267dcf356</ObjectId>
</data>
</addData>
</action>
<action name="CoffeeReady">
<action name="ActFoam">
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">bMakeCoffee := FALSE;
nGrind := 0;
nHeat := 20;
nFoam := 0;</xhtml>
<xhtml xmlns="http://www.w3.org/1999/xhtml">nFoam := nFoam + 5;</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>f87049c0-8714-4b66-bea9-9269392d29ba</ObjectId>
<ObjectId>5985ddd0-b5a4-4058-9e50-43bea0605035</ObjectId>
</data>
</addData>
</action>
<action name="ActDo">
<action name="ActHeat">
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">nGrind := nGrind + 10;</xhtml>
<xhtml xmlns="http://www.w3.org/1999/xhtml" />
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>2b93c7e8-b8ff-4186-9c45-38d385f21193</ObjectId>
<ObjectId>9e3c3d30-f6c8-4991-be9f-932f948dff00</ObjectId>
</data>
</addData>
</action>
<action name="ActHeat">
<action name="ActShutdown">
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml" />
<xhtml xmlns="http://www.w3.org/1999/xhtml">bShutDown := FALSE;
bPowerUp := FALSE;</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>9e3c3d30-f6c8-4991-be9f-932f948dff00</ObjectId>
<ObjectId>6bc0da1a-cc39-486c-a6b3-357f9df974be</ObjectId>
</data>
</addData>
</action>
<action name="ActFoam">
<action name="CoffeeReady">
<body>
<ST>
<xhtml xmlns="http://www.w3.org/1999/xhtml">nFoam := nFoam + 5;</xhtml>
<xhtml xmlns="http://www.w3.org/1999/xhtml">bMakeCoffee := FALSE;
nGrind := 0;
nHeat := 20;
nFoam := 0;</xhtml>
</ST>
</body>
<addData>
<data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
<ObjectId>5985ddd0-b5a4-4058-9e50-43bea0605035</ObjectId>
<ObjectId>f87049c0-8714-4b66-bea9-9269392d29ba</ObjectId>
</data>
</addData>
</action>
Expand Down Expand Up @@ -748,12 +748,12 @@ END_VAR
<ProjectStructure>
<Folder Name="32_UML_StateChart">
<Object Name="Kaffemaschine" ObjectId="7cc42eb0-dc6d-4e02-ab5b-1296bec80ed6">
<Object Name="ActDo" ObjectId="2b93c7e8-b8ff-4186-9c45-38d385f21193" />
<Object Name="ActEntry" ObjectId="469d6e6b-6804-4513-8413-36e267dcf356" />
<Object Name="ActFoam" ObjectId="5985ddd0-b5a4-4058-9e50-43bea0605035" />
<Object Name="ActHeat" ObjectId="9e3c3d30-f6c8-4991-be9f-932f948dff00" />
<Object Name="ActShutdown" ObjectId="6bc0da1a-cc39-486c-a6b3-357f9df974be" />
<Object Name="CoffeeReady" ObjectId="f87049c0-8714-4b66-bea9-9269392d29ba" />
<Object Name="ActDo" ObjectId="2b93c7e8-b8ff-4186-9c45-38d385f21193" />
<Object Name="ActHeat" ObjectId="9e3c3d30-f6c8-4991-be9f-932f948dff00" />
<Object Name="ActFoam" ObjectId="5985ddd0-b5a4-4058-9e50-43bea0605035" />
</Object>
<Folder Name="32_POUs">
<Object Name="FB_UML_SC" ObjectId="94bc9ba2-99d4-44d6-a994-09cf55f5519b">
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
- 🔗 [029 - OOP IEC 61131-3 PLC -- UML - Descripción](https://youtu.be/vKxAeP34hGI)
- 🔗 [030 - OOP IEC 61131-3 PLC -- UML - Diagrama de Clases](https://youtu.be/s2NV8Yt_rdY)
- 🔗 [031 - OOP IEC 61131-3 PLC -- UML - Diagrama de Clases - Relaciones](https://youtu.be/2cPa-f8-BFY)
- 🔗 [032 - OOP IEC 61131-3 PLC -- UML - Diagrama de Estado - StateChart]()
- 🔗 [032 - OOP IEC 61131-3 PLC -- UML - Diagrama de Estado - StateChart](https://youtu.be/Gq_wvuDBgZ4)
4 changes: 2 additions & 2 deletions docs/es/UML/Statechart UML.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### <span style="color:grey">UML State Chart:</span>

- Un diagrama de estado es una máquina que cambia de un estado a otro en tiempo de ejecución.
Los estados están unidos por transiciones, cada una de las cuales tiene una condición de guardia. Se pueden llamar acciones o métodos tanto en estados como en transiciones. Cuando una condición de guardia obtiene el valor TRUE(evento), se activará la transición. Esto ejecuta las acciones o métodos que pertenecen a la transición y luego cambia al siguiente estado. Las condiciones de guardia son simplemente variables booleanas que reflejan eventos o son una expresión. Los eventos son entradas del usuario de una visualización/interfaz de usuario, E/S, eventos de tiempo o eventos del sistema. Otro evento que a menudo se requiere es el evento de finalización que ocurre cuando se completan las acciones o métodos de un estado.
- Los estados están unidos por transiciones, cada una de las cuales tiene una condición de guardia. Se pueden llamar acciones o métodos tanto en estados como en transiciones. Cuando una condición de guardia obtiene el valor TRUE(evento), se activará la transición. Esto ejecuta las acciones o métodos que pertenecen a la transición y luego cambia al siguiente estado. Las condiciones de guardia son simplemente variables booleanas que reflejan eventos o son una expresión. Los eventos son entradas del usuario de una visualización/interfaz de usuario, E/S, eventos de tiempo o eventos del sistema. Otro evento que a menudo se requiere es el evento de finalización que ocurre cuando se completan las acciones o métodos de un estado.

- Inserta todos los estados requeridos en el editor de diagrama de estado e implementa el control de flujo. Para hacer esto, codifique las condiciones de protección para las transiciones especificando una variable booleana o una expresión ST. Implementas la funcionalidad real del diagrama de estado en las acciones y métodos que se llaman en los estados o durante las transiciones.

Expand Down Expand Up @@ -58,4 +58,4 @@ Durante la fase de diseño del software, ya puede utilizar el editor de gráfico
- 🔗 [CODESYS Feature Briefing - Fall 2023](https://www.youtube.com/watch?v=ND4TQQNxXQg)
***
### <span style="color:grey">Link al Video de Youtube_32:</span>
- 🔗 [032 - OOP IEC 61131-3 PLC -- UML - Diagrama de Estado - StateChart]()
- 🔗 [032 - OOP IEC 61131-3 PLC -- UML - Diagrama de Estado - StateChart](https://youtu.be/Gq_wvuDBgZ4)

0 comments on commit aa0ec6d

Please sign in to comment.