Thanks a lot @CodeShepherd 👍 I don't know what's different between your writing style like fbIL_ECATSoeWrite.Execute := bExecute; fbIL_ECATSoeWrite.MasterName := ADR('ethercatmaster'); fbIL_ECATSoeWrite.SlaveAddress := 1004; ...... and using the function block from libary fbIL_ECATSoeWrite( Execute:= TRUE, MasterName:= ADR('ethercatmaster'), SlaveAddress:= 1004, ...... but using your style works fine, using function block style don't. Maybe I am doing something wrong but it's strange. For using with IndraDrive MPB17 it can look like that (writing P-0-0397 filter of signal time constant): Structure: TYPE TableStruct : STRUCT ActLength : UINT; MaxLength : UINT; ArrayOfElements : ARRAY[0..1] OF UDINT; END_STRUCT END_TYPE Declaration: WriteList : TableStruct := ( ArrayOfElements := [40,30], ActLength := 4, MaxLength := 4); Code: If HMI-input is changed by a user it will trigger writing on P-0-0397 element 0 (time constant for filter 1 / signal 1 (in my case signal 1 is S-0-0084 torque value)): IF GVL_AXIS.iGlaettung[1] <> iGlaettungOld[1] THEN WriteList.ArrayOfElements[0] := (GVL_AXIS.iGlaettung[1]*10); fbIL_ECATSoeWrite.Execute := TRUE; fbIL_ECATSoeWrite.MasterName := ADR('ethercatmaster'); fbIL_ECATSoeWrite.SlaveAddress := 1004; fbIL_ECATSoeWrite.Idn := IL_ECATSOEIdnCoding(SOE_P_PARAM,0,397); fbIL_ECATSoeWrite.ValueAdr := ADR(WriteList); fbIL_ECATSoeWrite.SizeOfValue := WriteList.ActLength + SIZEOF(WriteList.MaxLength) + SIZEOF(WriteList.ActLength); fbIL_ECATSoeWrite(); IF fbIL_ECATSoeWrite.Done THEN bExecute := FALSE; fbIL_ECATSoeWrite.Execute := FALSE; fbIL_ECATSoeWrite(); iGlaettungOld[1] := GVL_AXIS.iGlaettung[1]; END_IF IF TRUE = fbIL_ECATSoeWrite.Error THEN bExecute := FALSE; fbIL_ECATSoeWrite.Execute := FALSE; fbIL_ECATSoeWrite(); iGlaettungOld[1] := GVL_AXIS.iGlaettung[1]; END_IF END_IF By the way, is this a special kind of coding? IF TRUE = fbIL_ECATSoeWrite.Error THEN... I don't know that style, I use always: IF fbIL_ECATSoeWrite.Error Then... or IF NOT fbIL_ECATSoeWrite.Error Then....
... View more