/
RT-LAB | ORCHESTRA: Functions Reference

Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

RT-LAB | ORCHESTRA: Functions Reference

Page Content

The following functions are called from within a C/C++ application to interface with RT-LAB running on a target processor.

RTActivatePrintBuffer

Group

Orchestra

Description

This function is obsolete.

Activates the print buffer used to print data using the OpalPrint() function. 

This function MUST be called before calling OpalPrint().

Synopsis

RTAPIReturn_t RTActivatePrintBuffer(void);

Input

None

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTDeactivatePrintBuffer

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTCheckReadyToGo

Group

Orchestra

Description

Verify the ready to go condition.

Connection key should be set before invoking this function.

Synopsis

RTAPIReturn_t RTCheckReadyToGo(void);

Input

None

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTGetSkipWaitToGoAtConnection, RTSetSkipWaitToGoAtConnection

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTConnect

Group

Orchestra

Description

Attaches an External Component to the memory segment corresponding to a domain.

If the connection fails, the calling process goes to sleep and attempts to connect repeatedly until the timeout delay expires.

To use ethernet communication, the RTConnectWithFile function must be used.

Synopsis

RTAPIReturn_t RTConnect(const char *domainName, unsigned int timeout);

Input

  • domainName : the name of the domain to which the connection is requested. This domain must exist in the DDF read by an RT-LAB subsystem.

  • timeout : The duration after which a failed connection attempt times out, in seconds.

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTConnectInstance, RTConnectWithFile, RTDisconnect

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTConnectInstance

Group

Orchestra

Description

Attaches an External Component to the memory segment corresponding to a domain and an instance id.

If the connection fails, the calling process goes to sleep and attempts to connect repeatedly until the timeout delay expires.

Synopsis

RTAPIReturn_t RTConnectIntance(const char *domainName, unsigned int timeout, const char *instanceID);

Input

  • domainName : The name of the domain to which the connection is requested. This domain must exist in the DDF read by an RT-LAB subsystem.

  • timeout : The duration after which a failed connection attempt times out, in seconds.

  • instanceID : The instance identifier. If empty, this value is ignored and the function performs exactly as RTConnect.

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTConnect, RTConnectWithFile, RTDisconnect

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTConnectWithFile

Group

Orchestra

Description

Attaches an External Component to the memory segment corresponding to a domain.

If the connection fails, the calling process goes to sleep and attempts to connect repeatedly until the timeout delay expires.

Synopsis

RTAPIReturn_t RTConnectWithFile(const char *xmlFile, const char *domainName, unsigned int timeout);

Input

  • xmlFile : The path to the DDF file.

  • domainName : The name of the domain to which the connection is requested. This domain must exist in the DDF read by an RT-LAB subsystem.

  • timeout : The duration after which a failed connection attempt times out, in seconds.

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTConnect, RTConnectInstance, RTDisconnect

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTDeactivatePrintBuffer

Group

Orchestra

Description

This function is obsolete

Deactivates the print buffer used to print data using the OpalPrint() function.

Synopsis

RTAPIReturn_t RTDeactivatePrintBuffer(void);

Input

None

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTActivatePrintBuffer

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTDefineFlagDelay

Group

Orchestra

Description

Defines the delay to wait when using flag synchronization (XHP).

It calls the system function 'usleep' and frees the CPU.

Synopsis

RTAPIReturn_t RTDefineFlagDelay(unsigned int usec);

Input

  • usec: delay to wait in micro second

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTUseFlagWithTool

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTDisconnect

Group

Orchestra

Description

Detaches the current process from the shared memory segment corresponding to a domain.

Synopsis

RTAPIReturn_t RTDisconnect(void);

Input

None

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTConnect, RTConnectInstance, RTConnectWithFile

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTGetConnectionKey

Group

Orchestra

Description

Gets the current connection key.

Synopsis

RTAPIReturn_t RTGetConnectionKey(unsigned int *key);

Input

None

Output

  • key: Key to a connection

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTNewConnectionKey, RTSetConnectionKey

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTGetErrorMessage

Group

Orchestra

Description

Retrieves the text description of an RTAPI error.

Synopsis

const char* RTGetErrorMessage(RTAPIReturn_t returnCode);

Input

  • returnCode: The RTAPIReturn_t error code returned by a previous RTAPI function call.

Output

None

Return Value

A pointer to a const string that contains the text description of the error.

Example

None

Related Items

RTAPIReturn_t

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTGetInfoForItem

Group

Orchestra

Description

Retrieves data item information from a locally kept offset table. This item must exist in the DDF read by an RT-LAB subsystem.

Synopsis

RTAPIReturn_t RTGetInfoForItem(const char *itemName, size_t*pTypeSize, unsigned short *pLength);

Input

  • itemName: The name of the item for which the info is retrieved.

Output

  • pTypeSize: Data item type size in bytes.

  • pLength: Array length of the data item, i.e. the number of times the type is repeated.

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTGetKeyForItem

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTGetKeyForItem

Group

Orchestra

Description

Retrieves the index of a data item in a locally kept offset table. This item name must exist in the DDF read by an RT-LAB subsystem. The index is used to speed up data access.

Synopsis

RTAPIReturn_t RTGetKeyForItem(const char *itemName, unsigned short *pKey);

Input

  • itemName: The name of the item for which the key is retrieved.

Output

  • pKey: The key corresponding to the data item.

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTPublishByKey, RTSubscribeByKey

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTGetSkipWaitToGoAtConnection

Group

Orchestra

Description

Retrieves the current WaitToGo setting of the model.

Non-zero value: ignore the WaitToGo during the connection step.

Zero value: performs the WaitToGo during the connection step.

Synopsis

RTAPIReturn_t RTGetSkipWaitToGoAtConnection(unsigned int *flag);

Input

None

Output

  • flag: Pointer to receive the current WaitToGo setting.

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTSetSkipWaitToGoAtConnection

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTNewConnectionKey

Group

Orchestra

Description

Creates a new connection key.

A connection key identifies a connection between a specific combo of Orchestra’s framework and client.

This function must be called before any configuration function like RTSetupRefMemRemoteConnection and before RTConnect.

Synopsis

RTAPIReturn_t RTNewConnectionKey(unsigned int *key);

Input

None

Output

  • key: Key to be set to use this connection.

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTSetConnectionKey, RTGetConnectionKey

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTPublish

Group

Orchestra

Description

Writes data to the shared memory segment attached to the current process.

To ensure proper synchronization between a publisher and a subscriber exchanging data through a domain, a call to RTPublish() MUST appear between a call to RTPublishLock() and a call to RTPublishUnlock().

Synopsis

RTAPIReturn_t RTPublish(unsigned int num, ...);

Input

  • num: The number of data items that are written to the memory segment. At least one (name, value) pair is required.

  • itemName: Name of the item from the domain.

  • value: Value to be published for the corresponding ‘itemName’.

Output

None

Return Value

See RTAPIReturn_t error code

Example

RTPublish(1, "item01", &value01);
RTPublish(2, "item01", &value01, "item02", &value02);

Related Items

RTSubscribe, RTPublishLock, RTPublishUnlock

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll

  • libOpalOrchestra.so

Header File

RTAPI.h

RTAPI.h

RTPublishByKey

Group

Orchestra

Description

Writes data to the shared memory segment attached to the current process. The key corresponding to the item of interest is obtained by calling RTGetKeyForItem().

Synopsis

RTAPIReturn_t RTPublishByKey(unsigned short key, void *value);

Input

  • key: Index in the offset table.

  • value: The value to publish.

Output

None

Return Value

See RTAPIReturn_t error code

Example

None

Related Items

RTGetKeyForItem, RTPublishLock, RTPublishUnlock

Library and Header

 

Windows

OPAL-RTLinux

Static Library

-

-

Dynamic Library

  • OpalOchestra.dll

  • OpalOrchestra_64.dll

  • OpalOrchestraVISA.dll