Versions
Version 2.1
- Program
token storage
- The
storage of program tokens has been modified. Before, token values were stored as null terminated
strings. Now they are stored with
defined length. This will allow
token values to contain null characters.
Example: the string “Hello\x00World” can now be properly stored.
- Secs
messages and tmp variables
- Like
token values above, tmp variables are now stored with a defined
length. Now a secs message with
an ASCII data type can contain null characters.
- The
creation of tmp variables from secs messages has been modified. In the past, the decode secs message
was converted into name/value pairs.
The values were “” delimited.
This presented a problem if the value contained a “ (ex: <A
“The pump is “ON””>, the value returned was “The pump is” because the
“ON” terminated the string prematurely).
Now tmp variables are created directly from the decode secs message. This will create a problem with
existing applications if users were coding around this bug.
- Pragmas
are now supported. They are used
to control features of sc. New
features can be enabled using a pragma as well as supporting existing
functionality. Current pragmas
include:
- LOG_CPU_USAGE
– When defined, logs a cpu usage message in the logs.
- SHOW_NON_PRINTING_CHARS_IN_BRACES
– When defined, instructs sc to show non-printing chars as {hh} in the
log files, or other output, instead of showing them as \xhh.
- NO_BLOCK_ON_SLEEP
– When defined, instructs sc to not block on the sleep command,
but to use an internal sc timer instead.
While sleeping, sc can handle other events and commands.
- NO_SOURCE_CODE_LINE_NUMBERS
– When defined, instructs sc not to show the source code file and line
number when an error or warning is detected. Source code and line numbers are still displayed for fatal
error conditions.
- New
data type called local_var, which is used to define local
variables. Local variables can be
used after a label to define a local instance of that
variable. Local vars can be
initially assigned to an expression.
local_var x = 5*100
- Miscellaneous
- New
functions, trace(1) and trace(0), to turn on and off sc
program statements being logged as they are executed.
-
- Fixed
the list command
- Added
an optional no_parese parameter to the system command to not parse those
characters.
- User
variables and tmp variables no longer share the same space. Each is stored in separate areas.
- Modifed
how for loops are implemented.
They now use a “nest” count just like while loops.
- Gosub’s
with parameters are now supported.
Parameters can be both passed by reference and passed by
value. Example: gosub add ($value1, $value2,
result). Value1 and value2
are passed by value, while result is passed by reference.
Version 2.0.6
- Added
a cpu usage LOG statement when sc goes idle
- Fixed
a bug with secs/hsms msgs and the W bit flag where sc was waiting for a
reply even when the W bit was not set
- Fixed
a bug with the unary +
- Added
the ~ one's complement unary operator
- Fixed
a bug where the command line arguments were generating errors if not
enough supplied
Version 2.0.5
- Fix
a bug where function calls within function calls were not working. This bug was introduced a few versions
ago.
Version 2.0.4
- New
command \"load\" that works just like the old \"read\"
command (included in version 2.0.3)
- New
operand \"^\" for bitwise xor-ing
- Fixed
bug with the \"open\" command and the \"error=<>,
no_error\", this did not work before
Version 2.0.3
- Mod
so that tmp variables are kept separate form others. Did this for performance reasons.
- Fixed
an old bug where is_tmp_var() returned true when the tmp variable did not
exist.
- Fixed
core dump for \"sc -i -c \" , the -c option has no argument
- Fixed
bug with no_error within a gosub, and not being able to return
Version 2.0.2
- Fixed
sc looping problem with connected client
- Mod
the disconnect routine in server.c.
This had some bugs handling clients and servers that terminate.
- Mod
how the hsms sends messages, This was causing some problems with tools
Version 2.0.1
- Fix
bug for program files that have the <cr><nl>. This is treated as a single <nl>
- Fixed
a sc -r mistake about the
break/break_loop statements
- Now
supports the // style comments
- Fixed
a bug in the htof() function
Version 2.0 - Open Source
- New
function get_client() to return the connected client
- New
function get_version() to get the current version of sc
- Function
names are no longer reserved, and can now be used as variables names too
- Optional
arg to the send command to allow sending a message to a connected client
Known Bugs
- With
version 2.0.7, the list command is broken. This is fixed in version 2.1
Future Enhancements
- Modify
the sleep command to not block, but allow other sc activity while
sleeping, and continue once the sleep is completed – Added in version 2.1
The purpose of this document is to show how to create
program files using the Edge
Integration sc Station Controller.
This document explains how the sc functions and the program language
syntax along with programming examples.
In this section, we discuss how to install the sc, start the
sc, stop the sc, and the sc command line options.
To install the sc, copy the sc executable (sc) to the
appropriate directory on your system.
Make sure that your $PATH environment variable is properly set.
To start the sc, at the system prompt type sc. You should see a greeting. Hit the enter key to
get an sc prompt and a list of commands.
$ sc -i
To terminate the sc, at the sc prompt, type kill.
sc> kill
To get a list of the sc options, type sc -h at
the system prompt.
$ sc -h
Always put a blank space between the -option and
the argument.
$ sc -d 3 not sc
-d3
The following is a list of the sc command line options:
|
sc option
|
Description
|
|
-c command
|
Used to specify or execute an sc
command when starting the sc. The
specified command is any valid sc command
$ sc -c “read
my_program”
$ sc -c “read
\”./src/my_program\””
|
|
-d level
|
Used to specify the debug or trace
level. This is used to debug the sc
application and your program file.
The level ranges from 0 to 5.
The default is 0, which turns off debugging.
$ -d 3 -c “read
my_program”
|
|
-h
|
Used to show the options
$ sc -h
|
|
-i
|
Run the sc in interactive mode. The sc prompts for commands.
$ sc -i
|
|
-n name
|
Assigns the name to the sc. The name is used in log
messages. This is useful when running
multiple sc’s and error messages are sent to a common error file.
|
|
-s service
|
Used to specify an interface file
socket, service, when starting the sc. This socket is used to communicate with the running sc. The utility sc_talk is used to communicate
with the running sc through this socket.
(A good convention is to put the socket files in a sockets directory
and prefix them with an “s.”)
$ sc -c “read
my_program” -s sockets/s.sc_tool
|
|
-v
|
Used to get the current version of the
sc.
$ sc -v
|
|
-x program
|
Used to run the program syntax
checker.
$ sc –x program
|
In this section we discuss the sc commands.
The following sc commands can be entered at the sc prompt: