Packed State Representation And Computation Demo

This section discusses a technical demonstration of the Packed State Representation, as represented in a SuperVariable table (see reference below) and as operating in the state based assignment statement, in its effect on that representation. As explained in the reference, ICL replaces Boolean and contact variables by user named States, computed with in Truth Tables and Ladder diagrams. The proposed implementation deals with two other issues, requiring the technical complications discussed and demonstrated here: The usage is intended to be as efficient in computation as the Boolean form (and as existing commercial logic products). And it supports a user defined mapping between the State based notation and the natural process I/O based on varied forms of packed bit codes. The States are declared in the SuperVariable definitions of the associated application variables, where a variable can have also any number of different real, Time, Counts, and States values, along with other Attributes. The State values are represented by STATE Attributes, whereas the allowed States and their packing structure are defined in an associated STATES Attribute.

These State valued Attributes as well as variable lists below are treated in Lists, which take a special role in ICL, replacing vector notation with a more flexible and user friendly way.

The format of this declaration lists the separate packed field declarations as lists of alternate State names for each alternate field value, each name separated by a slash (/), each field list separated by a comma. Thus, when the demo starts and displays the built in defined SuperVariable Table, the first variable named C100 has a STATES declaration: OFF/SUSPEND/ON, FREEZE/RELEASE (i.e. with two fields). [The theology here is that the comma acts as in English, as an AND of the available States, and the slash acts as an OR of the alternative States.] The field declarations are listed left to right in reverse order of the corresponding fields in the internal storage word (The corresponding fields are stored right to left.). Each field has just enough bits to accommodate the different State name alternatives. The numerical value corresponding to each State name is that number (starting with 0) which corresponds to its number in the list. A separate convention allows a field declaration to be preceded by a hexadecimal number set of by a following colon which represents an alternative distribution of the intended field bits in the storage word (integer). The remaining fields fill in the available bits.

State variables can be set in assignment statements where the assignment operator (mimicking an appropriate English usage) is a comma. One likely use of these statements is to set lists of contacts (or actuators/valves) to an altered State as part of reconfiguring the process equipment for a following operation. In this case the List is expressed as a list of variable names separated by commas all in parentheses. Multiple States in the assignment are expressed as the corresponding multiple State names separated by commas (as an AND), also in parentheses. For example (C100, C101, C102), (ON, RELEASE) sets each of the three contact variables to the combined ON, RELEASE State. (An Activity shown elsewhere illustrates other [Truth Table] computations.)

User's Guide Unlike the usual advice to read first, load and start the system before reading beyond load instructions.

A rough User's Guide is provided here. When the Demo file below is decompressed the result is named mskarry.exe. The demo commands and demo syntax does not reflect the ICL ease of use concepts! When the demo executable is initiated a SuperVariable Table is displayed with the three NAME, STATE, and STATES Attribute columns and the two extra PV and MASK demo columns. The PV column displays the actual numerical coded value of the corresponding STATE column entry for each variable. (The MASK column displays the mask resulting when all of the bits for all of the fields are set; this mask is used internally in the assignment calculations.) Use of the demo consists of entering assignment statements including only those variables listed in the SuperVariable table (with all capital letters) terminated by a carriage return. The system processes the statement and generates the table again with the new STATE and PV Attribute values for each variable encoded according to the corresponding STATES declaration. A STOP-carriage-return stops the demo.

Reference: Redesigned State Logic for an Easier to Use Control Language

*Demo

*The Demo is written in C as a simple console application, exercising routines that pack and unpack the variables as described in the reference. The Demo is terminated by typing STOP.