Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 22.12.2024 - 04:45
Static Public Member Functions | List of all members
tine.TKernel Class Reference

TKernel is the TINE Kernel (singleton) class, whose static methods are used to manage the TINE engine. More...

Static Public Member Functions

static Int32 AssignBufferSpace (UInt32 clnRcvBufferSpace, UInt32 srvRcvBufferSpace, UInt32 clnSndBufferSpace, UInt32 srvSndBufferSpace)
 Assigns specific buffer capacity for certain configurable TINE sockets. More...
 
static Int32 AssignBufferSpace (UInt32 rcvBufferSpace, UInt32 sndBufferSpace)
 Assigns specific buffer capacity for certain configurable TINE sockets. More...
 
static Int32 FecLog (string text)
 Appends the given text to the FEC process's log file. More...
 
static double GetDataTimeStamp ()
 Provides the last established data timestamp. More...
 
static Int32 GetFecLogDepth ()
 Retrieves the current setting for the maximum number of log entries in the FEC process's log file. More...
 
static String GetHistoryFilesRepository ()
 The current local history file repository More...
 
static String GetHistoryStaticFilesRepository ()
 The current static local history file repository Local history files located in this area will not be automatically removed by the local history system. More...
 
static Int32 GetPortOffset (String fecName)
 Obtains the FEC port offset appropriate for the give FEC name. More...
 
static int GetSystemDataStamp ()
 Provides the last established system data stamp More...
 
static double GetUtcNow ()
 Returns the current UTC time (seconds since 1970) as a double (with fractional seconds). More...
 
static UInt32 GetWorkAreaSize ()
 Gets the server-side work area size which is coupled to the maximum transport size for supported by a single-threaded server. More...
 
static Int32 InitializeServer ()
 Initializes the TINE server engine. More...
 
static double MakeDataTimeStamp ()
 Makes a data timestamp according to the current system time. More...
 
static int MakeSystemDataStamp ()
 A server will automatically obtain and update the cannonical system data stamp for its context if a CYCLER is available for that context. The system data stamp logically represents a 'cycle number' or 'pulse number' which is used to systematically tag data objects. If no CYCLER exists, then the value for the system data stamp will always be = 0. This call is in parallel with MakeDataTimeStamp() and is nominally equivalent to GetSystemDataStamp. More...
 
static double ParseTineTimeString (String value)
 Makes a UTC double from the give string input More...
 
static Int32 RegisterDeviceName (String eqm, String devName, Int32 devNr)
 Assigns a device name to the specified device number. More...
 
static Int32 RegisterFecInformation (String fecName, String defaultSubSystem, String defaultContext, String fecDescription, String fecLocation, String attachedHardware, String responsible)
 Assigns a FEC Name and descriptive information to the server process. With this call, the FEC's port offset will be determined by accessing the local manifest. More...
 
static Int32 RegisterFecInformation (String fecName, String defaultSubSystem, String defaultContext, String fecDescription, String fecLocation, String attachedHardware, String responsible, UInt16 portOffset)
 Assigns a FEC Name and descriptive information to the server process. More...
 
static Int32 RegisterPropertyInformation (String eqm, String prpName, TDataType dtOut, TDataType dtIn, UInt16 accessMode, UInt16 arrayType, UInt16 rowLength, String prpDescription, Int32 prpId, String redirectionTarget)
 Assigns pertinent information for the specified property. More...
 
static void SetDataTimeStamp (double timestamp)
 Sets the intrinsic data timestamp to the value given. More...
 
static Int32 SetDeviceDescription (String eqm, String devName, String description)
 Assigns a description to a registered device More...
 
static Int32 SetDeviceLocation (String eqm, String devName, String location)
 Assigns a location to a registered device More...
 
static Int32 SetDeviceMask (String eqm, String devName, int mask)
 Assigns a mask to a registered device More...
 
static Int32 SetDeviceOfflineStatus (String eqm, String devName, Boolean offline)
 Assigns an offline status to a registered device More...
 
static Int32 SetDeviceRegion (String eqm, String devName, String region)
 Assigns an alarm region to a registered device More...
 
static Int32 SetDeviceZPosition (String eqm, String devName, float zposition)
 Assigns an Z-position to a registered device More...
 
static void SetExcludePointsOfInterest (Boolean value)
 Turns local history points of interest data taking on or off More...
 
static void SetFecLogDepth (Int32 depth)
 Sets the approximate maximum number of log entries in the FEC process's log file. More...
 
static void SetHistoryDeactivateOnError (Boolean value)
 Turns local history decactivation on error on or off More...
 
static void SetHistoryFilesRepository (String path)
 Establishes the local history file repository. More...
 
static void SetHistoryStaticFilesRepository (String path)
 Establishes the static local history file repository. Local history files located in this area will not be automatically removed by the local history system. More...
 
static void SetSystemDataStamp (int value)
 A server will automatically obtain and update the cannonical system data stamp for its context if a CYCLER is available for that context. The system data stamp logically represents a 'cycle number' or 'pulse number' which is used to systematically tag data objects. If no CYCLER exists, then the value for the system data stamp will always be = 0. A server may need to record the current system stamp at the time of e.g. a hardware trigger and apply the value in subsequent calls to access data. This method can be used toward these ends. More...
 
static void SetUseStandardHistoryFiles (Boolean value)
 Turns on so-called standard non-fragmented (worst-case) local history files More...
 
static UInt32 SetWorkAreaSize (UInt32 sizeInBytes)
 Sets the server-side work area size which is coupled to the maximum transport size for supported by a single-threaded server. More...
 
static Int32 SrvLog (string filename, string tag, string text)
 Appends the given text to the designated log file. More...
 
static void StartServices ()
 Required call for the TINE engine to function property. More...
 
static void StopServices ()
 Explicity shuts down the TINE engine (not something you want to be doing very often). More...
 

Detailed Description

TKernel is the TINE Kernel (singleton) class, whose static methods are used to manage the TINE engine.

Member Function Documentation

◆ AssignBufferSpace() [1/2]

static Int32 tine.TKernel.AssignBufferSpace ( UInt32  clnRcvBufferSpace,
UInt32  srvRcvBufferSpace,
UInt32  clnSndBufferSpace,
UInt32  srvSndBufferSpace 
)
inlinestatic

Assigns specific buffer capacity for certain configurable TINE sockets.

The standard TINE client and server sockets (both UDP, TCP, and STREAM) are initiated with a reasonable default amount of receive (64 Kbyte) and send (32 Kbyte) buffer capacity. If for any performance reason, more or less buffer capactiy is needed, this routine should be called prior to any calls to SystemInit() or SystemCycle(). For example, VxWorks builds which do not have a large amount of network resources might want to set these values smaller than the defaults. Video system clients expecting extreme amounts of incoming data might want to set these values to a much larger amount.

This call allows the setting of the server side receive buffer space as well as the client side send buffer space. This is potentially applicable in rare cases (middle layer servers) where large data payloads are sent as input from a client to a server.

As in the case of _SystemAssignBufferSpace(), the UDP specific send buffer size is kept to a reasonable value, no larger than twice the registered packet MTU. UDP datagram transmission is not inhibited by any client-server flow control which might cause the send buffer space to stack up.

Parameters
clnRcvBufferSpaceis the amount of receive buffer space (in bytes) to assign to the configurable TINE client sockets. A value of '0' will assign the default receive buffer capacity.
srvRcvBufferSpaceis the amount of receive buffer space (in bytes) to assign to the configurable TINE server sockets. A value of '0' will assign the same value as clnRcvBufferSpace (and damping this value by a factor of 2 should it exceed the default receive buffer capacity).
clnSndBufferSpaces the amount of send buffer space (in bytes) to assign to the configurable TINE client sockets. A value of '0' will assign the same value as srvSndBufferSpace (and damping this value by a factor of 2 should it exceed the default receive buffer capacity).
srvSndBufferSpaceis the amount of send buffer space (in bytes) to assign to the configurable
TINE server TCP or STREAM sockets. The UDP socket buffer space will be at least as large as twice the assigned UDP packet MTU. A value of 0' will assign the default send buffer capacity.
Returns
0 on success or a TINE error code

◆ AssignBufferSpace() [2/2]

static Int32 tine.TKernel.AssignBufferSpace ( UInt32  rcvBufferSpace,
UInt32  sndBufferSpace 
)
inlinestatic

Assigns specific buffer capacity for certain configurable TINE sockets.

The standard TINE client and server sockets (both UDP, TCP, and STREAM) are initiated with a reasonable default amount of receive (64 Kbyte) and send (32 Kbyte) buffer capacity. If for any performance reason, more or less buffer capactiy is needed, this routine should be called prior to any calls to SystemInit() or SystemCycle(). For example, VxWorks builds which do not have a large amount of network resources might want to set these values smaller than the defaults. Video system clients expecting extreme amounts of incoming data might want to set these values to a much larger amount.

The principal benificiaries of the 'receive buffer space' are the client sockets (UDP,TCP and SREAM), whereas the principal benificiaries of the 'send buffer space' are the server sockets (TCP and STREAM). The remaining socket buffer space (e.g. client-side send buffer space or server side receive buffer space) will be held at 'reasonable' values, the assumption being that the dominant data delivery will generally server (sending) to client (receiving).

Parameters
rcvBufferSpaces the amount of receive buffer space (in bytes) to assign to the configurable TINE sockets. A value of '0' will assign the default receive buffer capacity.
sndBufferSpacesndBufferSpace is the amount of send buffer space (in bytes) to assign to the configurable TINE TCP or
STREAM sockets. The UDP socket send buffer space if not influenced by this parameter and will be at least as large as twice the assigned UDP packet MTU. See _SystemAssignUdpSendBufferSpace(). A value of 0' will assign the default send buffer capacity.
Returns
0 on success or a TINE error code

◆ FecLog()

static Int32 tine.TKernel.FecLog ( string  text)
inlinestatic

Appends the given text to the FEC process's log file.

Each log entry is prefixed by the FEC process name (i.e. the 'FECNAME') and the time and date. The location of the log file (named 'fec.log' and rotated once into 'fec.bak') is determined by the environment variable FEC_LOG (first choice) or FEC_HOME. If neither environment variable is set, then the fec.log file will be written to the current working directory.

Parameters
textis the desired text to be appended to the FEC log file
Returns
0 upon success or a TINE error code (e.g. file_error)

◆ GetDataTimeStamp()

static double tine.TKernel.GetDataTimeStamp ( )
inlinestatic

Provides the last established data timestamp.

A call to getDataTimeStamp() immediately following a call to ExecLink() or within a callback routine will yield the data timestamp of the call. Note: This call is not thread-safe. Synchronous data acquisition on two different threads could conceivably interfer with the value returned from this routine. A thread-safe way of obtaining the data timestamp associated with a call is to use the .dTimestamp field of the DTYPE object for synchronous calls such as ExecLink() or ExecLinkEx() or to use getCurrentDataTimeStampFromCallbackId() or getCurrentDataTimeStamp() (which take a link identifier as input parameter) for asynchronous links.

Returns
The data timestamp currently in place.

◆ GetFecLogDepth()

static Int32 tine.TKernel.GetFecLogDepth ( )
inlinestatic

Retrieves the current setting for the maximum number of log entries in the FEC process's log file.

Returns
The current setting.

◆ GetHistoryFilesRepository()

static String tine.TKernel.GetHistoryFilesRepository ( )
inlinestatic

The current local history file repository

Returns
The current local history file repository

◆ GetHistoryStaticFilesRepository()

static String tine.TKernel.GetHistoryStaticFilesRepository ( )
inlinestatic

The current static local history file repository Local history files located in this area will not be automatically removed by the local history system.

Returns
The current static local history file repository

◆ GetPortOffset()

static Int32 tine.TKernel.GetPortOffset ( String  fecName)
inlinestatic

Obtains the FEC port offset appropriate for the give FEC name.

In cases where the pure registration API routines are used to register FEC and server information (as opposed to a common fecid.csv configuration file) it is often a more cumbersome task to ensure a unique FEC port on the host machine. This routine can be used to this end. It will search the existing FEC manifest on the current host in order to find the matching entry for the given FEC name. If the entry is not found, then the 'next free port' is returned. In this way the FEC can always register with its own proper FEC port, without the need to hard code this number.

If this routine is called after the server is running and the FEC name is not found in the manifest then -name_unknown is returned.

Parameters
fecName
Returns
the port offset applicable for the given FEC name or the a negative number giving the negative of the TINE return code indicating an error.

◆ GetSystemDataStamp()

static int tine.TKernel.GetSystemDataStamp ( )
inlinestatic

Provides the last established system data stamp

A server will automatically obtain and update the cannonical system data stamp for its context if a CYCLER is available for that context. The system data stamp logically represents a 'cycle number' or 'pulse number' which is used to systematically tag data objects. If no CYCLER exists, then the value for the system data stamp will always be = 0.

Returns
The system data stamp current in place.

◆ GetUtcNow()

static double tine.TKernel.GetUtcNow ( )
inlinestatic

Returns the current UTC time (seconds since 1970) as a double (with fractional seconds).

Returns
the current UTC time (seconds since 1970) as a double (with fractional seconds)

◆ GetWorkAreaSize()

static UInt32 tine.TKernel.GetWorkAreaSize ( )
inlinestatic

Gets the server-side work area size which is coupled to the maximum transport size for supported by a single-threaded server.

Server-side equipment function calls are double buffered, one buffer being a dynamic allocation of the caller's requested data size, the other buffer being in the case of single threaded servers, a temporary use of the server's work area. In order to allow transfer of 'large' data sets, this size needs to be adjusted accordingly prior to server initialization. Note that multi-threaded servers will dynamically allocate both buffers on a call by call basis.

Returns
The current setting for the server's work area.

◆ InitializeServer()

static Int32 tine.TKernel.InitializeServer ( )
inlinestatic

Initializes the TINE server engine.

This method MUST be invoked for the TINE server engine to function property. Should be called prior to the start of the main TINE server engine. Any deviations from default system parameters should be made before server initialization. This might include server settings which fix the size of the local connection table entries, the maximum date transport size, etc. Note that InitializeServer() will begin allocating space for its connection tables, so modifying these values away from their defaults will have no effect after InitializeServer() has been called. Also, if the FEC Name is given by calling RegisterFecName() then this should also preceed a call to InitializeServer().

Returns
0 if successful, otherwise a TINE completion code.

Example:

public TEquipmentModule myeqm;
// GUI server: use form_load ...
private void Form1_Load(object sender, EventArgs e)
{
// register the FEC name and other information (important: portOffset must be host-wide unique)
TKernel.RegisterFecInformation("MYFEC", "TEST", "TEST", "My .NET Test Fec", "My office", "none", "Me", 15);
// alternative: use a fecid.csv file (or fec.xml)
// register the equipment module and export it as 'MYServer'
myeqm = new TEquipmentModule("MYServer", "MYEQM", 10, eqm_handler, eqm_ini, eqm_bkg, 100, eqm_exi);
// alternative: use the exports.csv or fec.xml to register export names and properties)
// initialize the server (not optional!)
TKernel.InitializeServer();
// register the properties (alternative: use exports.csv or fec.xml)
// first: property 'Sine' is a trace waveform which can return up to 8192 float values (no input):
TDataType dtout = new TDataType(new float[8192]);
myeqm.RegisterPropertyInformation("Sine", dtout, null, Access.CA_READ, ArrayType.AT_TRACE, 8192, "[-512:512 V]Sine Curve", PRP_SINE, "");
// the following properties are 'multi-channel' properties
// one can read all values for the 10 sine curves at once, but only set 1 at a time:
dtout = new TDataType(new float[10]);
TDataType dtin = new TDataType(new float[1]);
myeqm.RegisterPropertyInformation("Amplitude", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[-512:512 V]Sine Curve Amplitude", PRP_AMPLITUDE, "");
myeqm.RegisterPropertyInformation("Frequency", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[1:20 Hz]Sine Curve Frequency", PRP_FREQUENCY, "");
myeqm.RegisterPropertyInformation("Phase", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:6.28]Sine curve Phase", PRP_PHASE, "");
myeqm.RegisterPropertyInformation("Noise", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:50 V]Sine curve Noise", PRP_NOISE, "");
// put in some device names (alternatve: use devices.csv or fec.xml)
for (int i = 0; i < 10; i++)
{
myeqm.RegisterDeviceName("MyDevice" + i, i);
}
// now start the server (not optional) ...
TKernel.StartServices();
}
}

◆ MakeDataTimeStamp()

static double tine.TKernel.MakeDataTimeStamp ( )
inlinestatic

Makes a data timestamp according to the current system time.

Returns
A tine data timestamp.

◆ MakeSystemDataStamp()

static int tine.TKernel.MakeSystemDataStamp ( )
inlinestatic

A server will automatically obtain and update the cannonical system data stamp for its context if a CYCLER is available for that context. The system data stamp logically represents a 'cycle number' or 'pulse number' which is used to systematically tag data objects. If no CYCLER exists, then the value for the system data stamp will always be = 0. This call is in parallel with MakeDataTimeStamp() and is nominally equivalent to GetSystemDataStamp.

Returns
The system data stamp current in place.

◆ ParseTineTimeString()

static double tine.TKernel.ParseTineTimeString ( String  value)
inlinestatic

Makes a UTC double from the give string input

Parameters
valueA TINE time string
Returns
A UTC timestamp as a double value

◆ RegisterDeviceName()

static Int32 tine.TKernel.RegisterDeviceName ( String  eqm,
String  devName,
Int32  devNr 
)
inlinestatic

Assigns a device name to the specified device number.

Many servers handle instances of a given device type, such as a set of vacuum pumps, beam position monitors, magnet power supply controllers, etc. It is frequently very efficient to code in terms of device numbers which might be an index into an array, but to specify modules in calls by their human-readable names. For such purposes a device name can be assigned to a number at initialization via a call to RegisterDeviceName() (alias: RegisterModuleName()). An alternative is to provide a startup database file 'devices.csv' containing a cross-reference for numbers and names. Internally, a hash table is maintained for fast lookups inside equipment module routines.

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name to be assigned
devNrThe device number associated with the device name specified.
Returns
0 if successful, otherwise a TINE completion code

Example:

public TEquipmentModule myeqm;
// GUI server: use form_load ...
private void Form1_Load(object sender, EventArgs e)
{
// register the FEC name and other information (important: portOffset must be host-wide unique)
TKernel.RegisterFecInformation("MYFEC", "TEST", "TEST", "My .NET Test Fec", "My office", "none", "Me", 15);
// alternative: use a fecid.csv file (or fec.xml)
// register the equipment module and export it as 'MYServer'
myeqm = new TEquipmentModule("MYServer", "MYEQM", 10, eqm_handler, eqm_ini, eqm_bkg, 100, eqm_exi);
// alternative: use the exports.csv or fec.xml to register export names and properties)
// initialize the server (not optional!)
TKernel.InitializeServer();
// register the properties (alternative: use exports.csv or fec.xml)
// first: property 'Sine' is a trace waveform which can return up to 8192 float values (no input):
TDataType dtout = new TDataType(new float[8192]);
myeqm.RegisterPropertyInformation("Sine", dtout, null, Access.CA_READ, ArrayType.AT_TRACE, 8192, "[-512:512 V]Sine Curve", PRP_SINE, "");
// the following properties are 'multi-channel' properties
// one can read all values for the 10 sine curves at once, but only set 1 at a time:
dtout = new TDataType(new float[10]);
TDataType dtin = new TDataType(new float[1]);
myeqm.RegisterPropertyInformation("Amplitude", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[-512:512 V]Sine Curve Amplitude", PRP_AMPLITUDE, "");
myeqm.RegisterPropertyInformation("Frequency", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[1:20 Hz]Sine Curve Frequency", PRP_FREQUENCY, "");
myeqm.RegisterPropertyInformation("Phase", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:6.28]Sine curve Phase", PRP_PHASE, "");
myeqm.RegisterPropertyInformation("Noise", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:50 V]Sine curve Noise", PRP_NOISE, "");
// put in some device names (alternatve: use devices.csv or fec.xml)
for (int i = 0; i < 10; i++)
{
myeqm.RegisterDeviceName("MyDevice" + i, i);
}
// now start the server (not optional) ...
TKernel.StartServices();
}
}

Referenced by tine.TEquipmentModule.RegisterDeviceName().

◆ RegisterFecInformation() [1/2]

static Int32 tine.TKernel.RegisterFecInformation ( String  fecName,
String  defaultSubSystem,
String  defaultContext,
String  fecDescription,
String  fecLocation,
String  attachedHardware,
String  responsible 
)
inlinestatic

Assigns a FEC Name and descriptive information to the server process. With this call, the FEC's port offset will be determined by accessing the local manifest.

Servers must be assigned to a Front End Computer (FEC), which for many operating systems corresponds to a process running on the computer rather than the computer itself (meaning there can in some cases be more than one servers with different 'FEC' names running on the same computer. There can be several device servers attached to the same FEC (i.e. sharing the same address space), so the FEC name is a distinct quantity from the device server name (see RegisterExport()), and this name must also be system-wide unique. The call RegisterFecInformation() supercedes RegisterFecNameEx() and RegisterFecName() and differs from them in that it accepts 'Context' and 'SubSystem' as parameters, both of which will be applied to all device servers attaching to the same FEC name. The FEC name can also be (and frequently is) registered via the presence of an 'fecid.csv' startup database file.

Parameters
fecNameThe FEC name indentifying the Front End Computer and to which all registered equipment modules are bound.
defaultSubSystemThe subsystem to which attached device servers belong. Note that the subsystem (unlike context) is itself not part of the name space, although the name space can be queried for device servers belonging to a subsystem. This information is now deduced automatically from the library build.
defaultContextA 32-character string giving the context of all registered equipment modules. (earlier versions of TINE truncated at 16 characters).
fecDescriptionA 64-character desciption of the FECs server duties. A 'subsystem' can be associated with ALL equipment modules found on the FEC by prefixing the description with a subsystem tag. This information will be parsed by the Equipment name server and used for sub-system specific queries. For example, the associate the FEC "HEPHF" with the subsystem "RF", the description field might be "[RF]Hera Proton HF Control".
fecLocationA 32-character string giving the phyical location of the FEC.
attachedHardwareA 32-character brief description of the IO hardware found on the FEC.
responsibleA 32-character string listing the developer(s) responsible for the FEC. Note: The Equipment Name Server will allow the removal of FECs and associated equipment modules to the user(s) specified here.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError()

◆ RegisterFecInformation() [2/2]

static Int32 tine.TKernel.RegisterFecInformation ( String  fecName,
String  defaultSubSystem,
String  defaultContext,
String  fecDescription,
String  fecLocation,
String  attachedHardware,
String  responsible,
UInt16  portOffset 
)
inlinestatic

Assigns a FEC Name and descriptive information to the server process.

Servers must be assigned to a Front End Computer (FEC), which for many operating systems corresponds to a process running on the computer rather than the computer itself (meaning there can in some cases be more than one servers with different 'FEC' names running on the same computer. There can be several device servers attached to the same FEC (i.e. sharing the same address space), so the FEC name is a distinct quantity from the device server name (see RegisterExport()), and this name must also be system-wide unique. The call RegisterFecInformation() supercedes RegisterFecNameEx() and RegisterFecName() and differs from them in that it accepts 'Context' and 'SubSystem' as parameters, both of which will be applied to all device servers attaching to the same FEC name. The FEC name can also be (and frequently is) registered via the presence of an 'fecid.csv' startup database file.

Parameters
fecNameThe FEC name indentifying the Front End Computer and to which all registered equipment modules are bound.
defaultSubSystemThe subsystem to which attached device servers belong. Note that the subsystem (unlike context) is itself not part of the name space, although the name space can be queried for device servers belonging to a subsystem. This information is now deduced automatically from the library build.
defaultContextA 32-character string giving the context of all registered equipment modules. (earlier versions of TINE truncated at 16 characters).
fecDescriptionA 64-character desciption of the FECs server duties. A 'subsystem' can be associated with ALL equipment modules found on the FEC by prefixing the description with a subsystem tag. This information will be parsed by the Equipment name server and used for sub-system specific queries. For example, the associate the FEC "HEPHF" with the subsystem "RF", the description field might be "[RF]Hera Proton HF Control".
fecLocationA 32-character string giving the phyical location of the FEC.
attachedHardwareA 32-character brief description of the IO hardware found on the FEC.
responsibleA 32-character string listing the developer(s) responsible for the FEC. Note: The Equipment Name Server will allow the removal of FECs and associated equipment modules to the user(s) specified here.
portOffsetThe 'Port Offset' to be applied to the FEC. This parameter plays an important role where more that one FEC is to run on a machine running an operating system using virtual memory. In such cases 'Front End Computer' is a misnomer, since "FEC" really refers to a process running on the computer to which one or more equipment modules are bound. For operating systems where all processes run in the same address space (such as VxWorks, MS-DOS, Win16, NIOS) there is in fact only one such processes managing all requistered equipment modules. For systems using virtual memory (such as Linux, Solaris, HP-UX, Win32, etc.), you can have many such processes running independently of one another. Since each such process must listen on a unique set of server ports, you must see to it that all such FEC processes are registered with a unique 'Port Offset'.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError()

Example:

public TEquipmentModule myeqm;
// GUI server: use form_load ...
private void Form1_Load(object sender, EventArgs e)
{
// register the FEC name and other information (important: portOffset must be host-wide unique)
TKernel.RegisterFecInformation("MYFEC", "TEST", "TEST", "My .NET Test Fec", "My office", "none", "Me", 15);
// alternative: use a fecid.csv file (or fec.xml)
// register the equipment module and export it as 'MYServer'
myeqm = new TEquipmentModule("MYServer", "MYEQM", 10, eqm_handler, eqm_ini, eqm_bkg, 100, eqm_exi);
// alternative: use the exports.csv or fec.xml to register export names and properties)
// initialize the server (not optional!)
TKernel.InitializeServer();
// register the properties (alternative: use exports.csv or fec.xml)
// first: property 'Sine' is a trace waveform which can return up to 8192 float values (no input):
TDataType dtout = new TDataType(new float[8192]);
myeqm.RegisterPropertyInformation("Sine", dtout, null, Access.CA_READ, ArrayType.AT_TRACE, 8192, "[-512:512 V]Sine Curve", PRP_SINE, "");
// the following properties are 'multi-channel' properties
// one can read all values for the 10 sine curves at once, but only set 1 at a time:
dtout = new TDataType(new float[10]);
TDataType dtin = new TDataType(new float[1]);
myeqm.RegisterPropertyInformation("Amplitude", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[-512:512 V]Sine Curve Amplitude", PRP_AMPLITUDE, "");
myeqm.RegisterPropertyInformation("Frequency", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[1:20 Hz]Sine Curve Frequency", PRP_FREQUENCY, "");
myeqm.RegisterPropertyInformation("Phase", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:6.28]Sine curve Phase", PRP_PHASE, "");
myeqm.RegisterPropertyInformation("Noise", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:50 V]Sine curve Noise", PRP_NOISE, "");
// put in some device names (alternatve: use devices.csv or fec.xml)
for (int i = 0; i < 10; i++)
{
myeqm.RegisterDeviceName("MyDevice" + i, i);
}
// now start the server (not optional) ...
TKernel.StartServices();
}
}

◆ RegisterPropertyInformation()

static Int32 tine.TKernel.RegisterPropertyInformation ( String  eqm,
String  prpName,
TDataType  dtOut,
TDataType  dtIn,
UInt16  accessMode,
UInt16  arrayType,
UInt16  rowLength,
String  prpDescription,
Int32  prpId,
String  redirectionTarget 
)
inlinestatic

Assigns pertinent information for the specified property.

Servers export their behavior through Properties, which can be thought of as 'properties' in the Object Oriented sense with Get and Set methods. That is, any read or write access for a given property will call into the associated equipment module and be handled there. The general behavior of the property (including descriptions) can be specified with this call. Properties can also be (and frequently are) registered via the presence of an 'exports.csv' startup database file. Note: Properties which are overloaded can and should be registered more than once with the appropriate characteristics supplied in the registration call.

Parameters
eqmA local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
prpNameProperty name in question (up to 32 characters, preferably 16 or less).
dtOutAtemplate data object giving the default format size, and structure tag (if any) of the output data set to be returned by the server to the caller.
dtInA template data object giving the default format size, and structure tag (if any) of the input data set to be supplied by the caller.
accessModethe data 'access' (e.g. CA_READ or CA_WRITE) accepted by the server. This parameter can be used to coerce client-side links into using preferred link attributes. For example, by applying the CA_NETWORK flag (CA_READ|CA_NETWORK) to the access, asynchronous NETWORK (i.g. multicast acquisition) will be enforced at the client side. Applying the CA_XREAD access flag will likewise allow exclusive READ access regarding the registered property (i.e. the same security rules applied to CA_WRITE will be in force for READ acquisitions, either permanently - no CA_READ flag, or temporarily in case of an applied access lock - if both CA_READ and CA_XREAD are applied). Applying the CA_SAVERESTORE flag will apply the internal save-and-restore logic to the registered property (restoring the last property settings upon server startup, and saving any changed property settings).
arrayTypeData 'array type' (AT_SCALAR, AT_SINGLE, etc.) associated with the returned data.
rowLengthif > 0 gives the row length of the returned array data. This is most relevant for double arrays, where the number of rows is then given by the output data size divided by the row length.
prpDescriptionThe 64-character description of what the property reads or writes.
prpIdThe property identifier to be associated with the property name returned in calls to GetPropertyId()
redirectionTargetA redirection string, if the property is to be redirected to another server. Most properties are not redirected, and this parameter is usually NULL. If used, it will be parsed according to device server/device name (device property), where the 'device name' and 'device property' are optional. If 'device name' is not present, all devices will be redirected to the specified device server. If 'device property' is not present then the identical property name as registered will be redirected to the device server specified. If on the other hand, the device property is present in the string to be parsed, then the property registered will be redirected to the device server specified as well as to the device property specified.
Returns
The (positive) associated property identifier if successful, otherwise the negative of a TINE return code.

Example:

public TEquipmentModule myeqm;
// GUI server: use form_load ...
private void Form1_Load(object sender, EventArgs e)
{
// register the FEC name and other information (important: portOffset must be host-wide unique)
TKernel.RegisterFecInformation("MYFEC", "TEST", "TEST", "My .NET Test Fec", "My office", "none", "Me", 15);
// alternative: use a fecid.csv file (or fec.xml)
// register the equipment module and export it as 'MYServer'
myeqm = new TEquipmentModule("MYServer", "MYEQM", 10, eqm_handler, eqm_ini, eqm_bkg, 100, eqm_exi);
// alternative: use the exports.csv or fec.xml to register export names and properties)
// initialize the server (not optional!)
TKernel.InitializeServer();
// register the properties (alternative: use exports.csv or fec.xml)
// first: property 'Sine' is a trace waveform which can return up to 8192 float values (no input):
TDataType dtout = new TDataType(new float[8192]);
myeqm.RegisterPropertyInformation("Sine", dtout, null, Access.CA_READ, ArrayType.AT_TRACE, 8192, "[-512:512 V]Sine Curve", PRP_SINE, "");
// the following properties are 'multi-channel' properties
// one can read all values for the 10 sine curves at once, but only set 1 at a time:
dtout = new TDataType(new float[10]);
TDataType dtin = new TDataType(new float[1]);
myeqm.RegisterPropertyInformation("Amplitude", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[-512:512 V]Sine Curve Amplitude", PRP_AMPLITUDE, "");
myeqm.RegisterPropertyInformation("Frequency", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[1:20 Hz]Sine Curve Frequency", PRP_FREQUENCY, "");
myeqm.RegisterPropertyInformation("Phase", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:6.28]Sine curve Phase", PRP_PHASE, "");
myeqm.RegisterPropertyInformation("Noise", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:50 V]Sine curve Noise", PRP_NOISE, "");
// put in some device names (alternatve: use devices.csv or fec.xml)
for (int i = 0; i < 10; i++)
{
myeqm.RegisterDeviceName("MyDevice" + i, i);
}
// now start the server (not optional) ...
TKernel.StartServices();
}
}

References tine.TDataType.GetDataFormat(), and tine.TDataType.GetDataTag().

Referenced by tine.TEquipmentModule.RegisterPropertyInformation().

◆ SetDataTimeStamp()

static void tine.TKernel.SetDataTimeStamp ( double  timestamp)
inlinestatic

Sets the intrinsic data timestamp to the value given.

This call is typically used inside an equipment function to set the data timestamp associated with the request being made. For instance, when the data are taken from the hardware IO loop, a call to makeDataTimeStamp() is made to get the current system timestamp. Then when a request for data is made the caller can know the precise time of data acquisition. If this routine is not called, then the current system time will be used to stamp the data.

Parameters
timestampThe timestamp to be associated with the next data set.

◆ SetDeviceDescription()

static Int32 tine.TKernel.SetDeviceDescription ( String  eqm,
String  devName,
String  description 
)
inlinestatic

Assigns a description to a registered device

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name for which the description is to be assigned
descriptionThe device description to assign to the device
Returns
0 if successful, otherwise a TINE completion code

◆ SetDeviceLocation()

static Int32 tine.TKernel.SetDeviceLocation ( String  eqm,
String  devName,
String  location 
)
inlinestatic

Assigns a location to a registered device

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name for which the location is to be assigned
locationThe device location to assign to the device
Returns
0 if successful, otherwise a TINE completion code

◆ SetDeviceMask()

static Int32 tine.TKernel.SetDeviceMask ( String  eqm,
String  devName,
int  mask 
)
inlinestatic

Assigns a mask to a registered device

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name for which the location is to be assigned
maskThe device mask to assign to the device
Returns
0 if successful, otherwise a TINE completion code

◆ SetDeviceOfflineStatus()

static Int32 tine.TKernel.SetDeviceOfflineStatus ( String  eqm,
String  devName,
Boolean  offline 
)
inlinestatic

Assigns an offline status to a registered device

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name for which the location is to be assigned
offlineThe offline status: 'true' => device is offline, 'false' => device is online
Returns
0 if successful, otherwise a TINE completion code

◆ SetDeviceRegion()

static Int32 tine.TKernel.SetDeviceRegion ( String  eqm,
String  devName,
String  region 
)
inlinestatic

Assigns an alarm region to a registered device

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name for which the region is to be assigned
regionThe alarm region to assign to the device
Returns
0 if successful, otherwise a TINE completion code

◆ SetDeviceZPosition()

static Int32 tine.TKernel.SetDeviceZPosition ( String  eqm,
String  devName,
float  zposition 
)
inlinestatic

Assigns an Z-position to a registered device

Parameters
eqmThe local equipment module name (maximum 6 characters in length) For example: "BPMEQM".
devNameUp to 64 characters device name for which the location is to be assigned
zpositionThe Z (longitundinal) position of the device in the machine
Returns
0 if successful, otherwise a TINE completion code

◆ SetExcludePointsOfInterest()

static void tine.TKernel.SetExcludePointsOfInterest ( Boolean  value)
inlinestatic

Turns local history points of interest data taking on or off

Parameters
valueif 'true' will instruct the local history system not to keep points of interest

◆ SetFecLogDepth()

static void tine.TKernel.SetFecLogDepth ( Int32  depth)
inlinestatic

Sets the approximate maximum number of log entries in the FEC process's log file.

The number of long entries is approximately deterimed by assuming the the average line of text contains 160 characters. If the number so deterimed exceeds the given FEC log depth, the current log file 'fec.log' will be rotated into 'fec.bak'.

Parameters
depthis the maximum number of lines the FEC's log file is allowed to have. (default = 1000)

◆ SetHistoryDeactivateOnError()

static void tine.TKernel.SetHistoryDeactivateOnError ( Boolean  value)
inlinestatic

Turns local history decactivation on error on or off

Parameters
valueif 'true' will mark a local history entry as non-active

◆ SetHistoryFilesRepository()

static void tine.TKernel.SetHistoryFilesRepository ( String  path)
inlinestatic

Establishes the local history file repository.

Parameters
paththe directory path specifying the repository

◆ SetHistoryStaticFilesRepository()

static void tine.TKernel.SetHistoryStaticFilesRepository ( String  path)
inlinestatic

Establishes the static local history file repository. Local history files located in this area will not be automatically removed by the local history system.

Parameters
paththe directory path specifying the repository

◆ SetSystemDataStamp()

static void tine.TKernel.SetSystemDataStamp ( int  value)
inlinestatic

A server will automatically obtain and update the cannonical system data stamp for its context if a CYCLER is available for that context. The system data stamp logically represents a 'cycle number' or 'pulse number' which is used to systematically tag data objects. If no CYCLER exists, then the value for the system data stamp will always be = 0. A server may need to record the current system stamp at the time of e.g. a hardware trigger and apply the value in subsequent calls to access data. This method can be used toward these ends.

Parameters
valueis the value of the system data stamp to apply to current data access.

◆ SetUseStandardHistoryFiles()

static void tine.TKernel.SetUseStandardHistoryFiles ( Boolean  value)
inlinestatic

Turns on so-called standard non-fragmented (worst-case) local history files

Parameters
valueif 'true' will instruct the local history system to use a 'standard' (non-fragmented) file set

◆ SetWorkAreaSize()

static UInt32 tine.TKernel.SetWorkAreaSize ( UInt32  sizeInBytes)
inlinestatic

Sets the server-side work area size which is coupled to the maximum transport size for supported by a single-threaded server.

Server-side equipment function calls are double buffered, one buffer being a dynamic allocation of the caller's requested data size, the other buffer being in the case of single threaded servers, a temporary use of the server's work area. In order to allow transfer of 'large' data sets, this size needs to be adjusted accordingly prior to server initialization. Note that multi-threaded servers will dynamically allocate both buffers on a call by call basis.

Parameters
sizeInBytesis the size in bytes to be reserved for the server's work area and hence the maximum allowed transport size for any property supported by the server. (default: 64 KBytes on most operating systems).
Returns
The current setting for the server's work area.

◆ SrvLog()

static Int32 tine.TKernel.SrvLog ( string  filename,
string  tag,
string  text 
)
inlinestatic

Appends the given text to the designated log file.

Parameters
filenameis the file name to which the log entry is to be appended. The file will be created in the 'FEC_LOG' or 'FEC_HOME' directory (as in the case of fec.log), and rotated using the same log depth established via SetFecLogDepth().
tagis a 'procedure tag' which will prefix the given log entry. If ommitted, the tag 'logger' will be used.
textis the desired log entry text.
Returns
0 upon success or a TINE error code.

◆ StartServices()

static void tine.TKernel.StartServices ( )
inlinestatic

Required call for the TINE engine to function property.

Export registered properties and devices, plug into the Equipment Name Services, begin monitoring local histories and alarms and servicing requests from callers.

Example:

public TEquipmentModule myeqm;
// GUI server: use form_load ...
private void Form1_Load(object sender, EventArgs e)
{
// register the FEC name and other information (important: portOffset must be host-wide unique)
TKernel.RegisterFecInformation("MYFEC", "TEST", "TEST", "My .NET Test Fec", "My office", "none", "Me", 15);
// alternative: use a fecid.csv file (or fec.xml)
// register the equipment module and export it as 'MYServer'
myeqm = new TEquipmentModule("MYServer", "MYEQM", 10, eqm_handler, eqm_ini, eqm_bkg, 100, eqm_exi);
// alternative: use the exports.csv or fec.xml to register export names and properties)
// initialize the server (not optional!)
TKernel.InitializeServer();
// register the properties (alternative: use exports.csv or fec.xml)
// first: property 'Sine' is a trace waveform which can return up to 8192 float values (no input):
TDataType dtout = new TDataType(new float[8192]);
myeqm.RegisterPropertyInformation("Sine", dtout, null, Access.CA_READ, ArrayType.AT_TRACE, 8192, "[-512:512 V]Sine Curve", PRP_SINE, "");
// the following properties are 'multi-channel' properties
// one can read all values for the 10 sine curves at once, but only set 1 at a time:
dtout = new TDataType(new float[10]);
TDataType dtin = new TDataType(new float[1]);
myeqm.RegisterPropertyInformation("Amplitude", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[-512:512 V]Sine Curve Amplitude", PRP_AMPLITUDE, "");
myeqm.RegisterPropertyInformation("Frequency", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[1:20 Hz]Sine Curve Frequency", PRP_FREQUENCY, "");
myeqm.RegisterPropertyInformation("Phase", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:6.28]Sine curve Phase", PRP_PHASE, "");
myeqm.RegisterPropertyInformation("Noise", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:50 V]Sine curve Noise", PRP_NOISE, "");
// put in some device names (alternatve: use devices.csv or fec.xml)
for (int i = 0; i < 10; i++)
{
myeqm.RegisterDeviceName("MyDevice" + i, i);
}
// now start the server (not optional) ...
TKernel.StartServices();
}
}

◆ StopServices()

static void tine.TKernel.StopServices ( )
inlinestatic

Explicity shuts down the TINE engine (not something you want to be doing very often).


The documentation for this class was generated from the following file:

Impressum   |   Imprint   |   Datenschutzerklaerung   |   Data Privacy Policy   |   Declaration of Accessibility   |   Erklaerung zur Barrierefreiheit
Generated for TINE API by  doxygen 1.5.8