Core Serial Library in C#  1.2
Public Member Functions | Public Attributes | Properties | List of all members
ZaberAsciiAxis Class Reference

A class to model an individual axis of an ASCII device. More...

Inheritance diagram for ZaberAsciiAxis:
IZaberAxis

Public Member Functions

 ZaberAsciiAxis (ZaberAsciiPort port, byte deviceAddress, int axisNumber)
 Creates a new instance of the ZaberAsciiAxis class. More...
 
 ZaberAsciiAxis (ZaberAsciiDevice parent, int number)
 Create a new instance of the ZaberAsciiAxis class. More...
 
int GetPosition ()
 Gets the position of the axis, in microsteps. More...
 
void Home ()
 Homes the device. More...
 
bool IsBusy ()
 Polls the device to determine whether it is currently moving. More...
 
void MoveAbsolute (int position)
 Moves the device to the specified position. More...
 
void MoveRelative (int distance)
 Moves the device by a certain distance. More...
 
void MoveVelocity (int speed)
 Moves the device at a certain speed. More...
 
void PollUntilIdle ()
 Blocks while Polling the device at a regular interval until it reports itself as idle. More...
 
void Stop ()
 Stops the device. More...
 

Public Attributes

int Number
 The number of this axis. More...
 
byte ParentAddress
 The address of the parent device. More...
 

Properties

IZaberPort Port [get]
 The parent port of the axis. More...
 

Detailed Description

A class to model an individual axis of an ASCII device.

This class should be the de-facto way to interact with Zaber devices using the ASCII protocol (not ZaberAsciiDevice).

Constructor & Destructor Documentation

ZaberAsciiAxis ( ZaberAsciiPort  port,
byte  deviceAddress,
int  axisNumber 
)
inline

Creates a new instance of the ZaberAsciiAxis class.

This three-argument constructor will first check in the device list of the port specified to see if a device with the specified address exists. If so, the constructor adds this axis to that device's list of axes. If not, it creates an appropriate device object, adds it to the port's list, and then registers itself with that device.

No matter what, the result of this constructor will be that the port will have a device with address deviceAddress , which will have an axis (this newly-created object) with number axisNumber .

Parameters
portThe port this axis is connected to.
deviceAddressThe address of the parent device.
axisNumberThe axis number.
ZaberAsciiAxis ( ZaberAsciiDevice  parent,
int  number 
)
inline

Create a new instance of the ZaberAsciiAxis class.

Parameters
parentThe parent device.
numberThe axis number.

Member Function Documentation

int GetPosition ( )
inline

Gets the position of the axis, in microsteps.

Returns
The axis position.
Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

void Home ( )
inline

Homes the device.

Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

bool IsBusy ( )
inline

Polls the device to determine whether it is currently moving.

Returns
true if the device is busy; false if it is idle.
Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

void MoveAbsolute ( int  position)
inline

Moves the device to the specified position.

Parameters
positionThe position in microsteps.
Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

void MoveRelative ( int  distance)
inline

Moves the device by a certain distance.

Parameters
distanceThe distance in microsteps.
Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

void MoveVelocity ( int  speed)
inline

Moves the device at a certain speed.

This command differs from the other two move commands in that it returns immediately instead of waiting for the device to finish its movement and become idle. For this reason, the Stop() method is also provided. Note that if you have Alert messages enabled on your device, this command could result in unconsumed alerts waiting to be received. Call Port.Drain() before issuing the next command if this causes problems.

Parameters
speedThe speed to move at.
Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

void PollUntilIdle ( )
inline

Blocks while Polling the device at a regular interval until it reports itself as idle.

Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

void Stop ( )
inline

Stops the device.

Exceptions
UnexpectedReplyReceivedExceptionAn unexpected reply was read from the serial port.

Implements IZaberAxis.

Member Data Documentation

int Number

The number of this axis.

byte ParentAddress

The address of the parent device.

Property Documentation

IZaberPort Port
get

The parent port of the axis.


The documentation for this class was generated from the following file: