Core Serial Library in C#
1.2
|
A class to model an individual axis of an ASCII device. More...
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... | |
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).
|
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 .
port | The port this axis is connected to. |
deviceAddress | The address of the parent device. |
axisNumber | The axis number. |
|
inline |
Create a new instance of the ZaberAsciiAxis class.
parent | The parent device. |
number | The axis number. |
|
inline |
Gets the position of the axis, in microsteps.
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
inline |
Homes the device.
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
inline |
Polls the device to determine whether it is currently moving.
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
inline |
Moves the device to the specified position.
position | The position in microsteps. |
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
inline |
Moves the device by a certain distance.
distance | The distance in microsteps. |
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
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.
speed | The speed to move at. |
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
inline |
Blocks while Polling the device at a regular interval until it reports itself as idle.
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
|
inline |
Stops the device.
UnexpectedReplyReceivedException | An unexpected reply was read from the serial port. |
Implements IZaberAxis.
int Number |
The number of this axis.
byte ParentAddress |
The address of the parent device.
|
get |
The parent port of the axis.