EDDevice Class |
The EDDevice type exposes the following members.
Name | Description | |
---|---|---|
EDDevice | Create a new EDDevice, connection needs to be set, protocol defaults to ASCIIProtocol | |
EDDevice(IConnection) | Create a new EDDevice, passing in the connection, protocol defaults to ASCIIProtocol | |
EDDevice(IConnection, IIOProtocol) | Create an EDDevice |
Name | Description | |
---|---|---|
AInputs | The devices analog input lines (if it has any) index by IOLineNumber e.g AOUT0, AOUT1, AOUT2 | |
AOutputs | The devices analog output lines (if it has any) indexed by IOLineNumber e.g AOUT0, AOUT1, AOUT2 | |
Connection |
The connection. If the connection is replaced and the previous connection was connected, the new connection will be connected too
(Inherited from DeviceConn, Proto) | |
Inputs | The devices input Lines (if it has any) indexed by IOLineNumber e.g. DOUT0, DOUT1, DOUT2 | |
IOLineCacheTimeout | The time between checking the state of the IO lines for event handling, defaults to 250 ms Also the stale period, when the cached value of the IO line has to be re-queried on the device | |
IOLines | IOLines indexed by their logical line number as described on the Brainboxes product label | |
IsAvailable |
Whether the connection to this Brainboxes Device is available, e.g. online or offline.
In case of network TCP connection: this is if the device is pingable on the network.
In case of serial connection: this is if the device COM port is listed on the system and not open by another process.
(Inherited from DeviceConn, Proto) | |
IsConnected |
Whether this Brainboxes Device instance has an active connection
(Inherited from DeviceConn, Proto) | |
Label |
User definable label for the Device to help identify when many devices / when debugging
(Inherited from DeviceConn, Proto) | |
Outputs | The devices output Lines (if it has any) indexed by IOLineNumber e.g. DOUT0, DOUT1, DOUT2 | |
Protocol |
Marking as virtual allows it to be overridden in the child class
(Inherited from DeviceConn, Proto) |
Name | Description | |
---|---|---|
Connect |
Connect to a Brainboxes Remote IO Device
(Overrides DeviceConn, ProtoConnect) | |
Create |
Supply a connection IP address or com port and the correct ED device will be created and returned
Example
using(EDDevice ed = EDDevice.Create("192.168.0.5"))
{
//the connection is opened automatically
ed.Output[0] = 1;
} //connection is closed and object disposed after using block
| |
Describe |
Give a complete summary of the EDDevice
(Overrides DeviceConn, ProtoDescribe) | |
Disconnect |
Disconnect from a Brainboxes Remote IO Device
(Overrides DeviceConn, ProtoDisconnect) | |
Dispose |
Dispose of this Brainboxes device
(Inherited from DeviceConn, Proto) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
FactoryReset | Factory resets the device, this can take some time as the current connection is broken and a new on has to be re-established the connection may not reconnect if the current IP address settings cannot be re-got be the device in default settings mode | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
Restart | Power Cycle the device this can take some time as the current connection is broken and a new on has to be re-established the function will block until the device is powered up and reconnected to | |
SendCommand | Send a command to the Brainboxes device using the supplied protocol. | |
SubscribeToDeltaEvent | Register an event with this handler to be notified when the state of an Analog line changes by larger than the limit specified | |
SubscribeToTargetEvent | Register an event with this handler to be notified when the state of an Analog input goes over the limit specified | |
SubscribeToTargetRangeEvent | Register an event with this handler to be notified when the state of an Analog line changes to be within the specified delta range of a specified target value and also when it changes to be outside of the specified delta range | |
ToString |
ToString
(Overrides DeviceConn, ProtoToString) | |
UnsubscribeToDeltaEvent | Unsubscribe a registered delta event with this handler to stop being notified when this event is triggered | |
UnsubscribeToTargetEvent | Unsubscribe a registered target event with this handler to stop being notified when this event is triggered | |
UnsubscribeToTargetRangeEvent | Unsubscribe a registered target range event with this handler to stop being notified when this event is triggered |
Name | Description | |
---|---|---|
DeviceStatusChangedEvent |
Event When the status of the devices connection changes
for example goes from Disconnected to Connected
or from Available to Unavailable
(Inherited from DeviceConn, Proto) | |
IOLineChanged | Register an event with this handler to be notified when the state of an input or output line changes | |
IOLineCount | Register an event with this handler to be notified when the state of an input changes increment the count of the IOLine | |
IOLineFallingEdge | Register an event with this handler to be notified when the state of an input or output line goes from 1 -> 0 / high to low / open to closed | |
IOLineRisingEdge | Register an event with this handler to be notified when the state of an input or output line goes from 0 -> 1 / low to high / closed to open | |
IOLinesChanged | Register an event with this handler to be notified when the state of one or more IOLines change within a polling interval This is useful when a state in the program is dependent on 2 or more ioLine states |