77
Chapter 8: C Programming
CHAPTER 8
C PROGRAMMING
Resident within ISACC is a C compiler . The purpose of putting a C compiler within
ISACC is to offer remote programmability and flexibility. With a C program running, ISACC
can perform logical input and output control and computation.
SPECIFICATIONS
The maximum size of your program can be 2K of compiled space, 8191 characters, or 500
lines, whichever comes first . You can define up to 127 variables, in addition to those built in,
and the names of the variables can be up to 15 characters. A C program may be executed a
maximum of once per second. It will continue to run until you halt it.
ABOUT THE C LANGUAGE
C is a structured programming language that is similar to other structured languages like Pascal
(for those of you who are familiar with it). For those who aren’t, do not be frightened off by
the following list of structural elements. The most important part of C is the structure, not
remembering all the names for its elements.
The structure of C is like asking a question or posing a problem, and then going through the
simple steps of information gathering and action to solve the problem. For example, if your
alarm clock is ringing and you want it to stop ringing, you must hit the OFF button to turn it
off, otherwise nothing will happen. If you want ISACC to turn off the alarm clock, you must
first tell the unit how to recognize that it is ringing, give it the command to turn it off when it
recognizes that it is ringing, otherwise do nothing.
To give ISACC this information, you must translate English commands into C commands.
ISACC’s built-in compiler then translates the C commands into ISACC’s language.
The C language structure is fairly simple. Each program must have a beginning and an end.
Each individual statement within the program must open, provide its information, and then
close. Think of it as writing sentences—without the proper sentence structure and punctua-
tion, you will get syntax errors. The reader (ISACC) will then not be able to receive the
message or understand what to do.
The ISACC C facility is comprised of the following elements:
STRUCTURE: To write a valid C program, regardless of length, you must follow its simple
structural elements.
EDITING COMMANDS: These commands allow you to begin writing, edit, list, or delete
a C program.