Basic Procedures End of trail navigation bar

Table of Contents > QUARC > User's Guide > QUARC Basics for Scripts

Managing Scripts on the Target

QUARC supplies a variety of functions that may be used to manage scripts that are running on local or remote targets, right from the MATLAB Command Prompt or a MATLAB script. These functions can be used to perform tasks such as running code in a QUARC target, opening a QUARC console for a target, or adding and removing target URI's.

QUARC also provides a means of managing scripts on the target using Windows Explorer. Each time a script is built, a QUARC real-time executable is created. By right-clicking on this executable file, a context menu is opened that includes options such as Run, Run on target, Run at boot and more. For detailed information on how to use this menu please see Using Windows Explorer to Manage Models and Scripts.

Managing Scripts on the Target Using QUARC MATLAB Functions

This section describes each of the MATLAB functions supplied by QUARC that may be used to manage scripts on targets. For more details about each function, please click on the function name.

qc_script_console: This function may be used to open a QUARC Console to monitor a scripts's standard input and output, even when the script runs on a remote target. The script executable's name, including extension, must specified when using this function. It will open a QUARC Console for the target currently associated with the given script. If the additional argument 'all' is specified then this function opens a QUARC Console that monitors all scripts running on the target simultaneously.

qc_add_target_uri: This function may be used to cause the QUARC Target Manager to start serving on a particular URI. The QUARC Target manager continues to serve on the other URIs for which it was configured. The new URI is passed as a string to this function. If a script executable, including extension, is specified when using this function then the target URI currently associated with that script is used to identify the target. If a target URI is specified, it is used directly to access the target. This function can be useful for making the target accessible to other systems.

A "key" argument must be passed to this function to associate a key with the new URI. If this key is not unique, the new URI will replace an existing URI in the target's list of URIs. This key is later required if the URI is being removed using the qc_remove_target_uri function.

qc_get_target_uris: This function may be used to retrieve a list of all the URIs that may be used to connect to a QUARC target. The list is returned as a structure array containing two fields:

key: A string containing the key associated with the target URI.
uri: A string containing the full target URI.

If a script executable, including extension, is specified when using this function, the target URI currently associated with that script is used to identify the target. If a target URI is specified, it is used directly to access the target.

qc_remove_target_uri: This function may be used to stop a QUARC Target Manager from serving on a particular URI.

Warning WARNING: BE VERY CAREFUL WHEN USING THIS FUNCTION. IF ALL THE URIs FOR A TARGET ARE REMOVED THERE WILL NO LONGER BE ANY MEANS OF CONNECTING TO THAT TARGET.

If a script executable, including extension, is specified when using the function, the target URI currently associated with that script is used to identify the target. If a target URI is specified, it is used directly to access the target. is used.

A "key" argument must be passed to this function. This key must be the one associated with the URI to be removed. Please note that the URI itself does should not be specified. A key is associated with a URI when the URI is first added to the target using the qc_add_target_uri function.

 

navigation bar