web developer & system programmer

coder . cl

ramblings and thoughts on programming...


system design desk

published: 21-07-2012 / updated: 21-07-2012
posted in: c++, development, programming, projects, tips
by Daniel Molina Wegener

Usually you get stuck in your computer trying to solve problems. But problems are solved thinking, and getting stuck in the computer is not the optimal way to think in complex problems. In one of my recent projects I have been working on a complex state machine, which is hierarchical and deriving states to each device on the system. On a computer is hard to have an overview of the entire system, even if you have a good modelling tool. In our team we are doing some diagrams on whiteboards, taking photos from them and then we are individually thinking on wider perspectives of the problem.

But we are not using modelling tools. The problem with modelling tools is the fact that you can make many mistakes and repair them easily, so you do not get very conscious and concentrated in the problem. Designing systems, and mainly complex systems like this one, which is an Industrial Control System requires to be very concentrated. I have two desk, one to study and solve problems and another with my workstation. If you do not have two desks, you can use your dining room, mainly when you are alone or search a comfortable place to think.

The current task in the project is to design a generalized state machine for one the entire nodes to be managed by the system. Which will be reporting statuses to its parent node. So, we have made it analogous to how are device drivers working on many real-time kernels. This means one cycle means one state transition.

System Design Desk

System Design Desk

So, I have finally got the final design working after various drafts. With two main state transition streams, one for device initialization and another for device operation, that should work on all levels. This brings me a wider perspective, allowing me to think properly on each device class as C++ class and state machines and transitions as the proper C++ data structures. Also, how the context will be shared between devices, to notify each devices about its environment, allowing the optimal operation for each node. But I must recognize that it is looking simple, but that is great, because the device organization is not so simple as it looks on the diagram, so the simplicity goal have been reached.

The amount of devices to be managed and how are those devices streaming information in the system is the most complex structure in the system. Mainly because there are many devices to manage from the processing station and there is only one communication channel, which is not handled by an Ethernet based protocol, making harder to share that channel between devices, but we cannot use locks on this system, and we must use states rather than locks to allow more fluent behaviour. I really prefer to think using paper first and then pass some models to the workstation. The same applies to other systems, for example once I am doing β-substitutions replacing some functions with their closed form.


No coments yet.

post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>