Supply a connection IP address or com port and the correct ED device will be created and returned
Examples
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
Namespace:
Brainboxes.IO
Assembly:
Brainboxes.IO (in Brainboxes.IO.dll) Version: 1.5.0.8
Syntaxpublic static EDDevice Create(
string ipAddressOrComPort,
int portOrBaudRate = 0,
int timeout = 2000
)
Public Shared Function Create (
ipAddressOrComPort As String,
Optional portOrBaudRate As Integer = 0,
Optional timeout As Integer = 2000
) As EDDevice
static member Create :
ipAddressOrComPort : string *
?portOrBaudRate : int *
?timeout : int
(* Defaults:
let _portOrBaudRate = defaultArg portOrBaudRate 0
let _timeout = defaultArg timeout 2000
*)
-> EDDevice
Parameters
- ipAddressOrComPort
- Type: SystemString
either an IP address e.g. "192.168.0.1" or a com port name e.g. "COM3" - portOrBaudRate (Optional)
- Type: SystemInt32
optional either the IP port number e.g. 9500 or the com port baud rate e.g. 115200, if port not supplied it will be figured out by querying the device - timeout (Optional)
- Type: SystemInt32
The connection timeout
Return Value
Type:
EDDevice[Missing <returns> documentation for "M:Brainboxes.IO.EDDevice.Create(System.String,System.Int32,System.Int32)"]
See Also