ServerInstance屬性
描述
指定Epson RC+伺服器要使用的執行個體。
語法
Property ServerInstance As Integer
預設值
預設值為下一個可用的伺服器執行個體。
備註
API與RC+ 伺服器進程通信。ServerInstance指定要使用的伺服器。每個伺服器實例對應一個控制器和一個專案。預設情況下,創建新Spel類實例時,ServerInstance將自動設置為"1"。
當您想要對同一控制器 (如應用程式的多線程)使用多個Spel類實例,請為使用同一控制器的每個Spel類實例設置ServerInstance屬性。
ServerInstance 必須介於1和10之間,並且必須在初始化或執行其他方法之前進行設置。
另請參閱
CommandTask屬性, Initialize方法
ServerInstance範例
VB 例:
' Controller 1
spel1 = New Spel
spel1.ServerInstance = 1
spel1.Initialize()
spel1.Connect(1)
' Controller 2
spel2 = New Spel
spel2.ServerInstance = 2
spel2.Initialize()
spel2.Connect(2)
C# 例:
// Controller 1
RCAPINet.Spel spel1 = new RCAPINet.Spel();
spel1.ServerInstance = 1;
spel1.Initialize();
spel1.Connect(1);
// Controller 2
RCAPINet.Spel spel2 = new RCAPINet.Spel();
spel2.ServerInstance = 2;
spel2.Initialize();
spel2.Connect(2);