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

A class to represent a single- or multi-axis Zaber device using the ASCII protocol. More...

Public Member Functions

 ZaberAsciiDevice (ZaberAsciiPort port, byte address)
 Create a new instance of the ZaberAsciiDevice class. More...
 
ZaberAsciiAxis GetAxis (int number)
 Get the axis with the specified number. More...
 

Public Attributes

byte Address
 The device address. More...
 

Properties

ZaberAsciiPort Port [get]
 The parent port of the device. More...
 

Detailed Description

A class to represent a single- or multi-axis Zaber device using the ASCII protocol.

ZaberAsciiAxis is the intended class for controlling devices using the ASCII protocol. This encourages thinking of devices in terms of axes instead of whole devices, and helps to unify the ASCII and binary halves of the library.

Consider using this class to control a multi-axis device like so:

var device = new ZaberAsciiDevice(myPort, 1);
device.GetAxis(1).Home();
device.GetAxis(2).MoveRelative(1000);
device.GetAxis(1).MoveAbsolute(2000);

Constructor & Destructor Documentation

ZaberAsciiDevice ( ZaberAsciiPort  port,
byte  address 
)
inline

Create a new instance of the ZaberAsciiDevice class.

Parameters
portThe port the device is connected to.
addressThe device address.
Exceptions
ArgumentNullExceptionport is null.

Member Function Documentation

ZaberAsciiAxis GetAxis ( int  number)
inline

Get the axis with the specified number.

This method will create the axis specified and assume that the device does indeed have such an axis. It is up to you to only make axes which actually exist on the device.

For a method which will detect the number of axes a device has, see ZaberAsciiPort.FindAxes(), or send the "get system.axiscount" ASCII command directly to a device.

Parameters
numberThe number of the axis.
Returns
A matching ZaberAsciiAxis instance.
Exceptions
ArgumentExceptionnumber is not between 1 and 9.

Member Data Documentation

byte Address

The device address.

Property Documentation

ZaberAsciiPort Port
get

The parent port of the device.


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