Controller.DigitalInFromName
Returns the index of the digital input whose name matches the one specified.
Version History
Introduced in MPX 2.0.
Result
UInt32
Arguments
|
Argument |
Type |
Description |
name |
String |
The name of the digital input. |
|
Common Exceptions
|
Error |
Occurs when... |
ObjectNotFound |
The digital input with the specified name could not be located. |
|
Visual Basic
Syntax
Function DigitalInFromName(name As String) As UInt32
Sample Code
|
Try Dim digitalInIndex As UInt32 = _ controller.DigitalInFromName("OPTO_A_IN")
Console.WriteLine("Digital Input with name OPTO_A_IN has index {0}", _
digitalInIndex)
Catch ex As mpx.Exception Console.WriteLine("No Digital Input with name OPTO_A_IN") End Try
|
Sample Application
C#
Syntax
UInt32 DigitalInFromName(string name);
Sample Code
|
try { UInt32 digitalInIndex = controller.DigitalInFromName("OPTO_A_IN"); Console.WriteLine("Digital Input with name OPTO_A_IN has index {0}",
digitalInIndex); } catch (Mpx.Exception) { Console.WriteLine("No Digital Input with name OPTO_A_IN"); }
|
See Also
|