I am a student at schmalkalden university, working on the Delta Robot Project, which was built by B&R PLC. I am trying to build modbus communication between B&R plc and Raspberry_Pi to get x,y value and use in the program(PlotBotPrg).
I wrote program 3, which gets value manually for testing the data type , which worked without any error,
VAR CONSTANT
Pos1 : McPointType := (Pos := (X := 0, Y := 0, Z := -431));
Pos2Base : McPointType := (Pos := (X := 10, Y := 10, Z := -370));
END_VAR
VAR
Pos2 : McPointType;
TestX : UINT := 30;
TestY : UINT := 30;
END_VAR
PROGRAM _MAIN
Pos2 := Pos2Base;
Pos2.Pos.X := UINT_TO_REAL(TestX);
Pos2.Pos.Y := UINT_TO_REAL(TestY);
Feedrate(21000);
MoveL(Pos1);
WaitTime(1.0);
MoveL(Pos2);
WaitTime(1.0);
MoveL(Pos1);
WaitTime(1.0);
END_PROGRAM
But when I wrote Program 4, using the variable from the communication value,i could build and transfer without error. The logic for pos2 is moving to 0,0,-370, but it should move to 10,10,-370. But in program watch window i see the variable are having the value of X as 10 and Y as 10, no idea why these value are not read in program running
VAR CONSTANT
Pos1 : McPointType := (Pos := (X := 0, Y := 0, Z := -431));
Pos2Base : McPointType := (Pos := (X := 10, Y := 10, Z := -370));
END_VAR
VAR
Pos2 : McPointType;
X_Register : UINT;
Y_Register : UINT;
END_VAR
PROGRAM _MAIN
Pos2 := Pos2Base;
Pos2.Pos.X := UINT_TO_REAL(X_Register);
Pos2.Pos.Y := UINT_TO_REAL(Y_Register);
Feedrate(21000);
MoveL(Pos1);
WaitTime(1.0);
MoveL(Pos2);
WaitTime(1.0);
MoveL(Pos1);
WaitTime(1.0);
END_PROGRAM
now with program 5-it shows syntax error(0) in Visu- i have tried to trigger after reaching Pos1


