ReadWriteNetHelperWait 方法 (IReadWriteNet, String, Boolean, Int32, Int32) |
等待指定地址的Boolean值为指定的值,可以指定刷新数据的频率,等待的超时时间,如果超时时间为-1的话,则是无期限等待。
Waiting for the Boolean value of the specified address to be the specified value, you can specify the frequency of refreshing the data,
and the timeout time to wait. If the timeout time is -1, it is an indefinite wait.
命名空间:
HslCommunication.Core.Net
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static OperateResult<TimeSpan> Wait(
IReadWriteNet readWriteNet,
string address,
bool waitValue,
int readInterval,
int waitTimeout
)
Public Shared Function Wait (
readWriteNet As IReadWriteNet,
address As String,
waitValue As Boolean,
readInterval As Integer,
waitTimeout As Integer
) As OperateResult(Of TimeSpan)
public:
static OperateResult<TimeSpan>^ Wait(
IReadWriteNet^ readWriteNet,
String^ address,
bool waitValue,
int readInterval,
int waitTimeout
)
static member Wait :
readWriteNet : IReadWriteNet *
address : string *
waitValue : bool *
readInterval : int *
waitTimeout : int -> OperateResult<TimeSpan>
参数
- readWriteNet
- 类型:HslCommunication.CoreIReadWriteNet
通信对象 - address
- 类型:SystemString
其实地址 - waitValue
- 类型:SystemBoolean
等待检测是值 - readInterval
- 类型:SystemInt32
读取的频率 - waitTimeout
- 类型:SystemInt32
等待的超时时间,如果超时时间为-1的话,则是无期限等待。
返回值
类型:
OperateResultTimeSpan是否等待成功的结果对象,一旦通信失败,或是等待超时就返回失败。否则返回成功,并告知调用方等待了多久。
参见