SicsEase

Search SINQ Wiki:
SINQ LIN

SINQ Wiki
- Main Page
- Search SINQ Wiki
- Sample Environment
- Probenumg. Intern
- Troubleshooting SICS

This Page
- Page Info
- Printer Friendly

Referenced by
NewFeaturesInSICS

Wiki Info
- Unused pages
- Undefined pages
- RecentChanges
- Page Index
- System Info
- JSPWiki Docu
- SandBox
- OneMinuteWiki
- Create a New Page




JSPWiki v2.0.52


This is version 5. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


EASE - An Easy Way to Write Sample Environment Drivers

Motivation

Drivers for sample environment (SE) have some special demands which were not fully supported by the original SICS environment controller (EVC):

  • SE is changing, therefore the creation of objects is dynamic (i.e. after startup). This was already supported, but with the drawback, that they had to be created again when restarting SICS. All EASE objects are dynamic and persistent.
  • As SE hardware might be changed, it is not always guaranteed, that a device is connected and switched on. With the devices implemented in EVC, waiting for a response blocks the SICS server. EASE objects work with a simple "finite state machine" (fsm.c) which simulates a parallel execution of the tasks to be performed.
  • Making an EVC driver means writing a lot of code for initialization. For a more complex driver you need also much parameter and subcommand handling. EASE does initialization and parameter handling for you.

pardef

pardef.c contains the implementation base class ParData for a new type of SICS object. It contains parameter definition, parameter handling, parameter listing, logging and storing. The parameter definiton function is the heart of any object based on pardef. This function is called by the system for different actions which can be performed on an object.

EASE

ease.c contains two classes: EaseBase inherits ParData. It includes the finite state machine, and the handling of a serial connection to the hardware. EaseDriv inherits EaseBase. It makes the object driveable.

fsm

fsm.c is the implementation of a simple processor. The tasks which can be executed are functions (FsmFunc) which contain a switch statement, where every case is a step of the task to execute. When combined with EASE, the individual steps normally end with a command written to the device. After any step, the FsmFunc returns the line number of the next step. The system calles the FsmFunc again, when the response is ready. FsmFuncs might be nested.

Drivers based on EASE

For a driver, one needs to define

  • the parameter definition function
  • the start function, an FsmFunc, called after connection to the device
  • the read function, called repeatedly. It should read all relevant information from the device
  • a protocol dependent handler, dealing with the specialities of a protocol. This is normally implemented in a separate source file, as it might be used for different devices using the same protocol.
  • for driveable objects, a run function. It should contain all operations needed to drive to the target value
  • the initializer, calling EaseMakeBase or EaseMakeDriv with some class information and the functions mentioned above as arguments
  • the init function, creating the class and inserting the initializer to the system

Common Parameters and Subcommands for all EASE Objects

Commands are marked with c in the second column, read-only parameters with r, writeable parameters with w.

Subcommand or
Parameter
C/W/RAction Defined by
list cMake a list of most important parameters (all parameters defined with a call to ParTail and not ParList, or with a call to ParList(NULL)pardef
list all cMake a full list of all parameters pardef
list <group> cMake a list of only a group of parameters (all parameters defined with a call to ParList("<group>") )pardef
log <par> cSwitch the logger on for parameter <par> (on for parameters defined without an explicit call to ParSwitch(NULL) )pardef
log <par> <sugar> cSwitch the logger on for parameter <par>, giving a sugar name (see SicsStrObjSugar?)pardef
unlog <par> cSwitch the logger off for parameter <par>pardef
sugar cReturn a list of sugar parameters pardef
save <par> cSwitch on status file saving for parameter <par> (on for changeable parameters, or explicitley when defined with a call to ParSave pardef
unsave <par> cSwitch off status file saving for parameter <par>pardef
interest cSwitch interest callback on (every change will be notified to the executive client)pardef
uninterest cSwitch interest callback off pardef
verbose wControl verbosity. 0 is quiet, 1 is standard, 2 is verbose (logging all serial communication)ParStdDef
driver rDriver name ParStdDef
creationCmd rcommand to create this object ParStdDef

Currently implemented drivers

Oxford Instruments Devices (protocol handler: oxinst.c)

  • ilmdriv.c (based on EaseBase)
  • ipsdriv.c, itcdriv.c, ighdriv.c (based in EaseDriv)

ModBus devices (protocol handler: modbus.c)

  • euro2kdriv.c (based on EaseDriv)


This particular version was published on 19-Sep-2005 07:52:50 UTC by MarkusZolliker.