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

TLink.java. More...

Public Member Functions

void setNotificationTolerance (float absoluteValue, float percentValue)
 Sets the tolerance level for asynchronous event notification. More...
 
int getLinkStatus ()
 Returns the current status for this link. More...
 
String getContext ()
 Returns the context of this link. More...
 
String getDeviceServer ()
 Returns the device server addressed in this link. More...
 
String getDeviceName ()
 Returns the device (module) name addressed in this link. More...
 
String getProperty ()
 Returns the device property addressed in this link. More...
 
String getFullDeviceName ()
 Returns the fully qualified device name addressed in this link. More...
 
String getFullDeviceNameAndProperty ()
 Returns the fully qualified device name and property addressed in this link. More...
 
TDataType getOutputDataObject ()
 Returns the output data object as a TDataType. More...
 
TDataType getInputDataObject ()
 Returns the output data input as a TDataType. More...
 
long getLastTimeStamp ()
 The last link timestamp. More...
 
double getLastDataTimeStamp ()
 The last link timestamp as a TINE double timestamp value. More...
 
String getLastError ()
 The last link status in plain text. More...
 
String getError (int code)
 The specified error code in plain text. More...
 
int setErrorValue (double errValue)
 Specifies an error value to fill in associated data buffers in case of link error. More...
 
int setErrorValue (String errString)
 Specifies an error string to fill in associated data buffers in case of link error. More...
 
 TLink (String devname, String devproperty, TDataType dout, TDataType din, int devaccess)
 Defines a tine Data link. More...
 
 TLink (String fullDeviceNameAndProperty, TDataType dout, TDataType din, short devaccess)
 Defines a tine Data link. More...
 
 TLink (String deviceName, String deviceProperty)
 Defines a read-only tine Data link with default behavior. More...
 
 TLink (String fullDeviceNameAndProperty)
 Defines a read-only tine Data link with default behavior. More...
 
 TLink (String globalKeyword, TDataType dout)
 Defines a tine GLobal Data link. More...
 
int attach (int mode, TCallback f)
 Attaches the data sets to the created link at the default polling rate (1000 msec) More...
 
int Twait ()
 Stop thread execution until this link has been signalled.
 
int execute ()
 Executes a synchronous link using the data sets supplied at
link creation. More...
 
int executeAndClose ()
 Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion. More...
 
int execute (int timeout, short appendMode)
 Executes a synchronous link using the data sets supplied at
link creation. More...
 
int execute (int timeout, boolean retryOnError)
 Executes a synchronous link using the data sets supplied at
link creation. More...
 
int executeAndClose (int timeout, short appendMode)
 Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion. More...
 
int executeAndListen ()
 Executes synchronously, returning the link results. More...
 
int executeAndListen (int interval)
 Executes synchronously, returning the link results. More...
 
int executeAndListen (int interval, short mode)
 Executes synchronously, returning the link results. More...
 
int execute (int timeout, short appendMode, boolean retryOnError)
 Executes a synchronous link using the data sets supplied at
link creation. More...
 
int execute (int timeout)
 Executes a synchronous link using the data sets supplied at
link creation. More...
 
int executeAndClose (int timeout)
 Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion. More...
 
int cancel ()
 Terminates an active link mdavid: changed and marked as 'deprecated'. More...
 
int close ()
 Terminates an active link. More...
 
int attach (int mode, TCallback f, int pollrate)
 Attaches the data sets to the created link at the given polling rate. More...
 
synchronized int attach (int mode, TCallback f, int pollInterval, int notificationId)
 Attaches the data sets to the created link at the given polling rate and signals the callback routine using the give notification parameter. More...
 
int attach (int mode, TLinkCallback f, int pollrate)
 Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance. More...
 
int attach (int mode, TLinkCallback f, int pollingInterval, Object reference)
 Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance. More...
 
int receive (TCallback f)
 Attaches the data sets to the global link and signals the callback routine using the assigned link id. More...
 
int receive (TCallback f, int notificationId)
 Attaches the data sets to the global link and signals the callback routine using a reference to the given notifcation ID in the callback. More...
 
int receive (TLinkCallback f)
 Attaches the data sets to the global link and signals the callback routine using a reference to the referenced TLink object. More...
 
void waitForLinkCompletion ()
 Stops thread execution until this link has completed. More...
 
String getArrayDelimiter ()
 Gets the array delimiter for use in the toString() method of associated TDataType objects. More...
 
void setArrayDelimiter (String delimiter)
 Sets the array delimiter for use in the toString() method of associated TDataType objects. More...
 

Static Public Member Functions

static String[] splitDeviceAndPropertyFromName (String fullDeviceNameAndProperty)
 returns string array of length 2 with first string = full device name and second string = property More...
 
static String[] splitContextAndServerAndDeviceAndPropertyFromName (String fullDeviceNameAndProperty)
 returns string array of length 4 with string[0] = context, string[1] = server, string[2] = device, and string[3] = property More...
 

Detailed Description

TLink.java.

User interface calls to access tine data links.

The methods presented here deal with linking local application data with remote data sources. Primarily you will need to create a TLink object, passing the necessary identifying parameters of the remote server to which the link is to be established. When the TLink object is instantiated, you will then need to retrieve the data using one of the retrieval methods, e.g. execute() for synchronous acquisition, or attach() for
asynchronous acquisition, or receive() for the acquisition of network globals.

Constructor & Destructor Documentation

◆ TLink() [1/5]

de.desy.tine.client.TLink.TLink ( String  devname,
String  devproperty,
TDataType  dout,
TDataType  din,
int  devaccess 
)

Defines a tine Data link.

This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.

Parameters
devnameis the fully specified device name as in /<context>/<server>/<device> or <server>/<device>
devpropertyis the desired property
doutis a reference to the output data object (which will receive the data from the server)
dinis a reference to the input data object (which will send data to the server)
devaccessis the requested control access mode (TMode.CA_READ, TMode.CA_WRITE etc.)
Returns
A valid TLink instance if successful or null if not
Exceptions
UnresolvedAddressExceptionif fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system)
InvalidDataReferenceExceptionif the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the

Example:

...
int cc = 0;
int[] echobuf = new int[512];
int[] echoin = new int[512];
for (int i=0; i<512; i++) echoin[i] = i;
TDataType dout = new TDataType(echobuf);
TDataType din = new TDataType(echoin);
TLink ech = new TLink("/TEST/ECHOSERVER/DEVICE_0","ECHO",dout,din,TAccess.CA_READ);
if ((cc=ech.execute()) != 0) // synchronous access ...
{
String msg = "err: " + cc;
System.out.println(msg);
}
ech.cancel(); // remove the TLink completely
for (int i=0; i<512; i += 8)
{
System.out.println(echobuf[i] + " " + echobuf[i+1] + " " + echobuf[i+2] + " " + echobuf[i+3] + " " +
echobuf[i+4] + " " + echobuf[i+5] + " " + echobuf[i+6] + " " + echobuf[i+7] + " ");
}
...
See also
de.desy.tine.client.TLink::attach
de.desy.tine.client.TLink::execute
de.desy.tine.dataUtils.TDataType::TDataType

◆ TLink() [2/5]

de.desy.tine.client.TLink.TLink ( String  fullDeviceNameAndProperty,
TDataType  dout,
TDataType  din,
short  devaccess 
)

Defines a tine Data link.

This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.

Parameters
fullDeviceNameAndPropertyis the fully specified, property-appended device name as in /<context>/<server>/<device>/<property> or <server>/<device>/<property> or /<context>/<server>/<device>[<property>]
doutis a reference to the output data object (which will receive the data from the server)
dinis a reference to the input data object (which will send data to the server)
devaccessis the requested control access mode (TMode.CA_READ, TMode.CA_WRITE etc.)
Returns
A valid TLink instance if successful
Exceptions
UnresolvedAddressExceptionif fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system)
InvalidDataReferenceExceptionif the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the initial link.

Example:

...
int cc = 0;
float[] xorbit = new float[141];
TDataType dout = new TDataType(xorbit);
TLink xorb = new TLink("/HERA/HEPBPM/WL197 MX/ORBIT.X",dout,null,TAccess.CA_READ);
if ((id=xorb.attach(TMode.CM_POLL,xorbCb,1000)) < 0) // asynchronous access ...
{
String msg = "err: " + xorb.linkStatus;
System.out.println(msg);
xorb.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine xorbCb ...
...
See also
de.desy.tine.client.TLink::attach
de.desy.tine.client.TLink::execute
de.desy .tine.dataUtils.TDataType::TDataType

◆ TLink() [3/5]

de.desy.tine.client.TLink.TLink ( String  deviceName,
String  deviceProperty 
)

Defines a read-only tine Data link with default behavior.

This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.

Parameters
devnameis the fully specified device name as in /<context>/<server>/<device> or <server>/<device>
devpropertyis the desired property
Returns
A valid TLink instance if successful or null if not
Exceptions
UnresolvedAddressExceptionif fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system)
InvalidDataReferenceExceptionif the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0","Current");
int cc = idc.execute(1000);
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::attach
de.desy.tine.client.TLink::execute

◆ TLink() [4/5]

de.desy.tine.client.TLink.TLink ( String  fullDeviceNameAndProperty)

Defines a read-only tine Data link with default behavior.

This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.

Parameters
fullDeviceNameAndPropertyis the fully specified, property-appended device name as in /<context>/<server>/<device>/<property> or <server>/<device>/<property>
Returns
A valid TLink instance if successful or null if not
Exceptions
UnresolvedAddressExceptionif fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system)
InvalidDataReferenceExceptionif the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0/Current");
int cc = idc.execute(1000);
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::attach
de.desy.tine.client.TLink::execute

References de.desy.tine.client.TLink.splitDeviceAndPropertyFromName().

◆ TLink() [5/5]

de.desy.tine.client.TLink.TLink ( String  globalKeyword,
TDataType  dout 
)

Defines a tine GLobal Data link.

This defines a tine Data Link and assumes that the requested parameter is a network global, available on the tine multicast group. This method does not establish the link! You must use either the execute method or the attach method to establish the link.

Parameters
globalKeywordis the desired network global parameter
doutis a reference to the output data object (which will receive the network global data).
Returns
A valid TLink instance if successful or null if not

Example:

...
float[] glbcurrent = new float[1];
dout = new TDataType(glbcurrent);
TLink glbcur = new TLink("HECur",dout);
glbcur.receive((TCallback)null); // just attach the value to glbcurrent ...
...
See also
de.desy.tine.client.TLink::attach
de.desy.tine.client.TLink::receive
de.desy.tine.dataUtils.TDataType::TDataType

Member Function Documentation

◆ attach() [1/5]

int de.desy.tine.client.TLink.attach ( int  mode,
TCallback  f 
)

Attaches the data sets to the created link at the default polling rate (1000 msec)

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter.

Parameters
modeis the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc.
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

public class OrbitCallback implements TCallback
{
public void callback(int id, int cc)
{
if (cc != 0)
{
System.out.println("Orbit Link Error : " + TErrorList.getErrorString(cc));
return;
}
orbitChart.update();
}
}
public int MonitorOrbit()
{
int cc = 0;
float[] xorbit = new float[141];
TDataType dout = new TDataType(xorbit);
OrbitCallback xorbCb = new OrbitCallback(); // create a callback instance ...
TLink xorb = new TLink("/HERA/HEPBPM/WL197 MX/ORBIT.X",dout,null,TAccess.CA_READ);
if ((id=xorb.attach(TMode.CM_POLL,xorbCb)) < 0) // asynchronous access ...
{
String msg = "err: " + xorb.linkStatus;
System.out.println(msg);
xorb.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine xorbCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::execute

Referenced by de.desy.tine.client.TLink.attach(), de.desy.tine.client.TLink.receive(), and de.desy.tine.dataUtils.TDataTime.systemStartGlobalSynchronization().

◆ attach() [2/5]

synchronized int de.desy.tine.client.TLink.attach ( int  mode,
TCallback  f,
int  pollInterval,
int  notificationId 
)

Attaches the data sets to the created link at the given polling rate and signals the callback routine using the give notification parameter.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter.

Parameters
modeis the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc.
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface.
pollIntervalis the desired polling interval (at the server) in milliseconds.
notificationIdis the desired identifier to be passed to the supplied callback routine when it is fired.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

private int xid = 0;
private int yid = 1;
public class OrbitCallback implements TCallback
{
public void callback(int id, int cc)
{
if (cc != 0)
{
System.out.println("Orbit Link Error : " + TErrorList.getErrorString(cc));
return;
}
orbitChart[id].update();
}
}
public int MonitorOrbit()
{
OrbitCallback orbCb = new OrbitCallback(); // create a callback instance ...
int cc = 0;
float[] xorbit = new float[141];
TDataType dout = new TDataType(xorbit);
TLink xorb = new TLink("/HERA/HEPBPM/WL197 MX/ORBIT.X",dout,null,TAccess.CA_READ);
if (xorb.attach(TMode.CM_POLL,orbCb,500,xid) < 0) // asynchronous access ...
{
String msg = "err: " + xorb.linkStatus;
System.out.println(msg);
xorb.cancel(); // remove the TLink completely
System.exit(1);
}
float[] yorbit = new float[141];
dout = new TDataType(yorbit);
TLink yorb = new TLink("/HERA/HEPBPM/WL164 MY/ORBIT.Y",dout,null,TAccess.CA_READ);
if (yorb.attach(TMode.CM_POLL,orbCb,500,yid) < 0) // asynchronous access ...
{
String msg = "err: " + yorb.linkStatus;
System.out.println(msg);
yorb.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine xorbCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TCallback
de.desy.tine.client.TLink::execute

◆ attach() [3/5]

int de.desy.tine.client.TLink.attach ( int  mode,
TCallback  f,
int  pollrate 
)

Attaches the data sets to the created link at the given polling rate.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter.

Parameters
modeis the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc.
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface.
pollrateis the desired polling rate (at the server) in milliseconds.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

public class OrbitCallback implements TCallback
{
public void callback(int id, int cc)
{
if (cc != 0)
{
System.out.println("Orbit Link Error : " + TErrorList.getErrorString(cc));
return;
}
orbitChart.update();
}
}
public int MonitorOrbit()
{
int cc = 0;
float[] xorbit = new float[141];
TDataType dout = new TDataType(xorbit);
OrbitCallback xorbCb = new OrbitCallback(); // create a callback instance ...
TLink xorb = new TLink("/HERA/HEPBPM/WL197 MX/ORBIT.X",dout,null,TAccess.CA_READ);
if ((id=xorb.attach(TMode.CM_POLL,xorbCb,1000)) < 0) // asynchronous access ...
{
String msg = "err: " + xorb.linkStatus;
System.out.println(msg);
xorb.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine xorbCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::execute

References de.desy.tine.client.TLink.attach().

◆ attach() [4/5]

int de.desy.tine.client.TLink.attach ( int  mode,
TLinkCallback  f,
int  pollingInterval,
Object  reference 
)

Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. This is the preferred AttachLink method to use. The Callback instantiates a TLinkCallback() interface which provides a TLink object as parameter.

Parameters
modeis the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc.
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TLinkCallback() class interface.
pollingIntervalis the desired polling rate (at the server) in milliseconds.
referenceis an optional reference to any object of the caller's choosing. As the callback returns a reference to the original link, this extra reference can be used to quickly find a table entry position for example.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::execute

◆ attach() [5/5]

int de.desy.tine.client.TLink.attach ( int  mode,
TLinkCallback  f,
int  pollrate 
)

Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. This is the preferred AttachLink method to use. The Callback instantiates a TLinkCallback() interface which provides a TLink object as parameter.

Parameters
modeis the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc.
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TLinkCallback() class interface.
pollrateis the desired polling rate (at the server) in milliseconds.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

private int xid = 0;
private int yid = 1;
public class OrbitCallback implements TLinkCallback
{
public void callback(TLink lnk)
{
if (lnk.getLinkStatus() != 0)
{
System.out.println("Link Error : " + lnk.getProperty() + " -> " + lnk.getLastError());
return;
}
orbitChart.update(lnk.getProperty());
}
}
public int MonitorOrbit()
{
OrbitCallback orbCb = new OrbitCallback(); // create a callback instance ...
int cc = 0;
float[] xorbit = new float[141];
TDataType dout = new TDataType(xorbit);
TLink xorb = new TLink("/HERA/HEPBPM/WL197 MX/ORBIT.X",dout,null,TAccess.CA_READ);
if (xorb.attach(TMode.CM_POLL,orbCb,500) < 0) // asynchronous access ...
{
String msg = "err: " + xorb.linkStatus;
System.out.println(msg);
xorb.cancel(); // remove the TLink completely
System.exit(1);
}
float[] yorbit = new float[141];
dout = new TDataType(yorbit);
TLink yorb = new TLink("/HERA/HEPBPM/WL164 MY/ORBIT.Y",dout,null,TAccess.CA_READ);
if (yorb.attach(TMode.CM_POLL,orbCb,500) < 0) // asynchronous access ...
{
String msg = "err: " + yorb.linkStatus;
System.out.println(msg);
yorb.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine xorbCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::execute

References de.desy.tine.client.TLink.attach().

◆ cancel()

int de.desy.tine.client.TLink.cancel ( )

Terminates an active link mdavid: changed and marked as 'deprecated'.

Deprecated:
use close() instead

References de.desy.tine.client.TLink.close().

Referenced by de.desy.tine.eventUtils.TEventArchive.getArchiveData().

◆ close()

int de.desy.tine.client.TLink.close ( )

◆ execute() [1/5]

int de.desy.tine.client.TLink.execute ( )

Executes a synchronous link using the data sets supplied at
link creation.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for 1000 msec or until the call completes.

Note
The TLink object created will remain resident until a call to the cancel() method is made. Thus repeated calls to execute() can be made without invoking separate calls to TLink().
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0","Current");
int cc = idc.execute();
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

Referenced by de.desy.tine.queryUtils.TQuery.AcquireAndRegisterStructInfo(), de.desy.tine.addrUtils.ENSTools.addDeviceServerToGroup(), de.desy.tine.alarmUtils.TAlarmSystem.enableAlarms(), de.desy.tine.client.TLink.execute(), de.desy.tine.client.TLink.executeAndClose(), de.desy.tine.client.TLink.executeAndListen(), de.desy.tine.addrUtils.ENSTools.flushNonRespondingServers(), de.desy.tine.queryUtils.TQuery.getAccessLockInformation(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmDefinitionsFromServer(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmSystemsMap(), de.desy.tine.eventUtils.TEventArchive.getArchiveData(), de.desy.tine.histUtils.THistory.getArchivedProperties(), de.desy.tine.alarmUtils.TAlarmSystem.getDisabledAlarms(), de.desy.tine.addrUtils.ENSTools.getGroupsFromGENS(), de.desy.tine.queryUtils.TQuery.getMetaProperties(), de.desy.tine.queryUtils.TQuery.getPropertiesWithPattern(), de.desy.tine.queryUtils.TQuery.getStockProperties(), de.desy.tine.addrUtils.ENSTools.removeDeviceServerFromENS(), de.desy.tine.addrUtils.ENSTools.removeDeviceServerFromGroup(), and de.desy.tine.addrUtils.ENSTools.setAllowedDownTime().

◆ execute() [2/5]

int de.desy.tine.client.TLink.execute ( int  timeout)

Executes a synchronous link using the data sets supplied at
link creation.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.

Parameters
timeoutThe amount of time in milliseconds to block execution until the call completes.
Note
The TLink object created will remain resident until a call to the cancel() method is made. Thus repeated calls to execute() can be made without invoking separate calls to TLink().
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0","Current");
int cc = idc.execute(500);
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.execute().

◆ execute() [3/5]

int de.desy.tine.client.TLink.execute ( int  timeout,
boolean  retryOnError 
)

Executes a synchronous link using the data sets supplied at
link creation.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.

Parameters
timeoutThe amount of time in milliseconds to block execution until the call completes.
retryOnErrorif 'true' will instruct the tine engine to issue an automatic retry following a connection timeout.
Note
The TLink object created will remain resident until a call to the cancel() method is made. Thus repeated calls to execute() can be made without invoking separate calls to TLink().
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0","Current");
int cc = idc.execute(500,true);
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.execute().

◆ execute() [4/5]

int de.desy.tine.client.TLink.execute ( int  timeout,
short  appendMode 
)

Executes a synchronous link using the data sets supplied at
link creation.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.

Parameters
timeoutThe amount of time in milliseconds to block execution until the call completes.
appendModewill be appended to the tine Control Mode, which is TMode.CM_SINGLE. (e.g. TMode.CM_CONNECT).
Note
The TLink object created will remain resident until a call to the cancel() method is made. Thus repeated calls to execute() can be made without invoking separate calls to TLink().
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0","Current");
int cc = idc.execute(500,TMode.CM_CONNECT);
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.execute().

◆ execute() [5/5]

int de.desy.tine.client.TLink.execute ( int  timeout,
short  appendMode,
boolean  retryOnError 
)

Executes a synchronous link using the data sets supplied at
link creation.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.

Parameters
timeoutThe amount of time in milliseconds to block execution until the call completes.
appendModewill be appended to the tine Control Mode, which is TMode.CM_SINGLE. (e.g. TMode.CM_CONNECT).
retryOnErrorif 'true' will instruct the tine engine to issue an automatic retry following a connection timeout.
Note
The TLink object created will remain resident until a call to the cancel() method is made. Thus repeated calls to execute() can be made without invoking separate calls to TLink().
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().

Example:

...
TLink idc = new TLink("/HERA/HEEIDC/GEAR0","Current");
int cc = idc.execute(500,TMode.CM_CONNECT,true);
int dsize = idc.dOutput.getLastDataSize();
int dfmt = idc.dOutput.getFormat();
System.out.println("completion " + cc + " size " + dsize + " format " + dfmt);
idc.setArrayDelimiter(", ");
System.out.println(idc.dOutput.toString());
...
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.definitions.TMode.canClose(), de.desy.tine.client.TLink.executeAndListen(), de.desy.tine.definitions.TMode.getBaseMode(), de.desy.tine.client.TLinkFactory.getBlackListedLinkStatus(), de.desy.tine.dataUtils.TDataType.getData(), de.desy.tine.definitions.TErrorList.getErrorString(), de.desy.tine.client.TLink.getFullDeviceName(), de.desy.tine.client.TLink.getFullDeviceNameAndProperty(), de.desy.tine.client.TLink.getLinkStatus(), de.desy.tine.client.TLink.getOutputDataObject(), de.desy.tine.client.TLink.getProperty(), de.desy.tine.definitions.TErrorList.hasData(), de.desy.tine.definitions.TMode.isActive(), de.desy.tine.definitions.TMode.isConnected(), de.desy.tine.queryUtils.TQuery.isStockProperty(), de.desy.tine.definitions.TAccess.isWrite(), de.desy.tine.dataUtils.TDataType.putData(), de.desy.tine.client.TLink.setErrorValue(), and de.desy.tine.definitions.TErrorList.toString().

◆ executeAndClose() [1/3]

int de.desy.tine.client.TLink.executeAndClose ( )

Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes. When the link has completed (successfully or not) the TLink will be automatically closed and hence removed from the link tables, obviating the need for an additional call to closeLink().

Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

Referenced by de.desy.tine.alarmUtils.TAlarmSystem.disableAlarms(), de.desy.tine.alarmUtils.TAlarmSystem.enableAlarms(), de.desy.tine.client.TLink.executeAndClose(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmDefinitions(), de.desy.tine.addrUtils.ENSTools.getAllowedDeviceSubsystems(), de.desy.tine.addrUtils.ENSTools.getAllowedDownTime(), de.desy.tine.histUtils.THistory.getAnnotation(), de.desy.tine.histUtils.THistory.getAnnotationTimes(), de.desy.tine.histUtils.THistory.getArchivedPropertyList(), de.desy.tine.queryUtils.TQuery.getDeviceContexts(), de.desy.tine.queryUtils.TQuery.getDeviceGroupMembers(), de.desy.tine.queryUtils.TQuery.getDeviceServerReport(), de.desy.tine.eventUtils.TEventArchive.getDeviceServers(), de.desy.tine.addrUtils.ENSTools.getGroupMembersFromGENS(), de.desy.tine.queryUtils.TQuery.getMetaProperties(), de.desy.tine.queryUtils.TQuery.getServerClients(), de.desy.tine.queryUtils.TQuery.getServerInformation(), de.desy.tine.queryUtils.TQuery.getStockProperties(), de.desy.tine.queryUtils.TQuery.pingServer(), de.desy.tine.addrUtils.ENSTools.removeFECFromENS(), de.desy.tine.addrUtils.ENSTools.sendExportInformationToENS(), de.desy.tine.eventUtils.TEventArchive.sendTrigger(), and de.desy.tine.histUtils.THistory.setAnnotation().

◆ executeAndClose() [2/3]

int de.desy.tine.client.TLink.executeAndClose ( int  timeout)

Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes. When the link has completed (successfully or not) the TLink will be automatically closed and hence removed from the link tables, obviating the need for an additional call to closeLink().

Parameters
timeoutThe amount of time in milliseconds to block execution until the call completes.
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.executeAndClose().

◆ executeAndClose() [3/3]

int de.desy.tine.client.TLink.executeAndClose ( int  timeout,
short  appendMode 
)

Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion.

Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes. When the link has completed (successfully or not) the TLink will be automatically closed and hence removed from the link tables, obviating the need for an additional call to closeLink().

Parameters
timeoutThe amount of time in milliseconds to block execution until the call completes.
appendModewill be appended to the tine Control Mode, which is TMode.CM_SINGLE. (e.g. TMode.CM_CONNECT).
Returns
0 if successful, otherwise a tine return code which can be interpreted using getError() or getLastError().
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.close(), and de.desy.tine.client.TLink.execute().

◆ executeAndListen() [1/3]

int de.desy.tine.client.TLink.executeAndListen ( )

Executes synchronously, returning the link results.

Upon the initial call an asynchronous 'listener' monitor link is establishes with the update interval given by the 'timeout' parameter. Subsequent calls simply update the output data object with the current contents of the underlying monitor link AND keep the underlying monitor link active.

If a 'dead time' interval of 5 minutes without a subsequent call to executeAndListen() occurs, then monitor link is closed.

For 'simple' applications which 'poll' for data in a timer, the performance can be improved dramatically by replacing calls to the 'execute()' method with 'executeAndListen().

With this simple method, the underlying monitor will use the default monitor interval of 1000 msec and the default mode of TMode.CM_TIMER.

See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

Referenced by de.desy.tine.client.TLink.execute(), and de.desy.tine.client.TLink.executeAndListen().

◆ executeAndListen() [2/3]

int de.desy.tine.client.TLink.executeAndListen ( int  interval)

Executes synchronously, returning the link results.

Upon the initial call an asynchronous 'listener' monitor link is establishes with the update interval given by the 'timeout' parameter. Subsequent calls simply update the output data object with the current contents of the underlying monitor link AND keep the underlying monitor link active.

If a 'dead time' interval of 5 minutes without a subsequent call to executeAndListen() occurs, then monitor link is closed.

For 'simple' applications which 'poll' for data in a timer, the performance can be improved dramatically by replacing calls to the 'execute()' method with 'executeAndListen().

Parameters
intervalIs analogous to the timeout parameter in the 'execute()' method family and gives the amount of time in milliseconds to block execution until the initial call completes. It also establishes the monitor interval for the underlying asynchronous link. The underlying monitor will use TMode.CM_TIMER with this method.
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.executeAndListen().

◆ executeAndListen() [3/3]

int de.desy.tine.client.TLink.executeAndListen ( int  interval,
short  mode 
)

Executes synchronously, returning the link results.

Upon the initial call an asynchronous 'listener' monitor link is establishes with the update interval given by the 'timeout' parameter. Subsequent calls simply update the output data object with the current contents of the underlying monitor link AND keep the underlying monitor link active.

If a 'dead time' interval of 5 minutes without a subsequent call to executeAndListen() occurs, then monitor link is closed.

For 'simple' applications which 'poll' for data in a timer, the performance can be improved dramatically by replacing calls to the 'execute()' method with 'executeAndListen().

Parameters
intervalIs analogous to the timeout parameter in the 'execute()' method family and gives the amount of time in milliseconds to block execution until the initial call completes. It also establishes the monitor interval for the underlying asynchronous link.
modecan be used to completely control the mode of the underlying asynchronous monitor (default is TMode.CM_TIMER).
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::attach

References de.desy.tine.client.TLink.execute(), de.desy.tine.definitions.TMode.getBaseMode(), and de.desy.tine.client.TLink.getFullDeviceNameAndProperty().

◆ getArrayDelimiter()

String de.desy.tine.client.TLink.getArrayDelimiter ( )

Gets the array delimiter for use in the toString() method of associated TDataType objects.

Returns
The delimiter in use in separating data variables in a string dump (default ",")

◆ getContext()

String de.desy.tine.client.TLink.getContext ( )

Returns the context of this link.

Returns
The Context of the current link

◆ getDeviceName()

String de.desy.tine.client.TLink.getDeviceName ( )

Returns the device (module) name addressed in this link.

Returns
The device (module) name addressed in the current link

◆ getDeviceServer()

String de.desy.tine.client.TLink.getDeviceServer ( )

Returns the device server addressed in this link.

Returns
The device server addressed in the current link

◆ getError()

String de.desy.tine.client.TLink.getError ( int  code)

The specified error code in plain text.

Parameters
codeIs the tine error code for which the error text is desired
Returns
The specified error code in plain text

References de.desy.tine.definitions.TErrorList.getErrorString().

Referenced by de.desy.tine.client.TLink.getLastError().

◆ getFullDeviceName()

String de.desy.tine.client.TLink.getFullDeviceName ( )

Returns the fully qualified device name addressed in this link.

Returns
The the fully qualified device name addressed in the current link

Referenced by de.desy.tine.client.TLink.execute(), and de.desy.tine.client.TLink.getFullDeviceNameAndProperty().

◆ getFullDeviceNameAndProperty()

String de.desy.tine.client.TLink.getFullDeviceNameAndProperty ( )

Returns the fully qualified device name and property addressed in this link.

Returns
The the fully qualified device name and property addressed in the current link

References de.desy.tine.client.TLink.getFullDeviceName().

Referenced by de.desy.tine.client.TLink.execute(), de.desy.tine.client.TLink.executeAndListen(), and de.desy.tine.queryUtils.TQuery.getDeviceServerReport().

◆ getInputDataObject()

TDataType de.desy.tine.client.TLink.getInputDataObject ( )

Returns the output data input as a TDataType.

Returns
The input data type

◆ getLastDataTimeStamp()

double de.desy.tine.client.TLink.getLastDataTimeStamp ( )

The last link timestamp as a TINE double timestamp value.

Returns
The last link timestamp as a UTC java long value (seconds since 1.1.1970 with decimal fractional)

◆ getLastError()

String de.desy.tine.client.TLink.getLastError ( )

◆ getLastTimeStamp()

long de.desy.tine.client.TLink.getLastTimeStamp ( )

The last link timestamp.

Returns
The last link timestamp as a UTC java long value (milliseconds since 1.1.1970)

◆ getLinkStatus()

int de.desy.tine.client.TLink.getLinkStatus ( )

Returns the current status for this link.

Returns
The Link status as tine error code

Referenced by de.desy.tine.client.TAwtAsyncCallback.callback(), de.desy.tine.client.TLink.execute(), and de.desy.tine.client.TAwtSyncCallback.getLinkStatus().

◆ getOutputDataObject()

TDataType de.desy.tine.client.TLink.getOutputDataObject ( )

Returns the output data object as a TDataType.

Returns
The output data type

Referenced by de.desy.tine.client.TLink.execute(), de.desy.tine.queryUtils.TQuery.getDeviceServerReport(), and de.desy.tine.eventUtils.TEventArchive.getDeviceServers().

◆ getProperty()

String de.desy.tine.client.TLink.getProperty ( )

Returns the device property addressed in this link.

Returns
The device property addressed in the current link

Referenced by de.desy.tine.client.TLink.execute().

◆ receive() [1/3]

int de.desy.tine.client.TLink.receive ( TCallback  f)

Attaches the data sets to the global link and signals the callback routine using the assigned link id.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. Using the receive() method assumes that the data requested are global available.

Parameters
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

public class glbCallback implements TCallback
{
public void callback(int id, int cc)
{
if (cc != 0)
{
System.out.println("Global Link Error : " + TErrorList.getErrorString(cc));
return;
}
eneDisplay.update(); // <- for example ...
}
}
public int MonitorEnergy()
{
int cc = 0;
float[] energy_e = new float[1];
TDataType dout = new TDataType(energy_e);
glbCallback eneCb = new glbCallback(); // create a callback instance ...
TLink ene = new TLink("/PETRA/Energy",dout);
if ((id=ene.receive(eneCb)) < 0) // asynchronous access of global variable ...
{
String msg = "err: " + ene.getLinkStatus();
System.out.println(msg);
ene.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine eneCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::receive(TCallback f,int notificationId)
de.desy.tine.client.TLink::receive(TLinkCallback f)

References de.desy.tine.client.TLink.attach().

◆ receive() [2/3]

int de.desy.tine.client.TLink.receive ( TCallback  f,
int  notificationId 
)

Attaches the data sets to the global link and signals the callback routine using a reference to the given notifcation ID in the callback.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. Using the receive() method assumes that the data requested are global available.

Parameters
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface.
notificationIdis the desired identifier to be passed to the supplied callback routine when it is fired.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

private int eid = 0;
private int cid = 1;
public float[] energy = new float[1];
public float[] current = new float[1];
public class glbCallback implements TCallback
{
public void callback(int id, int cc)
{
if (cc != 0)
{
System.out.println("globals Link Error : " + TErrorList.getErrorString(cc));
return;
}
glb[id].update(); // for example ...
}
}
public int MonitorGlobals()
{
glbCallback glbCb = new glbCallback(); // create a callback instance ...
int cc = 0;
TDataType dout = new TDataType(energy);
TLink ene = new TLink("/PETRA/Energy",dout);
if (ene.receive(glbCb,eid) < 0) // asynchronous global access ...
{
String msg = "err: " + ene.getLinkStatus();
System.out.println(msg);
ene.cancel(); // remove the TLink completely
System.exit(1);
}
dout = new TDataType(current);
TLink cur = new TLink("/PETRA/BeamCurrent",dout);
if (cur.receive(glbCb,500,cid) < 0) // asynchronous global access ...
{
String msg = "err: " + cur.getLinkStatus();
System.out.println(msg);
cur.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine glbbCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::receive(TCallback f)

References de.desy.tine.client.TLink.attach().

◆ receive() [3/3]

int de.desy.tine.client.TLink.receive ( TLinkCallback  f)

Attaches the data sets to the global link and signals the callback routine using a reference to the referenced TLink object.

Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. Using the receive() method assumes that the data requested are global available. This is the preferred receive method to use. The Callback instantiates a TLinkCallback() interface which provides a TLink object as parameter.

Parameters
fis the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TLinkCallback() class interface.
Returns
A positive link handle if successful, otherwise -1. On failure the linkStatus property of TLink can be examined.

Example:

private int eid = 0;
private int cid = 1;
public float[] energy = new float[1];
public float[] current = new float[1];
public class glbCallback implements TLinkCallback
{
public void callback(TLink lnk)
{
if (lnk.getLinkStatus() != 0)
{
System.out.println("Link Error : " + lnk.getProperty() + " -> " + lnk.getLastError());
return;
}
if (lnk.getProperty().compareTo("Energy") == 0) System.out.println("energy : " + energy[0]);
if (lnk.getProperty().compareTo("BeamCurrent") == 0) System.out.println("current : " + current[0]);
}
}
public int MonitorGlobals()
{
glbCallback glbCb = new glbCallback(); // create a callback instance ...
int cc = 0;
TDataType dout = new TDataType(energy);
TLink ene = new TLink("/PETRA/Energy",dout);
if (ene.receive(glbCb) < 0) // asynchronous global access ...
{
String msg = "err: " + ene.getLinkStatus();
System.out.println(msg);
ene.cancel(); // remove the TLink completely
System.exit(1);
}
ene.waitForLinkCompletion(); // make sure the first energy value is available
// before continuing
dout = new TDataType(current);
TLink cur = new TLink("/PETRA/BeamCurrent",dout);
if (cur.receive(glbCb) < 0) // asynchronous access ...
{
String msg = "err: " + cur.getLinkStatus();
System.out.println(msg);
cur.cancel(); // remove the TLink completely
System.exit(1);
}
// link data is handled in callback routine glbbCb ...
...
}
See also
de.desy.tine.client.TLink::TLink
de.desy.tine.client.TLink::TLinkCallback
de.desy.tine.client.TLink::receive(TCallback f)

References de.desy.tine.client.TLink.attach().

◆ setArrayDelimiter()

void de.desy.tine.client.TLink.setArrayDelimiter ( String  delimiter)

Sets the array delimiter for use in the toString() method of associated TDataType objects.

Parameters
delimiteris the string delimiter to use in separating data variables in a string dump (default ",")

References de.desy.tine.dataUtils.TDataType.setArrayDelimiter().

◆ setErrorValue() [1/2]

int de.desy.tine.client.TLink.setErrorValue ( double  errValue)

Specifies an error value to fill in associated data buffers in case of link error.

Parameters
errValueIs the error value to use in case of link errors

0 if successful

Referenced by de.desy.tine.client.TLink.execute().

◆ setErrorValue() [2/2]

int de.desy.tine.client.TLink.setErrorValue ( String  errString)

Specifies an error string to fill in associated data buffers in case of link error.

Parameters
errStringIs the string to use in case of link errors

0 if successful

◆ setNotificationTolerance()

void de.desy.tine.client.TLink.setNotificationTolerance ( float  absoluteValue,
float  percentValue 
)

Sets the tolerance level for asynchronous event notification.

Link callback notification can be suppressed if changes in the link data do not exceed the tolerance applied in this call. The tolerance can have an absolute part (in the units of the data) and/or a percent part.

Parameters
absoluteValueis the absolute tolerance any particular data element is allowed to have before an event notification is called.
percentValueis the percent tolerance any particular data element is allowed to have before an event notification is called.

◆ splitContextAndServerAndDeviceAndPropertyFromName()

static String [] de.desy.tine.client.TLink.splitContextAndServerAndDeviceAndPropertyFromName ( String  fullDeviceNameAndProperty)
static

returns string array of length 4 with string[0] = context, string[1] = server, string[2] = device, and string[3] = property

Parameters
fullDeviceNameAndPropertyis the full string to be parsed into its address parts
Returns
string array of length 4

◆ splitDeviceAndPropertyFromName()

static String [] de.desy.tine.client.TLink.splitDeviceAndPropertyFromName ( String  fullDeviceNameAndProperty)
static

returns string array of length 2 with first string = full device name and second string = property

Parameters
fullDeviceNameAndPropertyis the full string to be parsed into device name and property
Returns
string array of length 2

Referenced by de.desy.tine.client.TLink.TLink().

◆ waitForLinkCompletion()

void de.desy.tine.client.TLink.waitForLinkCompletion ( )

Stops thread execution until this link has completed.

Useful for grouped asynchronous links.


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