AP&C API Reference
Public Member Functions | List of all members
Apac.Dlp.IO20 Class Reference

The device class that wraps up the DLP IO20 command set. More...

Inheritance diagram for Apac.Dlp.IO20:
Apac.Ftdi.Ftdi.FtdiDevice

Public Member Functions

 IO20 (IntPtr handle, uint id, uint flags, Ftdi.Ftdi.FT_DEVICE_TYPE deviceType, uint locationId, string serialNumber, string description)
 Initializes a new instance of the IO20 class. More...
 
 IO20 (Ftdi.Ftdi.FtdiDevice device)
 Initializes a new instance of the IO20 class. More...
 
WhyBool Reset ()
 Resets this instance by opening and closing the connection. This also resets the ReadErrors property to zero. More...
 
WhyBool Ping ()
 Performs an echo message with the IO20. More...
 
WhyBool FlashLed ()
 Flashes the IO20 D1 LED. More...
 
void TurnLedOn ()
 Turns the IO20 D1 LED on. More...
 
WhyBool TurnLedOff ()
 Turns the IO20 D1 LED off. More...
 
WhyBool ControlRelay (byte relayNumber, bool reset)
 Sets or resets the relay identified by relayNumber . More...
 
WhyBool SetDigitalOutput (byte channel, bool outputLow)
 Controls the digital output. More...
 
bool GetDigitalInput (byte channel)
 Gets the digital input from channel . More...
 
WhyBool ControlEventCounter (byte channel, bool triggerOnFallingEdge)
 Enables and clears the event counter on channels RB6 aor RB7. More...
 
uint ReadEventCounter (byte channel)
 Reads the event counter from channel . More...
 
ulong DetectTemperatureSensor (byte channel)
 Detects the temperature sensor on channel and if one exists provides the serial number More...
 
byte[] ReadTemperatureSensor (byte channel, bool convertFirst)
 Reads the temperature sensor, optionally requesting a conversion first.
If the data read succeeds, a new conversion is directly performed, but reads spaced apart in time will require the conversion to provide accurate data. More...
 
WhyBool SetTemperatureSensorResolution (byte channel, byte resolution)
 Sets the temperature sensor resolution to:

Bit Count Details
9 0.5 ° C, taking 94 ms to convert (max)
10 0.25 ° C, taking 188 ms to convert (max)
11 0.125 ° C, taking 375 ms to convert (max)
12 0.0625 ° C, taking 750 mS to convert (max)
More...
 
int ReadAnalogInput (byte channel)
 Reads the analog input for channel , which will be a 10-bit number presenting 0-5 volts (nominal), which would be about .0048 volts per each increment of the value (ie: 1 = .0048 volts, 2 = .0097 volts, etc). More...
 
int[] ReadAllAnalogInputs ()
 Reads all analog inputs, 0 - 13. More...
 
- Public Member Functions inherited from Apac.Ftdi.Ftdi.FtdiDevice
 FtdiDevice (IntPtr handle, uint id, uint flags, FT_DEVICE_TYPE deviceType, uint locationId, string serialNumber, string description)
 
FT_STATUS SetTimeouts (uint readTimeoutMs, uint writeTimeoutMs)
 
FT_STATUS SetLatencyTimer (byte ms)
 
FT_STATUS Open ()
 Transitions the communications with the device to an open state. More...
 
FT_STATUS Close ()
 
FT_STATUS Write (byte[] command)
 
FtdiResponse Read (uint bytesToRead, int retryCount)
 
FtdiResponse ReadUsingQueue (uint bytesToRead, int queueCheckDelay)
 
FT_STATUS Purge (FT_PURGE flags)
 
override string ToString ()
 

Additional Inherited Members

- Properties inherited from Apac.Ftdi.Ftdi.FtdiDevice
IntPtr Handle [get]
 
uint Id [get]
 
uint LocationId [get]
 
uint Flags [get]
 
FT_DEVICE_TYPE DeviceType [get]
 
string SerialNumber [get]
 
string Description [get, set]
 
byte LatencyTimer [get, set]
 
uint UsbTimeout [get, set]
 
uint ReadErrorResetTrigger [get, set]
 Gets or sets the read error reset trigger, which determines how many consecutive read errors are allowed before a connection reset is tried. More...
 
uint ReadErrors [get, set]
 Gets or sets the current number of read errors. More...
 
bool IsOpen [get]
 Determines if the device is open or not based on Flags. More...
 
bool IsHighSpeedUsb [get]
 Determines if the device is high-speed USB (true) or full-speed USB (false). More...
 

Detailed Description

The device class that wraps up the DLP IO20 command set.

Constructor & Destructor Documentation

◆ IO20() [1/2]

Apac.Dlp.IO20.IO20 ( IntPtr  handle,
uint  id,
uint  flags,
Ftdi.Ftdi.FT_DEVICE_TYPE  deviceType,
uint  locationId,
string  serialNumber,
string  description 
)
inline

Initializes a new instance of the IO20 class.

Parameters
handleThe handle.
idThe id.
flagsThe flags.
deviceTypeType of the device.
locationIdThe location id.
serialNumberThe serial number.
descriptionThe description.

◆ IO20() [2/2]

Apac.Dlp.IO20.IO20 ( Ftdi.Ftdi.FtdiDevice  device)
inline

Initializes a new instance of the IO20 class.

Parameters
deviceThe device.

Member Function Documentation

◆ ControlEventCounter()

WhyBool Apac.Dlp.IO20.ControlEventCounter ( byte  channel,
bool  triggerOnFallingEdge 
)
inline

Enables and clears the event counter on channels RB6 aor RB7.

Parameters
channelThe channel.
triggerOnFallingEdgeif set to true then the event count is triggered on the falling edge, otherwise it is triggered on the rising edge.
Returns
Exceptions
Apac.Ftdi.DeviceNotOpenExceptionWill be thrown if the device is not open.
System.ArgumentOutOfRangeExceptionWill be thrown if channel does not specify 6 or 7.

◆ ControlRelay()

WhyBool Apac.Dlp.IO20.ControlRelay ( byte  relayNumber,
bool  reset 
)
inline

Sets or resets the relay identified by relayNumber .

Parameters
relayNumberThe relay to set, either 1 or 2. Any other value will cause and ArgumentOutOfRangeException.
resettrue indicates the relay will be reset, false indicates it will be set.
Returns
Returns a WhyBool indicating the status of the command.

◆ DetectTemperatureSensor()

ulong Apac.Dlp.IO20.DetectTemperatureSensor ( byte  channel)
inline

Detects the temperature sensor on channel and if one exists provides the serial number

Parameters
channelThe channel to be tested for temperature sensor.
Returns
Returns 0 if no sensor is detected, or the 1-Wire serial number of the attached sensor.
Exceptions
Apac.Ftdi.DeviceNotOpenExceptionWill be thrown if the device is not open.
System.ArgumentOutOfRangeExceptionWill be thrown if channel is not between 0 and 13, inclusive.
Apac.Ftdi.Ftdi.FtdiExceptionWill be thrown if a communication error occurs.
System.ExceptionWill be thrown if a short circuit or data always low condition is detected on the line.

◆ FlashLed()

WhyBool Apac.Dlp.IO20.FlashLed ( )
inline

Flashes the IO20 D1 LED.

Returns
Returns a WhyBool indicating the status of the command.

◆ GetDigitalInput()

bool Apac.Dlp.IO20.GetDigitalInput ( byte  channel)
inline

Gets the digital input from channel .

Parameters
channelThe channel.
Returns
Returns true if the digital input is high and false if the digitial input is low.
Exceptions
Ftdi.Ftdi.FtdiExceptionWill be thrown if any communication error occurs, which is commands that do not return any data from the device.

◆ Ping()

WhyBool Apac.Dlp.IO20.Ping ( )
inline

Performs an echo message with the IO20.

Returns
Returns a WhyBool indicating the status of the command.

◆ ReadAllAnalogInputs()

int [] Apac.Dlp.IO20.ReadAllAnalogInputs ( )
inline

Reads all analog inputs, 0 - 13.

Returns
Returns int[] containing the results for all analog channels, indexed 0 - 13 corresponding to channels of the same number (ie: 0 = AN0, 1 = AN1, etc).
Exceptions
Apac.Ftdi.DeviceNotOpenException
Apac.Ftdi.Ftdi.FtdiException

◆ ReadAnalogInput()

int Apac.Dlp.IO20.ReadAnalogInput ( byte  channel)
inline

Reads the analog input for channel , which will be a 10-bit number presenting 0-5 volts (nominal), which would be about .0048 volts per each increment of the value (ie: 1 = .0048 volts, 2 = .0097 volts, etc).

Parameters
channelThe channel to be read.
Returns
Returns the results of the read.
Exceptions
Apac.Ftdi.DeviceNotOpenException
System.ArgumentOutOfRangeExceptionchannel
Apac.Ftdi.Ftdi.FtdiException

◆ ReadEventCounter()

uint Apac.Dlp.IO20.ReadEventCounter ( byte  channel)
inline

Reads the event counter from channel .

Parameters
channelThe channel.
Returns
Returns the 32-bit event count for channel .
Exceptions
Apac.Ftdi.DeviceNotOpenExceptionWill be thrown if the device is not open.
System.ArgumentOutOfRangeExceptionWill be thrown if channel is not 6 or 7.
Apac.Ftdi.Ftdi.FtdiExceptionWill be thrown if some communication error occurs.

◆ ReadTemperatureSensor()

byte [] Apac.Dlp.IO20.ReadTemperatureSensor ( byte  channel,
bool  convertFirst 
)
inline

Reads the temperature sensor, optionally requesting a conversion first.
If the data read succeeds, a new conversion is directly performed, but reads spaced apart in time will require the conversion to provide accurate data.

Parameters
channelThe channel.
convertFirstif set to true [convert first].
Returns
Returns the byte[] containing the 1-Wire temperature data as encoded by the sensor. Use this value to drive the appropriate 1-Wire forumla to get the temperature in degrees celcius or fahrenheit.
Exceptions
Apac.Ftdi.DeviceNotOpenException
System.ArgumentOutOfRangeExceptionchannel
Apac.Ftdi.Ftdi.FtdiException

◆ Reset()

WhyBool Apac.Dlp.IO20.Reset ( )
inline

Resets this instance by opening and closing the connection. This also resets the ReadErrors property to zero.

Returns
Returns a WhyBool that indicates success or a failure with the reason for the failure.
Exceptions
DeviceNotOpenException

◆ SetDigitalOutput()

WhyBool Apac.Dlp.IO20.SetDigitalOutput ( byte  channel,
bool  outputLow 
)
inline

Controls the digital output.

Parameters
channelThe channel to be controlled.
outputLowIf asOutput is false, then this parameter will be ignored. Otherwise, if outputLow is true then the digital output will be set low and if it is false the digital output will be set high.
Returns
Returns a WhyBool indicating the status of the command.

◆ SetTemperatureSensorResolution()

WhyBool Apac.Dlp.IO20.SetTemperatureSensorResolution ( byte  channel,
byte  resolution 
)
inline

Sets the temperature sensor resolution to:

Bit Count Details
9 0.5 ° C, taking 94 ms to convert (max)
10 0.25 ° C, taking 188 ms to convert (max)
11 0.125 ° C, taking 375 ms to convert (max)
12 0.0625 ° C, taking 750 mS to convert (max)

Parameters
channelThe channel to be configured.
resolutionThe resolution to be set with valid values being 9-12 (0x09-0x0C).
Returns
Returns a WhyBool indicating the status of the command.
Exceptions
Apac.Ftdi.DeviceNotOpenException
System.ArgumentOutOfRangeExceptionwill be thrown if either channel or resolution is out of bounds.

◆ TurnLedOff()

WhyBool Apac.Dlp.IO20.TurnLedOff ( )
inline

Turns the IO20 D1 LED off.

Returns
Returns a WhyBool indicating the status of the command.

◆ TurnLedOn()

void Apac.Dlp.IO20.TurnLedOn ( )
inline

Turns the IO20 D1 LED on.

Returns
Returns a WhyBool indicating the status of the command.

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