|
Description |
Sets or returns the Time To Live timeout period (in milliseconds) for the control to get a response from an Ethernet connection |
|
VB 6.0 |
[ form ]. ABCTL TimeOut [ = timeout% ] |
|
VC++ |
short ABCTL.GetTimeOut( void ); |
|
|
void ABCTL.SetTimeOut ( short size ); |
|
VB .NET |
AxABCTL.TimeOut [ = timeout as System.Int16 ] |
|
Remarks |
This property determines how long the control will wait for a response from an Ethernet processor after the . Trigger command is invoked. NOTE: This property setting has changed from prior versions of ABCTL.OCX. In versions prior to Studio 5.2 the .TimeOut property was in seconds. When upgrading applications developer with older versions of ABCTL.OCX, you will need to increase the .TimeOut property, or Winsock error 10057 will occur |
|
VB 6.0 Example |
Sub Command1_Click() Sub ABCTL1_OnErrorEvent (nErrorCode as Integer) |
|
VC Example |
void MyCWndClass:: OnBtnClick() |
|
VB .NET Example |
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click AxABCTL1.Adapter = 0 ' * use adapter 0 AxABCTL1.Host = "192.168.1.31" ‘ * PLC IP Address AxABCTL1.TimeOut = 1000 ‘ * 1000ms timeout AxABCTL1.Function = 0 ' * read PLC AxABCTL1.FileAddr = "N7:0" ' * starting at N7:0 AxABCTL1.CtlSize = 10 ' * for 10 data points AxABCTL1.Trigger() ' * tell control to get the data End Sub
Private Sub AxABCTL1_OnErrorEvent(ByVal sender As Object, ByVal e As AxABCTLLib._DABCTLEvents_OnErrorEventEvent) Handles AxABCTL1.OnErrorEvent
Dim nErrorCode As System.Int16 nErrorCode = AxABCTL1.ErrorCode If nErrorCode = 10057 then Text1.Text = "Ethernet PLC " & AxABCTL1.Host & " Timed Out" End if End Sub |
|
Date Type |
Integer (16-Bit) |
|
Also See |