TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
Modbus-Anwendungen entwickeln …

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> IGW/922
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 01.11.2012, 10:20    Post subject: Modbus-Anwendungen entwickeln … Reply with quote

Hallo Forum.

In vielen Anwendungen wird das IGW/922 als Modbus-Master eingesetzt. Den Slave bildet dann eine Steuerung oder I/O-Bausteine (zum Beispiel Baugruppen aus dem WAGO I/O System).

Um die Entwicklung eigener Systemlösungen zu vereinfachen, ist mit Modpoll ein Modbus Master Simulator verfügbar, der sowohl Modbus RTU als auch Modbus TCP unterstützt.

Modpoll wird innerhalb einer Telnet-Session von der Kommandozeile gestartet. Es existiert ein umfangreicher Parameter-Vorrat:

Code:
Usage: modpoll [options] serialport|host
Arguments:
serialport    Serial port when using Modbus ASCII or Modbus RTU protocol
              COM1, COM2 ...                on Windows
              /dev/ttyS0, /dev/ttyS1 ...    on Linux
              /dev/ser1, /dev/ser2 ...      on QNX
host          Host name or dotted ip address when using MODBUS/TCP protocol
General options:
-m ascii      Modbus ASCII protocol
-m rtu        Modbus RTU protocol (default)
-m tcp        MODBUS/TCP protocol
-m enc        Encapsulated Modbus RTU over TCP
-a #          Slave address (1-255, 1 is default)
-r #          Start reference (1-65536, 100 is default)
-c #          Number of values to poll (1-100, 1 is default)
-t 0          Discrete output (coil) data type
-t 1          Discrete input data type
-t 3          16-bit input register data type
-t 3:hex      16-bit input register data type with hex display
-t 3:int      32-bit integer data type in input register table
-t 3:mod      32-bit module 10000 data type in input register table
-t 3:float    32-bit float data type in input register table
-t 4          16-bit output (holding) register data type (default)
-t 4:hex      16-bit output (holding) register data type with hex display
-t 4:int      32-bit integer data type in output (holding) register table
-t 4:mod      32-bit module 10000 type in output (holding) register table
-t 4:float    32-bit float data type in output (holding) register table
-i            Slave operates on big-endian 32-bit integers
-f            Slave operates on big-endian 32-bit floats
-1            Poll only once, otherwise poll every second
-e            Use Daniel/Enron single register 32-bit mode
-0            First reference is 0 (PDU addressing) instead 1
Options for MODBUS/TCP:
-p #          TCP port number (502 is default)
Options for Modbus ASCII and Modbus RTU:
-b #          Baudrate (e.g. 9600, 19200, ...) (9600 is default)
-d #          Databits (7 or 8 for ASCII protocol, 8 for RTU)
-s #          Stopbits (1 or 2, 1 is default)
-p none       No parity
-p even       Even parity (default)
-p odd        Odd parity
-4 #          RS-485 mode, RTS on while transmitting and another # ms after
-o #          Time-out in seconds (0.01 - 10.0, 1.0 s is default)


Wenn Sie einen Modbus-Slave mit der RS485-Schnittstelle des IGW/922 verbunden haben oder sichergestellt wurde, dass sich ein solcher Slave in einem LAN befindet, auf das ein IGW/922 per LAN1 oder LAN2 zugreifen kann, können Sie Modpoll als Modbus Master Simulator nutzen.

Wir gehen hier einmal davon aus, dass ein Modbus-TCP-Slave mit dem IGW/922 verbunden ist und das dieser Slave die IP-Adresse 192.168.0.1 besitzt. Durch die Eingabe:

Code:
./modpoll –c 5 –r 100 –m tcp 192.168.0.1


starten Sie Abfrage der Register 100 – 104 (-c 5 = Frage fünf Register ab, -r 100 = Beginne mit der Adresse 100) des Modbus-TCP-Slave (-m TCP = Modbus TCP).

Gruß

KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 21.12.2012, 17:01    Post subject: Modbus-RTU … Reply with quote

Hallo Forum.

Bei einem Modbus-RTU-Slave, der zum Beispiel mit 57.600 Baud und No Parity funktioniert, würde die Modpoll-Kommandozeile wie folgt aussehen:

Code:
./modpoll –c 5 –r 100 –m rtu /dev/ttyR1 –b 57600 –p none


“ /dev/ttyR1” ist in diesem Fall der Name der COM2-RS485-Schnittstelle des IGW/922.

Gruß KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 29.06.2013, 15:37    Post subject: Modbus Slave Simulator … Reply with quote

Hallo Forum.

In vielen Anwendungen muss für ein IGW/922 ein spezieller Modbus Master entwickelt werden. Als Gegenstück ist dann ein geeigneter Modbus Slave Simulator recht hilfreich. Sehr empfehlenswert ist hier Ananas für Windows PCs, den man unter http://www.tuomio.fi/ananas/index.htm kostenlos laden kann.

Ananas unterstützt Modbus Holding Register und Modbus Input Register. Die Umschaltung erfolgt über entsprechend gekennzeichnete Schaltflächen. Durch die Eingabe:

Code:
./modpoll –c 5 –r 100 –m tcp 192.168.0.1


werden die Modbus Holding Register ausgelesen. Um auf die Modbus Input Register zuzugreifen, ist –t 3 als zusätzlicher Parameter erforderlich.

Code:
./modpoll –c 5 –r 100 –t 3 –m tcp 192.168.0.1


Gruß KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 17.08.2013, 07:57    Post subject: Modbus per Python … Reply with quote

Hallo Forum.

Für das IGW/922 steht auch eine Python-Laufzeitumgebung mit Modbus-Erweiterungen zur Verfügung. Dadurch lassen sich Modbus-Aufgaben auch in Python lösen. Ein Modbus-Master könnte dann wie folgt aussehen:

Code:
import time
import modbus_tk
import modbus_tk.defines as cst
import modbus_tk.modbus_tcp as modbus_tcp

master = modbus_tcp.TcpMaster("192.168.2.142", 502)
master.set_timeout(5.0)
while True:
    a = master.execute(1, cst.READ_INPUT_REGISTERS, 0, 4)
    print "a[0]= ", a[0]
    print "a[1]= ", a[1]
    print "a[2]= ", a[2]
    print "a[3]= ", a[3]   
    time.sleep(1)


Der Master verbindet sich per Modbus-TCP mit einem Slave 192.168.2.142 (zum Beispiel dem Modbus Slave Simulator Ananas auf einem PC) und fragt alle 0,5 Sekunden vier Input-Register ab. Die aktuellen Werte der Register werden ausgegeben.

Gruß KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 18.01.2016, 18:22    Post subject: Modbus ohne Programmierung … Reply with quote

Hallo Forum.

Mit einem IGW/936 lassen sich nun Modbus-Anwendungen realisieren, indem in einer webbasierten Oberfläche visuelle Objekte zusammengefügt werden. Siehe

http://www.ssv-comm.de/forum/viewtopic.php?t=1272

Gruß KDW
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> IGW/922 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015