Quantcast
Channel: Siemens Latest Topics
Viewing all articles
Browse latest Browse all 698

Modbus library for Siemens PLC's

$
0
0

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.

 
 

 


Viewing all articles
Browse latest Browse all 698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>