module:python:udpclientserver:udpclientserver02v03
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
module:python:udpclientserver:udpclientserver02v03 [2021/12/13 19:59] – [Single PC: Aufruf mit Übergabe-Parametern] omdevelop | module:python:udpclientserver:udpclientserver02v03 [2022/09/13 11:58] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 10: | Line 10: | ||
===== Benutzung ===== | ===== Benutzung ===== | ||
- | + | PC-Python-Software: | |
- | **...py** | + | {{: |
- | < | + | |
- | </ | + | |
- | + | ||
- | **...py** | + | |
- | < | + | |
- | </ | + | |
- | + | ||
- | **...py** | + | |
- | < | + | |
- | </ | + | |
- | + | ||
- | **...py** | + | |
- | < | + | |
- | </ | + | |
- | ==== Single PC: Aufruf an alle UdpReceiver ==== | ||
- | * Sendung an alle IPAddresses[192.168.178.255] (auch an sich selbst!) | ||
- | * Rx-Port[4321] und Tx-Port[4321] identisch | ||
- | <code python> | ||
- | >python UdpClientServer.py Windows 4321 192.168.178.255 4321 | ||
- | *** UdpClientServer: | ||
- | Windows: TxIP-Address[192.168.178.255]-Port[4321] | ||
- | Windows: RxIP(local)-Address[192.168.178.33]-Port[4321] | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | *** UdpClientServer: | ||
- | </ | ||
- | |||
- | ==== Dual PC: ==== | ||
- | === WindowPC[192.168.178.33] === | ||
- | <code python> | ||
- | >python CheckUdpClientServer.py Windows 5001 192.168.178.48 5000 | ||
- | *** CheckUdpClientServer: | ||
- | Windows: TxIP-Address[192.168.178.48]-Port[5000] | ||
- | Windows: RxIP(local)-Address[192.168.178.33]-Port[5001] | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | CBOnRxData[Windows]< | ||
- | CBOnTxData[Windows]< | ||
- | *** CheckUdpClientServer: | ||
- | </ | ||
- | |||
- | === UbuntuPC[192.168.178.48] === | ||
- | <code python> | ||
- | >python CheckUdpClientServer.py Ubuntu | ||
- | *** CheckUdpClientServer: | ||
- | Ubuntu: TxIP-Address[192.168.178.33]-Port[5001] | ||
- | Ubuntu: RxIP(local)-Address[192.168.178.48]-Port[5000] | ||
- | CBOnTxData[Ubuntu]< | ||
- | CBOnTxData[Ubuntu]< | ||
- | CBOnRxData[Ubuntu]< | ||
- | CBOnTxData[Ubuntu]< | ||
- | CBOnRxData[Ubuntu]< | ||
- | CBOnRxData[Ubuntu]< | ||
- | CBOnTxData[Ubuntu]< | ||
- | CBOnRxData[Ubuntu]< | ||
- | CBOnTxData[Ubuntu]< | ||
- | CBOnRxData[Ubuntu]< | ||
- | CBOnTxData[Ubuntu]< | ||
- | *** CheckUdpClientServer: | ||
- | </ | ||
===== Hauptprogramm: | ===== Hauptprogramm: | ||
Line 95: | Line 23: | ||
# WindowsPC[192.168.178.33] <-> # WindowsPC[192.168.178.33]: | # WindowsPC[192.168.178.33] <-> # WindowsPC[192.168.178.33]: | ||
# WinPC: python CheckUdpClientServer.py Windows 4321 192.168.178.33 4321 | # WinPC: python CheckUdpClientServer.py Windows 4321 192.168.178.33 4321 | ||
- | # | + | |
# WindowsPC[192.168.178.33] <-> UbuntuPC[192.168.178.48] | # WindowsPC[192.168.178.33] <-> UbuntuPC[192.168.178.48] | ||
# WinPC: python CheckUdpClientServer.py Windows 5001 192.168.178.48 5000 | # WinPC: python CheckUdpClientServer.py Windows 5001 192.168.178.48 5000 | ||
Line 111: | Line 40: | ||
# UDP - TxD - TransmitData | # UDP - TxD - TransmitData | ||
# | # | ||
- | UDP_IPADDRESS_TX = '127.0.0.255' | + | UDP_IPADDRESS_TX = '192.168.178.255' |
- | UDP_IPPORT_TX = 5000 | + | UDP_IPPORT_TX = 5001 |
# | # | ||
# | # | ||
# UDP - RxD - ReceiveData | # UDP - RxD - ReceiveData | ||
# | # | ||
- | UDP_IPADDRESS_LOCAL = '127.0.0.1' # dummy | + | UDP_IPADDRESS_LOCAL = '192.168.178.33' # dummy |
UDP_IPPORT_RX = 5000 | UDP_IPPORT_RX = 5000 | ||
# | # | ||
Line 155: | Line 84: | ||
# | # | ||
print(' | print(' | ||
- | if (5 <= len(sys.argv)): | + | |
- | # Analyse Arguments für Tx/ | + | # |
- | UDP_HEADERID = sys.argv[1] | + | # |
- | # RX | + | # |
- | UDP_IPPORT_RX = int(sys.argv[2]) | + | # |
- | # TX | + | # |
- | UDP_IPADDRESS_TX = sys.argv[3] | + | # |
- | UDP_IPPORT_TX = int(sys.argv[4]) | + | # |
# | # | ||
UdpCS = UCS.CUdpClientServer(UDP_HEADERID, | UdpCS = UCS.CUdpClientServer(UDP_HEADERID, | ||
Line 176: | Line 105: | ||
| | ||
UdpCS.Open() | UdpCS.Open() | ||
- | | + | |
- | time.sleep(5.0) | + | UdpCS.Transmit(' |
- | UdpCS.Transmit(' | + | time.sleep(3.0) |
- | time.sleep(1.0) | + | |
UdpCS.Close() | UdpCS.Close() | ||
# | # | ||
Line 305: | Line 233: | ||
return | return | ||
# | # | ||
- | # | + | # |
</ | </ | ||
Line 357: | Line 285: | ||
===== Version ===== | ===== Version ===== | ||
- | {{: | + | {{: |
----- | ----- |
module/python/udpclientserver/udpclientserver02v03.1639421977.txt.gz · Last modified: 2021/12/13 20:59 (external edit)