What is it?
It's script that converts DIA diagrams into programs. You're writing programs by dragging function shapes into the diagram and connecting them together.Picture 1 |
Every function shape has name, arguments and return value.
Picture 2 |
Functions can be connected together using Bezierline connections in a way that return value of one function is passed as an argument of another function.
Picture 3 |
You can also directly define arguments in function shape properties.
Picture 4 |
Writing program this way you must follow this rules:
- You can't pass return value as argument to the same function
- Every arguments must be defined.
Diagram from Picture 3 would be transformed into this formula: O1(AND(I1(), I2()));
How does it work?
Script transforms DIA diagram XML file into C language program. Then this program is compiled with C compilator which creates executable.System is based on three files:
- main.c - main C file includes loop() function which is defined in program.c file
- program.c - this is what the transformation script is compiling from DIA diagram
- functions.c - definition of functions used to build programs
To generate program another script is used but in the same way. It translates DIA diagram (which is a XML file) using Saxon and second xslt file to generate program.c file which includes formula for the program.
The last step is creating executable file using GCC.
Here is link to repository: https://bitbucket.org/limgo/avr-dia-plc/src
Brak komentarzy:
Prześlij komentarz