Downloads a model to the QUARC Target.

Namespace:  Quanser.Targets
Assembly:  Quanser.Targets (in Quanser.Targets.dll)

Syntax

Visual Basic (Declaration)
Public Function DownloadModel ( _
	name As String, _
	generator As String, _
	path As String, _
	callback As IDownload, _
	context As Object _
) As Integer
C#
public int DownloadModel(
	string name,
	string generator,
	string path,
	IDownload callback,
	Object context
)
Visual C++
public:
int DownloadModel(
	String^ name, 
	String^ generator, 
	String^ path, 
	IDownload^ callback, 
	Object^ context
)
JavaScript
function downloadModel(name, generator, path, callback, context);

Parameters

name
Type: System..::.String
The name of the model.
generator
Type: System..::.String
The name of the program which generated the model code e.g., "simulink".
path
Type: System..::.String
The path to the model. This can be an abstract path and need not reference a file system, although it typically does.
callback
Type: Quanser.Targets..::.IDownload
An interface that is invoked to get the code to download.
context
Type: System..::.Object
An arbitrary value to pass to the callback.

Return Value

Returns the number of bytes of code downloaded. A negative error code is returned in the event of an error.

Remarks

Downloads a model to the QUARC Target. The model is actually downloaded in chunks using the download callback passed to this method. Hence, the code can actually be downloaded from anywhere. The model name, generator and path must be specified so that the QUARC Target Manager can register the name and path for access by other clients. Also, the generator is used to determine how to load the code. The name of the computer from which the code was downloaded will also be recorded by the QUARC Target Manager. This information is useful for clients like the QUARC GUI which need the model path to load the model into Simulink if the model is on the same computer.

See Also