Set Up Parameters of MpAxisBasic

Hello, I found in a other Post a Solution to set up the MP_Link Input of the mpAxisBasic but how does it work for the Parameters Input?

Thanks for your help.

Hello,

There is one Variable for the Functionblock Instance of MpAxisBasic and another Variable for the Parameter Structure.

PROGRAM _CYCLIC
	
	FBMpAxisBasic(....,
                  Parameters := ADR(FBMpAxisBasicPar),
                   ........);
	
END_PROGRAM

Hello,

i just saw that your Functionblock is a Coustom spezific one just only looking very similar.
IN_Parameter is not Parameters.

Can you show us your Functionblock Deklaration, there should be a .fun File similar to the one of the MpAxisBasic?

Greetings
Michael

Hello Michael,

here is it.

image

Hello,

looks quite fine, i think you only have the declaration in the Calling-Task wrong.
Here my screenshots for your situation, reduced to MpLink and Paramters Structure.

Library

FUNCTION_BLOCK FB_MotionAxis
	
	IF IN_Parameter = 0 THEN
		// Wait until Paramter input to prevent access to invalid address 0 	
	ELSE	
		pPara ACCESS IN_Parameter;
		
		MpAxis(MpLink := MP_Link, 
			Parameters := IN_Parameter); 
	END_IF 	

END_FUNCTION_BLOCK

Task

PROGRAM _CYCLIC
	
	FBAxis(MP_Link := ADR(gAxisQX) , 
			IN_Parameter := ADR(FBAxisPar));
		
END_PROGRAM

Watch Window

Greetings
Michael

1 Like