Multiple instances of MI on the same PC, no matter launched directly or through ActiveX automation API, are allowed with one license.
1. Launched directly
1) If the first instance of MI is launched for the very first time, it will prompt the user to select default device and skin for the first instance.
2) If the second instance of MI is launched for the very first time, it will prompt the user to select default device and skin for the second instance.
....
2. Launched through ActiveX automation API
1) If the first instance of MI is launched for the very first time, it will prompt the user to select default device and skin for the first instance.
2) If the second instance of MI is launched for the very first time, it will prompt the user to select default device and skin for the second instance. The prompt will still show up for subsequent launch of the second instance. The latter is a bug and will be corrected in the next release.
In the next release, these prompts will be always disabled if MI is launched through ActiveX automation API. Configuration of default device and skin can be done through the launched MI HMI or by supplying the configuration file scins.cfg, scins1.cfg.......These configuration files can be configured through MI and obtained from MI's root directly.
ActiveX automation client sample codes can be found in MI's AutomationAPIs folder. Those sample codes will launch only one MI instance. The following shows the modified Visual Basic codes for the launching of two MI instances.
Dim TestMI As Object
Dim TestMI2 As Object
Private Sub Form_Load()
Dim y As Long
y = (ShowMainFrame.Top + ShowMainFrame.Height) / Screen.TwipsPerPixelY * 6 + 32
Set TestMI = CreateObject("MI.Automation")
Call TestMI.Unlock(63066, 31882, 55598, 6380)
Set TestMI2 = CreateObject("MI.Automation")
Call TestMI2.Unlock(63066, 31882, 55598, 6380)
Call TestAutomation.Move(0, 0, 1024 * Screen.TwipsPerPixelX, y * Screen.TwipsPerPixelY)
End Sub
Private Sub ShowMainFrame_Click()
Dim y As Long
y = (ShowMainFrame.Top + ShowMainFrame.Height) / Screen.TwipsPerPixelY * 6 + 32
Call TestMI.MoveWindow(WND_MAINFRAME, 0, y, 1023, 600 - 30 - y, 1)
Call TestMI.ShowWindow(WND_MAINFRAME, SW_SHOW)
Call TestMI2.MoveWindow(WND_MAINFRAME, 0, 600 - 30, 1023, 600 - 30 - y, 1)
Call TestMI2.ShowWindow(WND_MAINFRAME, SW_SHOW)
End Sub
The resulting screenshot is as follows:
- MultipleInstanceInActiveXAutomation.png (69.47 KiB) Viewed 77590 times