ola84

Modbus library for Siemens PLC's

1 post in this topic

Hi.

I would like to tell you about a modbus library I have made and recently released, for Siemens S7-1200 PLC's. I made concept that called Station block which is mapping of registers for one specific modbus rtu device. Station blocks can be made very quickly and can be easily be reused and combined with other station blocks. The library is free under the MIT-license and can be downloaded at github (link bellow). Please check it out, I would like to get some feedback on my work.

https://github.com/olab84/rexhip/

An modbus rtu example:
#mb_master_ctrl(hardware_id := "Local~CB_1241_(RS485)", 
                               baud := 19200, // bps                
                               mb_query := #mb_query ); 

#mb_query(mb_addr := #mb_addr,                  
                      mode := #mb_query.c.read.input_reg, 
                     data_addr := 13,                      
                     data_ptr := #resault_data_1);  

#mb_query(mb_addr := #mb_addr,                 
                     mode := #mb_query.c.write.holding_reg, 
                     data_addr := 55,                            
                     data_ptr := #resault_data_2);

// - The library will take care of execute each query, one by one. 
//    Add as many queries as need. (There no need of a state machine)
// - Queries belonging to one device can be placed inside one FB,
//   this FB can later easily be reused.

 
 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now