AP&C API Reference
|
Public Member Functions | |
byte | ReadOutputSetting (int output) |
After calling SetOutputsSame or SetOutputsDistinct this method will retrieve the state of output . More... | |
ushort | ReadLastAnalogValue (int input) |
After calling GetAnalogInputs this method will retrieve the state of input . More... | |
byte | ReadLastDigitalValue (int index) |
After calling GetDigitalInputs this method will return the latest digital reading for the port at index . More... | |
void | SetOutputsSame (byte mask, byte set) |
Sets multiple outputs at once according to mask to the value of set , and tracks the state of all outputs after the set. Use a mask of 0 and a set of 0 to get the initial state of all outputs. If communications with the board is not open, this method will open it, set the outputs and then close communications again. More... | |
void | SetOutputsDistict (byte mask, byte set) |
Sets multiple outputs at once according to mask while allowing each set output to assume a distinct value. If communications with the board is not open, this method will open it, set the outputs and then close communications again. More... | |
void | SetPulseWidthModulation (byte output, byte pwm) |
Sets the pulse width modulation for the given output. If communications with the board is not open, this method will open it, set the outputs and then close communications again. More... | |
void | GetDigitialInputs () |
Reads the digital input values (0/1) from all input ports. Upon completion the results are available with GetLastDigitalValue(int). If communications with the board is not open, this method will open it, set the outputs and then close communications again. More... | |
void | GetAnalogInputs (Gain gain) |
Reads the analog input values from all input ports. Upon completion the results are available with GetLastAnalogValue(int). If communications with the board is not open, this method will open it, set the outputs and then close communications again. More... | |
ushort | GetAnalogInput (short input, Gain gain) |
Reads one analog input port value from the Top16 and returns the reading. If communications with the board is not open, this method will open it, set the outputs and then close communications again. More... | |
void | OpenBoard () |
Opens the board for communications. More... | |
void | CloseBoard () |
Closes the communications with the board and releases resources. More... | |
void | Dispose () |
override string | ToString () |
Static Public Member Functions | |
static void | Initialize () |
Searches for all attached TCTEC Top16 boards. More... | |
static void | Release () |
static int | DllVersion () |
Retrieves the version number of the top16.dll from TCTEC. More... | |
static Top16 | Find (Predicate< Top16 > predicate) |
static List< Top16 > | FindAll (Predicate< Top16 > predicate) |
Static Public Attributes | |
static log4net.ILog | _log = log4net.LogManager.GetLogger(typeof(Top16)) |
static readonly byte | NUM_OUTPUTS = 8 |
static readonly byte | NUM_INPUTS = 8 |
Protected Member Functions | |
virtual void | Dispose (bool disposeManagedResources) |
Properties | |
static IEnumerable< Top16 > | Boards [get] |
Allows access to each Top16 instance that was found during Initialize. More... | |
string | Name [get] |
string | Description [get, set] |
uint | Handle [get] |
Gain | ReadGain [get, set] |
int | UsbTimeoutMs [get, set] |
uint | ReadErrorResetTrigger [get, set] |
int | ReadErrors [get, set] |
Provides a safe managed adapter to the unsafe Top16 code, by modelling one Top16DIO board and its interface. This simplifies higher-level code by abstracting away the bit manipulation and the pointer conversion tasks. Load the instances with the static interface of this class.
There are three sets of data managed by this model:
The input readings are available for all input ports depending on how the calling application utilizes the model (by making analog and/or digital calls). The output readings are made available just by setting output values, so the current state of the outputs is always tracked.
|
inline |
Closes the communications with the board and releases resources.
|
inlinestatic |
Retrieves the version number of the top16.dll from TCTEC.
|
inline |
Reads one analog input port value from the Top16 and returns the reading. If communications with the board is not open, this method will open it, set the outputs and then close communications again.
input | The input (0 to number of inputs - 1) to be read. |
gain | The gain to use for the amplifier when reading. |
|
inline |
Reads the analog input values from all input ports. Upon completion the results are available with GetLastAnalogValue(int). If communications with the board is not open, this method will open it, set the outputs and then close communications again.
gain |
|
inline |
Reads the digital input values (0/1) from all input ports. Upon completion the results are available with GetLastDigitalValue(int). If communications with the board is not open, this method will open it, set the outputs and then close communications again.
|
inlinestatic |
|
inline |
Opens the board for communications.
|
inline |
After calling GetAnalogInputs this method will retrieve the state of input .
input | The number of the input (1 - number of inputs) being requested. |
|
inline |
After calling GetDigitalInputs this method will return the latest digital reading for the port at index .
index | The index (0 - NUM_INPUTS) of the input port to be checked. |
|
inline |
After calling SetOutputsSame or SetOutputsDistinct this method will retrieve the state of output .
output | The number of the output (1 - number of outputs) being requested. |
|
inline |
Sets multiple outputs at once according to mask while allowing each set output to assume a distinct value. If communications with the board is not open, this method will open it, set the outputs and then close communications again.
mask | |
set |
|
inline |
Sets multiple outputs at once according to mask to the value of set , and tracks the state of all outputs after the set. Use a mask of 0 and a set of 0 to get the initial state of all outputs. If communications with the board is not open, this method will open it, set the outputs and then close communications again.
mask | |
set |
|
inline |
Sets the pulse width modulation for the given output. If communications with the board is not open, this method will open it, set the outputs and then close communications again.
output | The output (1-8) to be manipulated. |
pwm | The width of the pulse modulation (0 - 255, 0x00 - 0xff). |
|
staticget |
Allows access to each Top16 instance that was found during Initialize.