Edge Integration

 

Station Controller (sc)

 

User’s Guide

 

 

 

 

Tuesday, August 09, 2005

Version 2.1

 

 

 

 

 

 

 

 

 

 

 

 

 

Ó Copyright Edge Integration 2005

 


Table of Contents

 

 

 

 

 

 

Revision Notes. 3

Introduction. 5

Getting Started. 5

sc Commands. 6

sc Program.. 7

Hello World. 7

Program structure. 8

Program execution. 8

Handling Event and Reply Messages. 9

Parsing rules. 10

Program Variables. 11

Dumping sc Variables. 11

Variable Context 12

Using Timers. 12

Error Handling. 13

Reference. 14

Program statements. 14

Math Operators. 18

Relational Operators. 19

Boolean Operators. 19

Bitwise Operators. 19

Constants. 19

String concatenation. 20

Keywords. 20

Functions. 20

Command Protocol 26

Standard Protocol 26

Options. 27

Example. 28

SECS Protocol 29

SECSI 30

Interleaving Messages. 30

SECSI options. 30

SECSI Contention. 31

HSMS. 31

HSMS options. 31

Annotated SECSII Message. 32

Variables in SECSII Replies and Unsolicited Messages. 33

For/next loops. 34

Handling SECS Events. 35

Hints. 35

Getting the sc version. 35

Examples. 36

 

 


Revision Notes

Versions

 

Version 2.1

 

 

 

 

 

 

Version 2.0.6

 

 

Version 2.0.5

 

 

Version 2.0.4

 

 

Version 2.0.3

 

 

Version 2.0.2

 

 

Version 2.0.1

 

 

Version 2.0 - Open Source

 

 

Known Bugs

 

 

Future Enhancements

 

Introduction

 

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.

 

Getting Started

 

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

 

sc Commands

 

In this section we discuss the sc commands.

 

The following sc commands can be entered at the sc prompt: