Methods

Create

void Create ( )

Return Value

None.

Remarks

This method will create a new instance of the VSA executable. The property, vsaPath, must be a valid “VSA.EXE” location. The new VSA window is opened as indicated by the showWindow property. The routine found in the routinePath property is subsequently loaded.

The Create method may fail if VSA displays any warning or error messages when the routine is loaded. Any warning pop-up dialogs may prevent the Create function from properly identifying the new VSA window. Resolve any warning messages that occur during the load or execution of a routine.

Destroy

Destroy ( )

Return Value

None.

Remarks

This method will attempt to close the instance of VSA associated with this control. If a routine is currently executing (or paused) it will be stopped and closed.

SetComPort

SetComPort ( short type, short portnum, short tracknum )
Parameters

type

Port type (see below)

portnum

New port

tracknum

The track to which the new port is to be assigned.

Return Value

None.

Remarks

This method will assign the specified track in the associated VSA window to a new port. The portnum must be a valid communications resource on the execution machine. If the portnum is invalid, an error will be displayed by VSA when execution is begun. The tracknum must be a valid track number. Type must be one of the following:

Port type

Port Type

Value of type

Serial “COM” Port

0

Parallel “LPT” Port

1

RAPU “RAPU” Port

2

NONE (data is not sent)

3

Velleman DMX “K8062” Port

4

“ENTTEC” DMX Port

5

EnduranceRC “ENRC” Port

6

SetStartMarker

SetStartMarker ( long time )
Parameters

time

New start time.

Return Value

None.

Remarks

This method will move the first marker to the specified position. If the new value for the first marker is greater than that of the current second marker, the first marker will be moved instead. The value of time should never be negative.

SetStopMarker

SetStopMarker ( long time )
Parameters

time

New stop time.

Return Value

None.

Remarks

This method will move the second marker to the specified position. If the new value for the second marker is less than that of the current first marker, the first marker will be moved instead. The value of time should never be negative.

Play

Play ( short playMode, short autoPause )
Parameters

playMode

Defines the mode of play VSA should start. Different values of playMode correspond to the different types of play normally available in VSA. See Remarks section for details.

autoPause

If 0, VSA will simply start play. If not 0, VSA will start play and the immediately execute a pause. See Remarks section for details. Ignored if executing a Resume Play.

Return Value

None.

Remarks

The playMode parameter can take on the following values:

playMode

Type of Execution

Value of playMode

Play all

1

Play from first marker

2

Play to second marker

3

Play frame at first marker

4

Play from first to second marker

5

Resume play

6

Before execution is begun, VSA must 1) process the events and 2) load the wave file. Because these two operations are asynchronous, the time necessary may be system dependent. When passing autoPause as TRUE, VSA performs all necessary initialization functions and then returns. Play can then immediately started by again calling the Play method and specifying to “Resume Play.” Synchronization with external events (those not controlled by VSA) can be achieved by preloading VSA execution, starting external processes, and then immediately executing a Resume Play.

Pause

Pause ( )

Return Value

None.

Remarks

This method pauses execution at the current point. Call Play method with playMode as “Resume Play” to resume execution.

Stop

Stop ( )

Return Value

None.

Remarks

This method stops execution at the current point.

GetPlaybackStatus

long GetPlaybackStatus ( )

Return Value

This function returns the frame number of the currently executing frame of a playing or paused routine. If the routine is stopped, the function returns -1. If there is an error, the function returns -2.

Remarks

This function can be used to determine the current execution point of the routine.