AFConnections.IsValidConnection Method (Boolean, Boolean, AFPort, AFPort, String)
- Last UpdatedSep 18, 2024
- PI System
- AF SDK 2024
- Developer
This method checks if a valid connection can be created between the
specified source and destination ports of an AFBaseElement.
Namespace: OSIsoft.AF.Modeling
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.0.1156
Syntax
public bool IsValidConnection( bool checkSourceMaxConnections, bool checkDestinationMaxConnections, AFPort sourcePort, AFPort destinationPort, out string errMsg )
Public Function IsValidConnection ( checkSourceMaxConnections As Boolean, checkDestinationMaxConnections As Boolean, sourcePort As AFPort, destinationPort As AFPort, <OutAttribute> ByRef errMsg As String ) As Boolean Dim instance As AFConnections Dim checkSourceMaxConnections As Boolean Dim checkDestinationMaxConnections As Boolean Dim sourcePort As AFPort Dim destinationPort As AFPort Dim errMsg As String Dim returnValue As Boolean returnValue = instance.IsValidConnection(checkSourceMaxConnections, checkDestinationMaxConnections, sourcePort, destinationPort, errMsg)
public: bool IsValidConnection( bool checkSourceMaxConnections, bool checkDestinationMaxConnections, AFPort^ sourcePort, AFPort^ destinationPort, [OutAttribute] String^% errMsg )
member IsValidConnection : checkSourceMaxConnections : bool * checkDestinationMaxConnections : bool * sourcePort : AFPort * destinationPort : AFPort * errMsg : string byref -> bool
Parameters
- checkSourceMaxConnections
- Type: System.Boolean
If true, check the source port to determine if the maximum number of connections will be exceeded. If false, this check will not be performed. You would not want to perform this check if you are attempting to check if the destination could be changed to a different port before removing the current connection. Normally this parameter should be set to true. - checkDestinationMaxConnections
- Type: System.Boolean
If true, check the destination port to determine if the maximum number of connections will be exceeded. If false, this check will not be performed. You would not want to perform this check if you are attempting to check if the source could be changed to a different port before removing the current connection. Normally this parameter should be set to true. - sourcePort
- Type: OSIsoft.AF.Modeling.AFPort
The source AFPort object of the connection. The port type must be either Output or Undirected. The port must be from an AFBaseElement, it cannot be from an AFElementTemplate. - destinationPort
- Type: OSIsoft.AF.Modeling.AFPort
The destination AFPort object of the connection. The port type must be either Input or Undirected. The port must be from an AFBaseElement, it cannot be from an AFElementTemplate. - errMsg
- Type: System.String
The returned error message if the connection is invalid.
Return Value
Type: BooleanReturns true if the connection is valid. If the connection is invalid, returns false and the errMsg parameter specifies the error message.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | This exception is thrown when the sourcePort parameter or the destinationPort parameter is null. |