cristoferz / zladder

Ladder engine for running on arduino platforms
MIT License
0 stars 0 forks source link

Design main engine workflow #1

Open cristoferz opened 5 years ago

cristoferz commented 5 years ago

The workflow has to be able to handle the following features:

cristoferz commented 5 years ago

Initial drawing for the EEPROM memory structure for storing the configuration:

|DEVICE-UUID|VERSION-UUID|VARIABLES|CONFIGURATION|PROGRAM|

These memory areas is detailed as following:

cristoferz commented 5 years ago

Once started, the arduino can load the program to memory and start running it in cycles, applying the logics for each lane. In case of program reload, the memory have to also be reloaded.

cristoferz commented 5 years ago

As ladder logic is mostly based on flows, the result of an operation can be passed to the next one, until the end of the lane. Some operation does not use this previous state, so can be ignored. If some operations do not change states, so they can just pass the previous state forward.

cristoferz commented 5 years ago

Port configuration can be of types:

As supported by Arduino. Analogic ports can use the same values except for PWM. As configuration will have 1-byte, the remaining values can be reserved for future features (e.g. I2C communications)