Difference between revisions of "Modbus Handler Service+ EIServiceSDK"

From ESS-WIKI
Jump to: navigation, search
(Created page with "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.   #Start Mo...")
 
Line 3: Line 3:
 
 
 
 
  
#Start ModSim32 and configure the register for the demonstration:
+
1. 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 …
 
  
 +
*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 …
  
  
 
 
  
 
+
  [[File:Modsim32 01.png|center|baseline|720x400px]]
 +
 
  
#Enable Modbus Plugin with below settings for the demonstrations:
 
  
 
+
2. Enable Modbus Plugin with below settings for the demonstrations:
  
'''[Platform]'''
+
[Platform]
  
'''Name=WISE-4012E'''
+
Name=WISE-4012E
  
'''Protocol=Modbus_TCP'''
+
Protocol=Modbus_TCP
  
'''ClientIP=127.0.0.1'''
+
ClientIP=127.0.0.1
  
'''ClientPort=502'''
+
ClientPort=502
  
'''UnitID=1'''
+
UnitID=1
  
'''Interval=1'''
+
Interval=1
  
'''#Interval: The time delay between two modbus access round in second.'''
+
#Interval: The time delay between two modbus access round in second.
  
'''Delay=0'''
+
Delay=0
  
'''#Delay: The time delay between two modbus access in millisecond.'''
+
#Delay: The time delay between two modbus access in millisecond.
  
'''#Delay=0 means no delay.'''
+
#Delay=0 means no delay.
  
'''Log=0'''
+
Log=0
  
 
 
  
'''[Holding Registers]'''
 
  
'''numberOfR=3'''
+
[Holding Registers]
  
'''R0=0,Data0,-1000000,1000000,1,V,0,""'''
+
numberOfR=3
  
'''R1=1,Data1,-1000000,1000000,1,V,0,""'''
+
R0=0,Data0,-1000000,1000000,1,V,0,""
  
'''R2=2,Data2,-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'''
+
;tag = offset, name, min, max, precision, unit, data type, lua script
  
 
 
 
 
Line 62: Line 59:
 
 
 
 
  
#Run SNTest.exe and select 5) Set Service’s Action.
+
3. Run SNTest.exe and select 5) Set Service’s Action.
  
  
Line 70: Line 67:
 
 
 
 
  
#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
+
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.
  
 
+
    For example:
  
'''Service Name: Modbus_Handler'''
+
Service Name: Modbus_Handler
  
'''Plugin Name: Modbus_Handler'''
+
Plugin Name: Modbus_Handler
  
'''Sensor Name: Modbus_Handler/Holding Registers/Data0'''
+
Sensor Name: Modbus_Handler/Holding Registers/Data0
  
'''Data Type: v'''
+
Data Type: v
  
'''Data: 66'''
+
Data: 66
  
 
 
 
 
  
after completed the procedure, the numbers will be written into assigned variable by EIService SDK function.
+
    After completed the procedure, the numbers will be written into assigned variable by EIService SDK function.
  
 
 
 
 
Line 92: Line 89:
  
  
 
+
  
 
 
 
 
  
#You can check ModSim32 screen to confirm the procedure of data write.
+
5. You can check ModSim32 screen to confirm the procedure of data write.
  
 
 
 
 

Revision as of 04:29, 28 December 2017

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.

 

1. 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 …


  
Modsim32 01.png


2. Enable Modbus Plugin with below settings for the demonstrations:

[Platform]

Name=WISE-4012E

Protocol=Modbus_TCP

ClientIP=127.0.0.1

ClientPort=502

UnitID=1

Interval=1

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

Delay=0

  1. Delay: The time delay between two modbus access in millisecond.
  1. 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

 

 

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


 

 

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.

    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.

 


  

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

 


 

(End)