<< Click to Display Table of Contents >> Manual > Server Creation Guide > Interface > IPLink-Interface > IPLinkClient Library > IPLinkClient Library Sample Collection > How to use it on multiple forms |
overview
The IPLink server can be connected simultaneously from multiple IPLink clients. In this sample, multiple forms in the same project are connected simultaneously.
If you want to communicate from multiple forms, paste the "IPLink" control on each form. When you close the form, the communication will be automatically disconnected and the tag registered to the server will be removed. Just as you can create multiple forms in one project, you can also communicate from multiple projects at the same time.
FormMain |
Form1 |
Form2 |
Form3 |
Download the sample
The creation examples shown on this page are provided with samples.
The sample can be downloaded from below.
Samples and detailed explanations will be provided in VB.NET2010.
Program Highlights
We will explain the main points of the program.
▪Connection status/value changes
The connection state is obtained from the StateChanged event, and value changes are obtained from the ValueChanged event.
'------------------------------------------ ' Event - StateChanged '------------------------------------------ Private Sub AxIPLink1_StateChanged(sender As Object, e As AxIPLINKLib6._DClientIPLinkEvents_StateChangedEvent) Handles AxIPLink1.StateChanged txtState.Text = CStr(e.state) End Sub '------------------------------------------ ' Event - ValueChanged '------------------------------------------ Private Sub AxIPLink1_ValueChanged(sender As Object, e As AxIPLINKLib6._DClientIPLinkEvents_ValueChangedEvent) Handles AxIPLink1.ValueChanged txtVal(Integer.Parse(e.tagPath.Substring(e.tagPath.Length - 2))).Text = CStr(e.value) End Sub
Operation check
1.Running the Application
After going online, run the Visual Basic application. Now, make sure all the lights are black.
2.Display of "Form1"
Press the "Form1" button to display the screen. Form1 is displayed, and confirm that the values are displayed on the screen. At this time, confirm that the lamps "T00" to "T09" turn red, and the lamps "T10" to "T29" remain black.
3.Close "Form1"
Close "Form1" and confirm that all the lights turn black. This means that closing "Form1" has cut the connection and unregistered the tags (communication between the server and the PLC will also stop).
4.Show all forms
Press the "Form1", "Form2", and "Form3" buttons to display all the screens. When the screens are displayed, check that all the lights are red.