Tps Server
Tps Server
TPS Server
1 Scope
This document describes the TPS Server component. The TPS Server provides support for RTS monitoring
and control as well as support for bi-directional data transfer with the TPS and synchronous operation. The
document describes the available services and interfaces for PAWS Studio.
2 Overview
The TPS Server is a component that provides:
• • Access to the RTS Server as an open server component capable of runtime collaboration with
other control and monitoring components
• • A stable interface to access the RTS executive functionality insulating the client applications from
internal RTS server interface or semantic changes
• • Dispatch interfaces compatible with Visual Basic, C++, C#, Java Script, VB Script bindings
• • A variety of COM events during the operation of the RTS Executive
• • Full configuration support for the RTS Server
• • Support for I/O interception
• • Support for RTS distribution
• • Support for bi-directional data transfer with the ATLAS program
• • Support for both synchronous and asynchronous operation
• • Support for custom I/O resources
• • Access to ATLAS global variables
• • Support to Run an ATLAS block of code
The TPS Server interfaces organize and expose methods for other component objects or clients to interact
with the operation of the RTS Executive.
A TPS Server is a client of the RTS Server and a server for its clients. It provides simplified access to RTS
Server functionality for clients executing a TPS.
The RTS Server interfaces are subject to change and are designed and maintained for TYX internal usage
only. TYX does not recommend the usage of RTS Server interfaces in any client applications.
The TPS Server is designed and maintained by TYX to provide a public and stable interface to the RTS
Server. Client applications can use the TPS Server component and interfaces; TYX will maintain and
ensure compatibility between the TPS Server and the RTS Server.
3 TPS Server Component
The TPS Server component is essentially a RTS COM adapter. It is externally creatable using the COM
API.
The TPS Server component and its interfaces are described in the type library packaged as a resource with
“RtsAx.dll”. The “RtsAx.dll” file is located in “<usr>\tyx\com directory”, where <usr> is the directory
selected at installation – the default is “C:\usr”.
In addition to the functionality provided by the IRtsControl interface, the TPS Server provides:
• • Support for bi-directional data transfer with the ATLAS program
• • Support for both synchronous and asynchronous operation
• • Support for custom I/O resources
• • Access to ATLAS global variables
• • Support to Run an ATLAS block of code
The Parameters property provides support for passing parameters from the client application to the TPS.
The property is an interface pointer to the PARAMETERS DataBagResource object. The
DataBagResource object implements a number of additional interfaces: IIOResource, ITextResource,
IDataBag and IDataCollection. The data access collections can be used to populate the data container with
parameters. Please see the documentation the DataContainer and the DataBagResource components for
details. The property is read-only; the access to the DataBagResource object is read-write.
The parameters are passed as a collection of named values. On the TPS side the parameters can be retrieved
by defining and reading from a text file resource with the name “PARAMETERS”. The parameters are
exposed in name / value pairs.
The Results property provides support for returning results from the TPS to the client application. The
property is an interface pointer to the RESULTS DataBagResource object. The DataBagResource object
implements a number of additional interfaces: IIOResource, ITextResource, IDataBag and IDataCollection.
The data access collections can be used to query the data container for results. Please see the
documentation the DataContainer and the DataBagResource components for details. The property is read-
only, the access to the DataBagResource object is read-write.
The results are passed as a collection of named values. On the TPS side the results can be returned by
defining and writing to a text file resource with the name “RESULTS”. The results are expected in named
values pairs.
The Synchronous property controls the operation mode. The default property value is VARIANT_TRUE,
i.e. the object operates by default in synchronous mode. In synchronous mode the TPS Server waits before
returning from the call until the load, run or unload sequences are complete.
TpsServer : Server :
: Client ITpsServer CRtsAppMach
Load(project)
Open(project)
Loading
Wait
OnState(Ready)
OnRtsState(Ready)
Unload
Close
Closing
Wait
OnState(Closed)
OnRtsState(Unloaded)
Run
Running
Wait
OnState(Finish)
OnRtsState(Finish)
As shown above, during a synchronous operation the TpsServer object waits internally for the started
operation to complete. The Reset method can be called during a synchronous call to reset the RTS state and
return from the synchronous method call immediately. Calling a synchronous method during the execution
of another synchronous method will result in erroneous operation.
The synchronous execution mode is designed to be used from simple clients without extensive user
interaction to automate the TPS loading, unloading and execution.
The GetData method retrieves the value of the specified predefined variable from the ATLAS program.
The available variables depend on the ATLAS subset used. The predefined variables for IEEE.716.89
subsets are MEASUREMENT, GO, HI, LO, NOGO, MAX-TIME and MANUALINTERVENTION.
The PutData method sets the desired predefined variable to the specified value. The available variables
depend on the ATLAS subset used. The predefined variables for IEEE.716.89 subsets are
MEASUREMENT, GO, HI, LO, NOGO, MAX-TIME and MANUALINTERVENTION.
The RunBlock method executes the specified TPS block. Two entry points delimit a block. The ATLAS
block is identified by the ‘E’ statement number in the ATLAS program. The ATLAS block can be run in
synchronous/asynchronous mode as described by the Synchronous property above. The context in which
the ATLAS block is run by the RTS Executive is set up through the RunBlockContext property described
later.
The RegisterIOResource method replaces the resource specified by the sName parameter, with the
specified resource. The pUnkResource interface pointer parameter must point to a custom I/O resource
object. Custom I/O resource components must implement at least the IIOResource and ITextResource or
IBinaryResource interfaces as defined in the I/O Subsystem documents. For details see the I/O Subsystem
documentation.
The RegisterIOResource method must be called in the “UNLOADED” RTS state. The adapter must be first
attached to the RTS Server. The provided resource is used during the following TPS loading. If a resource
is already registered an error is reported, to register a new resource call UnregisterIOResource before
registering the resource.
The UnRegisterIOResource method unregisters the registered IO resource specified by the sName
parameter and restores the default IO resource used by RTS Server.
The UnRegisterIOResource method can be called from the “READY”, “FINISH”, “RUNNING”,
“HALTED” or “UNLOADED” state. The adapter must be first attached to the RTS Server. It is best to call
UnRegisterIOResource from the “UNLOADED” state. If UnRegisterIOResource is called with a TPS
loaded it will take effect only for the next TPS run. Detaching from the server or destroying the adapter
object will automatically unregister all registered resources. UnRegisterIOResource must be called only
before re-registering the resource.
Calling UnRegisterIOResource without successfully registering the resource first will generate an error.
[
object,
uuid(3F6B2943-F0DA-11D2-BBB0-00C0268914D3),
dual,
helpstring("ITpsServerData Interface"),
pointer_default(unique)
]
interface ITpsServerData : ITpsServerEx
{
[id(16), helpstring("method AddWatchVariable")]
HRESULT AddWatchVariable([in] BSTR sName,
[in] IUnknown* pUnkAddressAndTypeInformation,
[in] RtsAxWatchContext eRtsAxWatchContext,
[in] BSTR sArgumentValue,
[in] BSTR sReserved);
[id(17), helpstring("method RemoveWatchVariable")]
HRESULT RemoveWatchVariable([in] BSTR sName);
[id(18), helpstring("method RemoveAllWatchVariables")]
HRESULT RemoveAllWatchVariables();
[propput, id(19), helpstring("property Visible")]
HRESULT Visible([in] VARIANT_BOOL newVal);
[propget, id(20), helpstring("property RunBlockContext")]
HRESULT RunBlockContext([out, retval] RtsAxRunBlockContext* pVal);
[propput, id(20), helpstring("property RunBlockContext")]
HRESULT RunBlockContext([in] RtsAxRunBlockContext newVal);
[propget, id(21), helpstring("property EntryBlocks")]
HRESULT EntryBlocks([out, retval]VARIANT* psaBlockStatements);
};
The AddWatchVariable method is called to add watch variables during debugging a TPS project. Specify a
name, Address and Type Information object (described later in the document), valid context (from the
enumerations defined) and an argument value.
The Visible property controls the visibility of the RTS Application. Clients of the TPSServer /
TPSServerLite can now control display of the RTS Application through this property.
The RunBlockContext property controls the context in which the RTS Executive should run an Entry Block.
This context is used by the RTS Executive when the RunBlock method is invoked. By default, the TPS
Server sets up the RunBlockContext to RUN_THIS_BLOCK.
The EntryBlocks property provides access to the Entry Block table of the RTS Executive. Number of
elements of the SafeArray returned match exactly to the number of Entry Blocks in the ATLAS program.
Each integer value within the SafeArray corresponds to the Entry Block Statement Number in the ATLAS
program.
In order to connect the two objects, the client must call the Advise method of the IConnectionPoint
interface for the connection point of interest. The number of sink objects receiving notification is not
subject to any restrictions. To discontinue notification, the client can use the UnAdvise method. The
mechanism is similar with registering a callback function; in this case it is a callback interface. For details,
see the COM specification for outgoing interfaces, connection points and sink objects.
The _IRtsDataEvents interface groups the events related to RTS activity.
The OnRtsTps event is fired when the Tps property changes. The strTps parameter is null when the TPS
was unloaded or the loading failed.
3.6.3 OnRtsFaultCount Event
Parameters
Name Type Access Description
lFC long [in] TPS fault counter
The OnRtsTestLimits event is fired during a test when test limits are available. For a signal-based test, this
notification occurs before the actual measurement. The provided test object contains only the limits and
dimension information.
The OnRtsTestValue event is fired during a test when the comparison is executed. For a signal-based test,
this notification occurs after the actual measurement. The provided test object is fully populated.
The OnRtsMiEnable event is fired when the Manual Intervention action is enabled or disabled
The OnRtsDisplay event is fired by using the display function in MACRO or CEM device drivers.
The OnVariableChange event is fired when a RTS variable under watch changes.
The OnVariableTypeChange event is fired when the type of the variable under watch changes. Value
would correspond to a type within the RtsVarTypes enumeration defined later.
4.1 IAddressInformation
The interface is used to define address information and how ATE variables are stored and manipulated in
the RTS adapters.
Use this property to define the description start bit. It describes storage of digital fields which is supported
by specific ATE subsets.
Use this property to define the Field length of variable in RTS. It describes storage field length of digital
fields which is supported by specific ATE subsets.
4.3 IAddressAndTypeInformation
The interface derives from IAddressInformation. It further defines the type of the watched variable.
[
object,
uuid(3F6B2991-F0DA-11D2-BBB0-00C0268914D3),
dual,
helpstring("IAddressAndTypeInformation Interface"),
pointer_default(unique)
]
interface IAddressAndTypeInformation : IAddressInformation
{
[propget, id(5), helpstring("property TypeWord")]
HRESULT TypeWord([out, retval] unsigned short *pVal);
[propget, id(6), helpstring("property TypeAsString")]
HRESULT TypeAsString([out, retval] BSTR *pVal);
[id(7), helpstring("method Populate")]
HRESULT Populate([in] long lVad,
[in] long lFieldFrom,
[in] long lFieldLength,
[in] unsigned short ushTypeWord);
};
4.3.2 TypeWord Method
Parameters
Name Type Access Description
pVal unsigned short [out, retval] Value of the variable
The overloaded method of this interface is used to update variables parameters. lFieldFrom and
lFieldLength are only used in defining storage fields of digital variables which are supported by
specific ATE subsets.
Note:
All additional interfaces, types and components referred by this document are described in the COM Utils,
IOSubsystem or RTS COM Adapters documents.