9/12/2022 6:57 AM | |
Joined: 10/8/2018 Last visit: 8/7/2024 Posts: 14 Rating:
|
Hello friends, I wrote such a program, but I have an error when running, what should I do? DATA_BLOCK DB1 // // Block Comment ... // STRUCT DBNr: WORD; Adr: DWORD; END_STRUCT BEGIN DBNr := W#16#2; Adr := DW#16#0; END_DATA_BLOCK DATA_BLOCK DB2 // // Block Comment ... // STRUCT DB_VAR: ARRAY[1..100] OF WORD := W#16#0; END_STRUCT BEGIN END_DATA_BLOCK FUNCTION FC6 : VOID VAR_TEMP // Temporary Variables STOP,I:INT; END_VAR VAR_INPUT // Input Parameters pt: POINTER; _pt AT pt: STRUCT DBNr:WORD; Adr:DWORD; END_STRUCT; SIZE: INT; END_VAR BEGIN STOP := SIZE-1; FOR I:= 1 TO STOP DO WORD_TO_BLOCK_DB(_pt.DBNr).DD[DWORD_TO_INT(_pt.Adr)+I*4]:= REAL_TO_DWORD(5.5); END_FOR; // Statement Section ; END_FUNCTION And this is how I call in OB1: CALL FC 6 pt :=DB1.DBX0.0 SIZE:=5 ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 09/14/2022 04:20:54New subject after splitting |
|
Follow us on