Monday, 18 May 2009

Programming Equipment States Efficiently

State based control is a method of defining the required states of some equipment and then driving the equipment to one of these states, typically where a Phase step sets the Equipment States. ControlDraw has long supported this method as it provides a very efficient method of representing functional requirements. An Equipment State Matrix can show the required states of all the modules in the Equipment entity, for example:

When it comes to programming this in a Process Control System it is possible to make highly efficient and fast code by deploying the State Matrix as a data table, with the phase steps simply setting a index into the matrix. This really is far more efficient than having each step in a sequence contain all the required device settings and it becomes more efficient the more states and steps there are. The software diagram below shows how this might be done.





So, to help PLC/DCS programmers with this, the latest version of ControlDraw has added a function to generate the data table in a form that is compact and can be easily entered into a PLC or similar. It compacts all the values in the rows into as small a memory block as possible.
(Note - if PCS's had a language that supported such multi-dimensional arrays this would not be needed, however that is not something that I have in practise seen.)

View > Matrix Data Table >Matrix as Boolean for example generates the following text that you can copy to the clipboard:
Row Bool Name
0 00100 'Shutdown
1 00001 'Ready
2 01100 'Fast Fill
3 10100 'Slow Fill
4 00000 'Mix
5 00110 'Transfer
---- Mapping:
Bits required = 5
Bits 0 to 1 set EM02
Bit 2 sets em Fixed Speed Agitator
Bits 3 to 4 set em Feed

You can also generate the table as integers, hex or octal

Note - this is now part of the standard S88 Reference model library that comes with ControlDraw

No comments: