Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
unabhängig von der indirekten Adressierung geht das, was du vorhast gar nicht, denn die Variablen Recieved1... sind vom Typ Real (also 4 Byte) und diese willst du indirekt Bytevariablen zuweisen.
Gruß Norbert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-11-13
Originally created by: Bernhard Werner
Hallo Tiak,
verwende doch POINTER
VAR
phelp:POINTERTOREAL;
END_VAR
phelp := ADR(%MB..);
phelp := phelp + MWNR;
phelp^ := Recieved1;
phelp := phelp + SIZEOF(REAL);
phelp^ := Recieved2;
etc.
Bernhard Werner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Weiss jemand wie ich das hier adressieren kann?
Ich meine damit etwas in diesem Sinn
VAR_INPUT
END_VAR
%MWB(MWNR); = Recieved1;
%MWB(MWNR+2); = Recieved2;
%MWB(MWNR+4); = Recieved3;
%MWB(MWNR+6); = Recieved4;
%MWB(MWNR+8); = Recieved5;
%MWB(MWNR+10); = Recieved6;
Hallo Tiak,
unabhängig von der indirekten Adressierung geht das, was du vorhast gar nicht, denn die Variablen Recieved1... sind vom Typ Real (also 4 Byte) und diese willst du indirekt Bytevariablen zuweisen.
Gruß Norbert
Originally created by: Bernhard Werner
Hallo Tiak,
verwende doch POINTER
VAR
END_VAR
phelp := ADR(%MB..);
phelp := phelp + MWNR;
phelp^ := Recieved1;
phelp := phelp + SIZEOF(REAL);
phelp^ := Recieved2;
etc.
Bernhard Werner
Hallo Bernhard.
Danke für deine Hilfe. Wen ich deiner Beispiel benutze kommt da 4 errors kannst du mir da wider helfen.
Expression expected
Expecting ‘)’ before ‘;’
Operant expected
Expecting ELSIF, ELSE OR END_IF before’^’
VAR_INPUT
END_VAR
IF STORE THEN
phelp := ADR(%MB0);
phelp := phelp + MWNR;
phelp^ := Recieved1;
phelp := phelp + SIZEOF(REAL) ;
phelp^ := Recieved2;
END_IF
Schöne grübe aus Dänemark
Originally created by: Fx64
Hallo Tiak,
ich denke es genügt nicht den Typ anzugeben:
phelp := phelp + SIZEOF(REAL);
ändere mal den sizeof
phelp := phelp + SIZEOF(Recieved1);
Viele Grüsse
Originally created by: Bernhard Werner
Hallo Tiak,
Fx64 hat recht. Ich habe den Code nicht ausprobiert und mal wieder C programmiert.
Bernhard
Originally created by: Fx64
Hallo Bernhard,
wäre doch aber auch schön, wenn man den SIZEOF() nach "C Art" progammieren könnte .
Viele Grüsse