Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| 
                    becki:linux:modbus [2010-11-19 11:44] becki  | 
                
                    becki:linux:modbus [2013-06-13 13:56] (aktuell) becki  | 
            ||
|---|---|---|---|
| Zeile 5: | Zeile 5: | ||
| ===== Modbus Command Overview == | ===== Modbus Command Overview == | ||
| - | ^ Code ^ Bits ^ Target ^ Count ^ Direction ^ Name in Spec ^ libmodbus Function Name ^ | + | ^ Code ^ Target ^ Count ^ Direction ^ Name in Spec ^ Libmodbus 3 fkt name ^ libmodbus 2 fkt name ^ | 
| - | | 01 |  1 | DO | many | read | Read Coils | ''read_coil_status''  | | + | | ''01 0x01'' | DO | many | read | Read Coils | ''modbus_read_bits''  | ''read_coil_status''  | | 
| - | | 02 |  1 | DI | many | read | Read Discrete Inputs  | ''read_input_status''  | | + | | ''02 0x02'' | DI | many | read | Read Discrete Inputs  | ''modbus_read_input_bits''  | ''read_input_status''  | | 
| - | | 03 |  16 | AO | many | read | Read Holding Registers  | ''read_holding_registers''  | | + | | ''03 0x03'' | AO | many | read | Read Holding Registers  | ''modbus_read_registers''  | ''read_holding_registers''  | | 
| - | | 04 |  16 | AI | many | read | Read Input Register  | ''read_input_registers''  | | + | | ''04 0x04'' | AI | many | read | Read Input Register  | ''modbus_read_input_registers''  | ''read_input_registers''  | | 
| - | | 05 |  1 | DO | one |  write | Write Single Coil | ''force_single_coil''  | | + | | ''05 0x05'' | DO | one |  write | Write Single Coil | ''modbus_write_bit''  | ''force_single_coil''  | | 
| - | | 06 |  16 | AO | one |  write | Write Single Register  | ''preset_single_register''  | | + | | ''06 0x06'' | AO | one |  write | Write Single Register  | ''modbus_write_register''  | ''preset_single_register''  | | 
| - | | 15 |  1 | DO | many | write | Write Multiple Coils | ''force_multiple_coils''  | | + | | ''15 0x0f'' | DO | many | write | Write Multiple Coils | ''modbus_write_bits''  | ''force_multiple_coils''  | | 
| - | | 16 |  16 | AO | many | write | Write Multiple registers | ''preset_multiple_registers'' | | + | | ''16 0x10'' | AO | many | write | Write Multiple registers  | ''modbus_write_registers''  | ''preset_multiple_registers'' | | 
| + | | ''23 0x17'' | AI/AO | many | both | Wrt/Rd Multiple registers | ''modbus_write_and_read_registers'' | :?: | | ||
| - | [[http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf|Source]] | + | Sources [[http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf|Spec]] [[http://libmodbus.org/site_media/html/libmodbus.html|Manpage]] | 
| More information sources: | More information sources: | ||
| Zeile 52: | Zeile 53: | ||
| ===== Libmodbus == | ===== Libmodbus == | ||
| + | ==== Usage / Doc == | ||
| + | |||
| + | See http://libmodbus.org/site_media/html/libmodbus.html | ||
| + | |||
| ==== Installation == | ==== Installation == | ||
| + | |||
| + | Download the [[http://github.com/downloads/stephane/libmodbus/libmodbus-3.0.2.tar.gz|source]] and use the [[http://think-deep.com/becki/slackbuilds/pack.php?n=libmodbus|Slack build script]]. | ||
| + | |||
| + | <note warning>The rest of this section is obsolete</note> | ||
| Note: You could get the latest devel release with ''git clone http://github.com/stephane/libmodbus.git'', but this has no ''configure'' script, so we use the lataest stable release instead. | Note: You could get the latest devel release with ''git clone http://github.com/stephane/libmodbus.git'', but this has no ''configure'' script, so we use the lataest stable release instead. | ||
| Zeile 81: | Zeile 90: | ||
| include/modbus/modbus.h | include/modbus/modbus.h | ||
| - | Then do ''ldconfig'' to update the library system info. | + | Then do ''ldconfig'' to update the library system info. |