User Tools

Site Tools


module:python:udpclientserver:udpclientserver02v03

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
module:python:udpclientserver:udpclientserver02v03 [2021/12/13 19:59] – [Single PC: Aufruf mit Übergabe-Parametern] omdevelopmodule: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** +{{:module:python:UdpClientServer:2112132047_CheckUdpClientServerTerminal.png?600|2112132047_CheckUdpClientServerTerminal.png}}
-<code> +
-</code> +
-  +
-**...py** +
-<code> +
-</code> +
-  +
-**...py** +
-<code> +
-</code> +
-  +
-**...py** +
-<code> +
-</code>+
  
  
  
-==== 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: begin 
-Windows: TxIP-Address[192.168.178.255]-Port[4321] 
-Windows: RxIP(local)-Address[192.168.178.33]-Port[4321] 
-CBOnTxData[Windows]<0> 
-CBOnRxData[Windows]<0> 
-CBOnTxData[Windows]<1> 
-CBOnRxData[Windows]<1> 
-CBOnTxData[Windows]<2> 
-CBOnRxData[Windows]<2> 
-*** UdpClientServer: end 
-</code> 
- 
-==== Dual PC: ==== 
-=== WindowPC[192.168.178.33] === 
-<code python> 
->python CheckUdpClientServer.py Windows 5001 192.168.178.48 5000 
-*** CheckUdpClientServer: begin 
-Windows: TxIP-Address[192.168.178.48]-Port[5000] 
-Windows: RxIP(local)-Address[192.168.178.33]-Port[5001] 
-CBOnRxData[Windows]<0[Ubuntu]> 
-CBOnTxData[Windows]<0[Windows]> 
-CBOnRxData[Windows]<1[Ubuntu]> 
-CBOnTxData[Windows]<1[Windows]> 
-CBOnRxData[Windows]<2[Ubuntu]> 
-CBOnTxData[Windows]<2[Windows]> 
-CBOnRxData[Windows]<3[Ubuntu]> 
-CBOnTxData[Windows]<3[Windows]> 
-CBOnRxData[Windows]<4[Ubuntu]> 
-CBOnTxData[Windows]<4[Windows]> 
-CBOnRxData[Windows]<5[Ubuntu]> 
-CBOnTxData[Windows]<5[Windows]> 
-*** CheckUdpClientServer: end 
-</code> 
- 
-=== UbuntuPC[192.168.178.48] === 
-<code python> 
->python CheckUdpClientServer.py Ubuntu  5000 192.168.178.33 5001 
-*** CheckUdpClientServer: begin 
-Ubuntu: TxIP-Address[192.168.178.33]-Port[5001] 
-Ubuntu: RxIP(local)-Address[192.168.178.48]-Port[5000] 
-CBOnTxData[Ubuntu]<0[Ubuntu]> 
-CBOnTxData[Ubuntu]<1[Ubuntu]> 
-CBOnRxData[Ubuntu]<0[Windows]> 
-CBOnTxData[Ubuntu]<2[Ubuntu]> 
-CBOnRxData[Ubuntu]<1[Windows]> 
-CBOnRxData[Ubuntu]<2[Windows]> 
-CBOnTxData[Ubuntu]<3[Ubuntu]> 
-CBOnRxData[Ubuntu]<3[Windows]> 
-CBOnTxData[Ubuntu]<4[Ubuntu]> 
-CBOnRxData[Ubuntu]<4[Windows]> 
-CBOnTxData[Ubuntu]<5[Ubuntu]> 
-*** CheckUdpClientServer: end 
-</code> 
  
 ===== Hauptprogramm: CheckUdpClientServer.py ===== ===== Hauptprogramm: CheckUdpClientServer.py =====
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('*** CheckUdpClientServer: begin')     print('*** CheckUdpClientServer: begin')
-    if (5 <= len(sys.argv)): +    if (5 <= len(sys.argv)): 
-        # Analyse Arguments für Tx/Rx-Parameter +    #     # Analyse Arguments für Tx/Rx-Parameter 
-        UDP_HEADERID = sys.argv[1] +    #     UDP_HEADERID = sys.argv[1] 
-        # RX +    #     # RX 
-        UDP_IPPORT_RX = int(sys.argv[2]) +    #     UDP_IPPORT_RX = int(sys.argv[2]) 
-        # TX +    #     # TX 
-        UDP_IPADDRESS_TX = sys.argv[3] +    #     UDP_IPADDRESS_TX = sys.argv[3] 
-        UDP_IPPORT_TX = int(sys.argv[4])+    #     UDP_IPPORT_TX = int(sys.argv[4])
     #     #
     UdpCS = UCS.CUdpClientServer(UDP_HEADERID, UDP_IPPORT_RX,     UdpCS = UCS.CUdpClientServer(UDP_HEADERID, UDP_IPPORT_RX,
Line 176: Line 105:
                                                  UdpCS.GetIPPortRX()))                                                  UdpCS.GetIPPortRX()))
     UdpCS.Open()     UdpCS.Open()
-    for I in range(0, 3): +    while UdpCS.IsBusy(): 
-        time.sleep(5.0) +        UdpCS.Transmit('{}[{}]'.format('Hello',UdpCS.GetHeaderID())) 
-        UdpCS.Transmit('{}'.format(I)) +        time.sleep(3.0)
-    time.sleep(1.0)+
     UdpCS.Close()     UdpCS.Close()
     #     #
Line 305: Line 233:
         return         return
     #     #
-       +#
 </code> </code>
  
Line 357: Line 285:
    
 ===== Version ===== ===== Version =====
-{{:module:python:UdpClientServer:2112112117_UdpClientServer_02V01.zip|2112112117_UdpClientServer_02V01.zip}}+{{:module:python:UdpClientServer:2112131938_UdpClientServer_02V03.zip|2112131938_UdpClientServer_02V03.zip}}
  
 ----- -----
module/python/udpclientserver/udpclientserver02v03.1639421977.txt.gz · Last modified: 2021/12/13 20:59 (external edit)