OK Sorry
dann machen wir es mal richtig.
#TCON_ConnectionDescription.BLOCK_LENGTH := 16#40; // Byte 0-1 - Länge 64dez Byte (fest)
#TCON_ConnectionDescription.ID := #i_IPCONFIG_W_ConnectionID; // Byte 2-3 - Den Wert dieses Param. Startwert = 1
// müssen für die Anweisung TSEND_C,TRCV_C oder TCON undter ID angeben
#TCON_ConnectionDescription.CONNECTION_TYPE := 16#13; // Byte 4 - Input Word Verbindungstyp (19dez = UDP)
#TCON_ConnectionDescription.ACTIVE_EST := FALSE; // Byte 5 - Kennung für die Art des Verbindugsaufbaus/UDP immer := false/
#TCON_ConnectionDescription.LOCAL_DEVICE_ID := #iUSINT_DeviceID; // Byte 6 - Kennung für die lokale PN/IE - Schnittstelle
#TCON_ConnectionDescription.LOCAL_TSAP_ID_LEN := 16#2; // Byte 7 - Wert 2 falls Verbindungstyp = 19 (UDP)
#TCON_ConnectionDescription.REM_SUBNET_ID_LEN := 16#0; // Byte 8 - Wird nicht verwendet
#TCON_ConnectionDescription.REM_STADDR_LEN := 16#0; // Byte 9 - Standard 0
#TCON_ConnectionDescription.REM_TSAP_ID_LEN := 16#0; // Byte 10 - 0 falls = 19 (UDP)
#TCON_ConnectionDescription.NEXT_STADDR_LEN := 16#0; // Byte 11 - Wird nicht verwendet
#TCON_ConnectionDescription.LOCAL_TSAP_ID[1] := #i_IPCONFIG_UInt_LocalPort.%B1; // Byte 12 - lokaler Port HIGH BYTE
#TCON_ConnectionDescription.LOCAL_TSAP_ID[2] := #i_IPCONFIG_UInt_LocalPort.%B0; // Byte 13 - lokaler Port LOW BYTE
#TCON_ConnectionDescription.LOCAL_TSAP_ID[3] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[4] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[5] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[6] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[7] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[8] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[9] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[10] := 16#0; // Byte 21
#TCON_ConnectionDescription.LOCAL_TSAP_ID[11] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[12] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[13] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[14] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[15] := 16#0;
#TCON_ConnectionDescription.LOCAL_TSAP_ID[16] := 16#0; // Byte 27
die restlichen sind Null
#TUSEND_Instance(REQ :=
#X_start_Send_intern AND NOT #ioX_Start_External AND #iX_Clock_1Hz,
ID := #i_IPCONFIG_W_ConnectionID,
LEN := 16 + #XINT_Send_Length,// Header+RestLänge
DONE => #X_SendDone,
ERROR => #X_SendError,
STATUS => #XW_SendStatus,
DATA := #UDT_DataSend,
ADDR := #TADDR_Param_Send,
BUSY => #X_SendBusy);
--> hier bekomme ich keinen Error. Der Status ist auf 7000.
#TURCV_Instance(EN_R := (#iX_Clock_1Hz AND NOT #X_TURCV_Busy),
ID := #i_IPCONFIG_W_ConnectionID,
LEN := 148,
NDR => #X_RCV_NDR,
DATA := #UDT_DataReceive,
ADDR := #TADDR_Param_Recv,
BUSY => #X_TURCV_Busy,
STATUS => #XW_TURCV_Status,
ERROR => #X_TURCV_Error);
--> wenn nichts gesendet werden kann wird auch nichts empfangen
. Status auf 7000