Difference between revisions of "Modbus Handler Service+ EIServiceSDK"

From ESS-WIKI
Jump to: navigation, search
Line 1: Line 1:
SNTest.exe is a demo program to show how to use EIService SDK API to do a Modbus data read action from Modbus register or data write action to the register.
+
<font face="Droid Sans, sans-serif"><font size="6">Overview</font></font>
  
&nbsp;
 
  
1. Start ModSim32 and configure the register for the demonstration:
 
  
*Set Holding Register data address: 0001 (From first Holding Register address)
+
<font face="Droid Sans, sans-serif"><font size="3">SNTest.exe is a demo program to show how to use EIService SDK API to do a Modbus data read action from Modbus register or data write action to the register.</font></font>
*Set Length: 8
 
*Set data from address 40001 ~ 40008, for example 101, 102 , 103 …
 
  
  
  
&nbsp;&nbsp;[[File:Modsim32 01.png|center|baseline|720x400px|Modsim32 01.png]]
 
  
  
  
2. Enable Modbus Plugin with below settings for the demonstrations:
 
  
'''[Platform]'''
+
<font face="Droid Sans, sans-serif"><font size="6">Modbus Simulator</font></font>
  
'''Name=WISE-4012E'''
 
  
'''Protocol=Modbus_TCP'''
 
  
'''ClientIP=127.0.0.1'''
+
<font face="Droid Sans, sans-serif"><font size="3">Start ModSim32 and configure the register for the demonstration:</font></font>
  
'''ClientPort=502'''
 
  
'''UnitID=1'''
 
  
'''Interval=1'''
+
*
 +
<font face="Droid Sans, sans-serif"><font size="3">Set Holding Register data address: 0001 (From first Holding Register address)</font></font>
  
'''#Interval: The time delay between two modbus access round in second.'''
+
*
 +
<font face="Droid Sans, sans-serif"><font size="3">Set Length: 8</font></font>
  
'''Delay=0'''
+
*
 +
<font face="Droid Sans, sans-serif"><font size="3">Set data from address 40001 ~ 40008, for example 101, 102 , 103 …</font></font>
  
'''#Delay: The time delay between two modbus access in millisecond.'''
+
#
  
'''#Delay=0 means no delay.'''
+
<ol start="0">
 +
</ol></ol>
  
'''Log=0'''
+
[[File:|720x406px]]
  
&nbsp;
 
  
'''[Holding Registers]'''
 
  
'''numberOfR=3'''
 
  
'''R0=0,Data0,-1000000,1000000,1,V,0,""'''
 
  
'''R1=1,Data1,-1000000,1000000,1,V,0,""'''
 
  
'''R2=2,Data2,-1000000,1000000,1,V,0,""'''
 
  
&nbsp;
 
  
''';tag = offset, name, min, max, precision, unit, data type, lua script'''
 
  
&nbsp;
+
<font face="Droid Sans, sans-serif"><font size="6">WISE Agent and Modbus Plugin</font></font>
  
3. Run SNTest.exe and select 5) Set Service’s Action.
 
  
  
 +
<font face="Droid Sans, sans-serif"><font size="3">Configure Modbus Plugin settings (Modbus_Handler.ini) as showed below for the demonstrations:</font></font>
  
&nbsp;
 
  
&nbsp;
+
<ol start="0">
 +
</ol>
  
4. To do a data Write Demonstration, please set the Service Name, Plugin Name, Sensor Name, Data Type and the value of Data that you want to write.
+
<font face="Droid Sans, sans-serif"><font size="3">'''[Platform]'''</font></font>
  
&nbsp; &nbsp; For example:
+
<font face="Droid Sans, sans-serif"><font size="3">'''Name=WISE-4012E'''</font></font>
  
Service Name: Modbus_Handler
+
<font face="Droid Sans, sans-serif"><font size="3">'''Protocol=Modbus_TCP'''</font></font>
  
Plugin Name: Modbus_Handler
+
<font face="Droid Sans, sans-serif"><font size="3">'''ClientIP=127.0.0.1'''</font></font>
  
Sensor Name: Modbus_Handler/Holding Registers/Data0
+
<font face="Droid Sans, sans-serif"><font size="3">'''ClientPort=502'''</font></font>
  
Data Type: v
+
<font face="Droid Sans, sans-serif"><font size="3">'''UnitID=1'''</font></font>
  
Data: 66
+
<font face="Droid Sans, sans-serif"><font size="3">'''Interval=1'''</font></font>
  
&nbsp;
+
<font face="Droid Sans, sans-serif"><font size="3">'''#Interval: The time delay between two modbus access round in second.'''</font></font>
  
&nbsp; &nbsp; After completed the procedure, the numbers will be written into assigned variable by EIService SDK function.
+
<font face="Droid Sans, sans-serif"><font size="3">'''Delay=0'''</font></font>
  
&nbsp;
+
<font face="Droid Sans, sans-serif"><font size="3">'''#Delay: The time delay between two modbus access in millisecond.'''</font></font>
  
 +
<font face="Droid Sans, sans-serif"><font size="3">'''#Delay=0 means no delay.'''</font></font>
  
 +
<font face="Droid Sans, sans-serif"><font size="3">'''Log=0'''</font></font>
  
&nbsp;&nbsp;
 
  
5. You can check ModSim32 screen to confirm the procedure of data write.
 
  
&nbsp;
+
<font face="Droid Sans, sans-serif"><font size="3">'''[Holding Registers]'''</font></font>
  
 +
<font face="Droid Sans, sans-serif"><font size="3">'''numberOfR=3'''</font></font>
  
 +
<font face="Droid Sans, sans-serif"><font size="3">'''R0=0,Data0,-1000000,1000000,1,V,0,""'''</font></font>
  
&nbsp;
+
<font face="Droid Sans, sans-serif"><font size="3">'''R1=1,Data1,-1000000,1000000,1,V,0,""'''</font></font>
  
(End)
+
<font face="Droid Sans, sans-serif"><font size="3">'''R2=2,Data2,-1000000,1000000,1,V,0,""'''</font></font>
 +
 
 +
 
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">''';tag = offset, name, min, max, precision, unit, data type, lua script'''</font></font>
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="6">Demo Program</font></font>
 +
 
 +
 
 +
 
 +
#
 +
<font face="Droid Sans, sans-serif"><font size="3">Run SNTest.exe and select item 5) Set Service’s Action.</font></font>
 +
 
 +
 
 +
 
 +
[[File:|714x444px]]
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
<ol start="2">
 +
<li>
 +
<font face="Droid Sans, sans-serif"><font size="3">To do a data Write Demonstration, please set the Service Name, Plugin Name, Sensor Name, Data Type and the value of Data that you want to write, for example</font></font>
 +
</li>
 +
</ol>
 +
 
 +
 
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">'''Service Name: Modbus_Handler'''</font></font>
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">'''Plugin Name: Modbus_Handler'''</font></font>
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">'''Sensor Name: Modbus_Handler/Holding Registers/Data0'''</font></font>
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">'''Data Type: v'''</font></font>
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">'''Data: 66'''</font></font>
 +
 
 +
 
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">After completed the procedure, the numbers will be written into assigned variable by EIService SDK function.</font></font>
 +
 
 +
 
 +
 
 +
[[File:|812x465px]]
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
<ol start="3">
 +
<li>
 +
<font face="Droid Sans, sans-serif"><font size="3">You can check ModSim32 screen to confirm the procedure of data write.</font></font>
 +
</li>
 +
</ol>
 +
 
 +
 
 +
 
 +
[[File:|683x463px]]
 +
 
 +
 
 +
 
 +
<font face="Droid Sans, sans-serif"><font size="3">(End)</font></font>

Revision as of 06:47, 28 December 2017

Overview


SNTest.exe is a demo program to show how to use EIService SDK API to do a Modbus data read action from Modbus register or data write action to the register.




Modbus Simulator


Start ModSim32 and configure the register for the demonstration:


Set Holding Register data address: 0001 (From first Holding Register address)

Set Length: 8

Set data from address 40001 ~ 40008, for example 101, 102 , 103 …

</ol>

[[File:|720x406px]]





WISE Agent and Modbus Plugin


Configure Modbus Plugin settings (Modbus_Handler.ini) as showed below for the demonstrations:


[Platform]

Name=WISE-4012E

Protocol=Modbus_TCP

ClientIP=127.0.0.1

ClientPort=502

UnitID=1

Interval=1

#Interval: The time delay between two modbus access round in second.

Delay=0

#Delay: The time delay between two modbus access in millisecond.

#Delay=0 means no delay.

Log=0


[Holding Registers]

numberOfR=3

R0=0,Data0,-1000000,1000000,1,V,0,""

R1=1,Data1,-1000000,1000000,1,V,0,""

R2=2,Data2,-1000000,1000000,1,V,0,""


;tag = offset, name, min, max, precision, unit, data type, lua script




Demo Program


Run SNTest.exe and select item 5) Set Service’s Action.


[[File:|714x444px]]




  1. To do a data Write Demonstration, please set the Service Name, Plugin Name, Sensor Name, Data Type and the value of Data that you want to write, for example


Service Name: Modbus_Handler

Plugin Name: Modbus_Handler

Sensor Name: Modbus_Handler/Holding Registers/Data0

Data Type: v

Data: 66


After completed the procedure, the numbers will be written into assigned variable by EIService SDK function.


[[File:|812x465px]]




  1. You can check ModSim32 screen to confirm the procedure of data write.


[[File:|683x463px]]


(End)