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

Represents an axis of a device running in the binary protocol. More...

Inheritance diagram for ZaberBinaryDevice:
IZaberAxis

Public Member Functions

 ZaberBinaryDevice (ZaberBinaryPort port, byte number)
 Create a new instance of the ZaberBinaryDevice class to model a Zaber device connected to the port specified by port using the binary protocol. 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...
 

Properties

byte Number [get]
 The device number, 0-255. More...
 
IZaberPort Port [get]
 The parent port of the axis. More...
 

Detailed Description

Represents an axis of a device running in the binary protocol.

The binary protocol makes no distinction between devices and axes: every axis is a device in the binary protocol. Therefore this class is named ZaberBinaryDevice rather than ZaberBinaryAxis to eliminate confusion about this fact, despite implementing the IZaberAxis interface.

Constructor & Destructor Documentation

ZaberBinaryDevice ( ZaberBinaryPort  port,
byte  number 
)
inline

Create a new instance of the ZaberBinaryDevice class to model a Zaber device connected to the port specified by port using the binary protocol.

Parameters
portThe port to which this device is connected.
numberThe number of this device.

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.

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.

Property Documentation

byte Number
get

The device number, 0-255.

IZaberPort Port
get

The parent port of the axis.


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