Start of trail qc_get_target_uris navigation bar

Table of Contents

qc_add_target_uri

Causes a QUARC target to start serving on a particular URI.

Syntax

result = qc_add_target_uri(model, key, new_uri)      % Adds a new URI to the target associated with MODEL
result = qc_add_target_uri(config_set, key, new_uri) % Adds a new URI to the target associated with the configuration set
result = qc_add_target_uri(target_uri, key, new_uri) % Adds a new URI to the target specified by the target URI
result = qc_add_target_uri(key, new_uri)             % Adds a new URI to the target associated with the current model
    

Description

Causes a QUARC target to start serving on a particular URI and adds the URI to the target's list of URIs. The addition is persistent so the QUARC Target Manager will serve on that URI the next time it is restarted.

Always be sure to check that it is possible to connect to the target on the new URI before removing URIs using qc_remove_target_uri!

If model is specified, then the target URI associated with the active configuration set of that model is used to identify the target. If a configuration set is specified then its associated target URI is used. If a target URI is specified then it is used directly to access the target.

If no target URI is specified via a model, configuration set or URI then the target associated with the current model is used.

The key argument is the key to associate with the new URI. If the key is not unique it will cause the URI to replace an existing URI in the target's list of URIs. The key must not be empty. The key is required to remove a URI later using the qc_remove_target_uri function.

The new_uri argument is the new URI to add to the list of URIs being served by the target. No format specifications are supported in this string.

Parameters

model

A string indicating the name of the model from which to identify the target eg. 'q_a_lpbk'.

config_set

A Simulink.ConfigSet configuration set from which to identify the target (see getConfigSet).

target_uri

A string containing the URI used for communicating with the QUARC Target Manager on the target. This parameter is not the new URI, but a URI on which the QUARC Target Manager is already listening.

key

A string indicating the key associated to associate with the URI e.g. 'SHMEM'.

new_uri

A string containing the new URI e.g. 'shmem://quarc-target:1'.

Outputs

result

Returns 0 on success and a negative error code on failure. See qc_error and qc_get_error_message for handling error codes. If no result output is assigned it issues an error on failure.

Examples

qc_add_target_uri('SHMEM', 'shmem://quarc-target:1'); % Adds a shared memory URI and associates it with the key 'SHMEM'
    

See Also

 

navigation bar