George
Risposte nei forum create
-
AutorePost
-
George
PartecipanteI should check it in the field.
Maybe the image that I have made my tests is outdated.
Next week I could check it.George
PartecipanteWindows 11 Pro for Workstations (25H2).
It should be noted that the problem appear in MPS050 xUnified as target with Pck055a050 library.
In mps054 xUnified or mps056 xUnified targets there is no problem.George
PartecipanteI have MPS050 xUnified as target with Pck055a050 library I get
ON(32) – error S1305: TO_TIME => Unknown function,
If I use TON and eTON function blocks in the same project.
If I use only TON or eTON, there is no problem. I need to use eTON in old projects where I have configurations with preset time in UDINT variables.
It would be convenient to have a way to convert UDINT to TIME, to be possible the use only TON.If I have mps054 xUnified or mps056 xUnified the mentioned error is not appeared. So I can use TON and eTON FBs in the same project without problem. The problem appeared in mps050 xUnified target.
George
PartecipanteIn my project have a structure like:
MYSTRUCT: STRUCT V1 : BOOL; V2 : ARRAY[0..3] OF UINT; END_STRUCT;If I intitialize in a program it:
VAR CONSTANT MS : MYSTRUCT := (V1:=FALSE, V2:=[10,20,30,40]); END_VAR VAR myS : MYSTRUCT; END_VAR myS:= MS; myS.V1:= MS.V1; // [End of file]I get errors
MyProgram(2) - error G0291: MS => Invalid constant value MyProgram(3) - error G0291: MS.V1 => Invalid constant value
I think this error has to do with constant variable instantiation of structure data type containing array element.
George
PartecipanteIs it possible to declare a CONSTANT variable of structured data type?
When I try to declare I get compilation error without error code.
George
PartecipanteIn LogicLab program i write a program like this:
VAR SquareArea : REAL; (* Square area *) SquarePerimeter : REAL; (* Square perimeter *) RectangleArea : REAL; (* Rectangle area *) RectanglePerimeter : REAL; (* Rectangle perimeter *) RForm : Form; (* Reference to Form *) MySquare : Square; (* Square form *) MyRectangle : Rectangle; (* Rectangle form *) pMySquare : @Square; pMyRectangle : @Rectangle; END_VAR IF (SysFirstLoop) THEN CASE select OF 1: pMySquare:= SysMAlloc(SIZEOF(Square)); RForm:=@pMySquare; //Reference to Form 2: pMyRectangle:= SysMAlloc(SIZEOF(Rectangle)); RForm:=@pMyRectangle; //Reference to Form END_CASE; END_IF; CASE select OF 1: SquareArea:=RForm.Area(); //Square area SquarePerimeter:=RForm.Perimeter(); //Square perimeter 2: RectangleArea:=RForm.Area(); //Rectangle area RectanglePerimeter:=RForm.Perimeter(); //Rectangle perimeter END_CASE;In TWINCAT we could write
pMySquare:= _NEW(Square); RForm:= pMySquare^; RForm.Area(); RForm.Perimeter();George
PartecipanteIf I would instantiate Square and Rectangle FBs dynamically (SysMalloc) as the example
IF (SysFirstLoop) THEN MySquare:=SysMAlloc(SIZEOF(Square)); MyRectangle:=SysMAlloc(SIZEOF(Rectangle)); @MySquare.Side:=10; //Square side @MyRectangle.Width:=20; //Rectangle width @MyRectangle.Height:=4; //Rectangle height END_IF;is it possible?
George
PartecipanteThe problem with variables of interface type that assigned with a reference of a pointer. I think it is not working as I would.
In TWINCAT it is possible that:
VAR pTxtLogger : POINTER TO FB_TxtLogger; ipLogger : ILogger; END_VAR pTxtLogger := __NEW(FB_TxtLogger); ipLogger := pTxtLogger^; IF (ipLogger <> 0) THEN Write := ipLogger.Write(CONCAT('logger: ', sMsg)); END_IFAprile 29, 2025 alle 5:03 pm in risposta a: Error on using structured variable in a Method of an Interface #81777George
PartecipanteYes I tested your program and compiles correctly.
Now I gonna test this function in my program.
George
PartecipanteThank you very much. this was the information I was missed. It was not so clear in the LogicLab manual (6.6.7 SETTING VARIABLES INITIAL VALUE).
George
PartecipanteI think i solved the problem by upgrading the firmware to SFW198E060 (Pck051b060).
What is difference between Pck051b060 and PCK054A010?
Ottobre 29, 2022 alle 12:24 am in risposta a: Errore “eGetBYTE => Funzione sconosciuta” in compilazione #68455George
PartecipanteI think i solved the problem by upgrading the firmware to SFW198E060 (Pck051b060).
What is difference between Pck051b060 and PCK054A010?
Luglio 6, 2022 alle 9:26 pm in risposta a: Uscite analogiche su modulo espansione I/O analogico #66072George
PartecipanteHello, if you had read the comments inside “MyProgram” in project i had sent, you could see that i had located the problem in malloc buffer size and the memory allocation mechanism of the linker. The information for malloc memory of SysSetAnOut FB is very useful.
Another problem that i found is that the measured output values are abnormal. The analog outputs drive the reference inputs of motor inverters. If for example set channel 1 to 1V and all the other channels to 0V, the measured values to channels other than channel 1 are like -3.5V or 2.5V etc.
I checked that between analog inputs of inverters and the earth strip the impedance is about 100KOhm. The inverters specs for reference input give Ri about 40KOhm. If i disconnect the analog outputs from inverters reference inputs the measured values are as expected.
The solution that implemented and solves my problem is to connect opamp buffers between analog outputs of the module and the inverters inputs. If you could suggest a more simple solution, it would be nice.
Giugno 27, 2022 alle 3:17 pm in risposta a: Uscite analogiche su modulo espansione I/O analogico #65928George
PartecipanteI have connected two PCB126C150 on a MPS054A110 CPU (fw:SFW198E000) and i made a program to update the eight analog output channels.
If i run this program from Task background, execution is as expected.
if i run from Task slow, the update is done only on the first module (as i can see at Done output of SysSetAnOut FB). The same even if i play with longer loop time of slow Task.
I may send the program i prepared.
George
PartecipanteSo, the information (20 kB RAM user data) I read in product characteristics is not valid?
Is there the 20Kb option available?
-
AutorePost