You are here: Home / OSADL / News / 
2019-02-15 - 22:13
2008-11-10 12:00 Age: 10 Years

"Immediate C" has arrays now

By: Carsten Emde

Version 1.124 of John E. Wulff's PLC-extension of the C language is now online

Thanks to John E. Wulff, the immediate C language knows now about arrays. An entire section of the revised documentation (V1.124) is devoted to arrays and to the difference of handling arrays between conventional instruction flow languages and data flow languages such as immediate C.

The first couple of paragraphs of the newly added section on arrays in the immediate C documentation read as follows:

3   Arrays
Arrays in conventional instruction flow languages are a named collection (often of fixed length) of similar variables, which are accessed by an index expression, eg a[5]. Each such entity is an individual object, but in instruction flow languages the index is often a variable, which is manipulated in a loop and references to the individual indexed entities occur sequentially, as in the following C example:
  for (n = 0; n < 4; n+) {
    a[n] = b[n] * c[n];
  }

3.1 Immediate Arrays
In data flow languages like immediate C, loops at run-time are meaningless. Each immediate variable is an entity, which is controlled by one assignment statement. The variable changes, when a variable in the expression of the controlling statement changes and not when some loop runs. It is well to remember, that immediate variables and their controlling expressions are more like IC building blocks connected in a static network. In that sense immediate Arrays are like hardware registers.

Arrays may be defined in immediate C, but each entity acts individually at run-time, which means that an individual immediate object must be generated for each immediate array member.

Read on here. The software archive is available for download here.