Jump to content
OMRON Forums

Block allocation of P variables


Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Just found the syntax


global MY_MATRIX(16)


allocates 16 P variables


Unfortunately the matrix functions msolve etc. require P variable indexes not the actual P variable expansion, is there a way of getting the starting index of MY_MATRIX


The manual states the following


global SurfaceNormal(3);

global ToolNormal(3);

the following command could be used:

AngleCosine = sumprod(&SurfaceNormal, &ToolNormal, 3, 1, 1)


This syntax doesn't seem to work.

Link to comment
Share on other sites

Put an ‘&’ in front of your array and PPMAC will handle it by skipping the ‘P’ and just using the number of the P variable or expression.



global matrix1(9), matrix2(9);

result = msolve(&matrix1(0), &matrix2(0), 3, 3)


See the IDE “Program Development” Example project.

Link to comment
Share on other sites

Here is an example I used in a training class recently

// Array to hold result:
global MxResult(3);

// Matrix 1
global Mat1x11=1, Mat1x12=2, Mat1x13=3;
global Mat1x21=4, Mat1x22=5, Mat1x23=6;		

// Matrix 2
global Mat2x11=7,	Mat2x12=8;
global Mat2x21=9,	Mat2x22=10;
global Mat2x31=11,	Mat2x32=12;

// Matrix Multiplication
global MxMult;
MxMult=MMUL(&MxResult(0),&Mat1x11,&Mat2x11,2,3,2); // MxMult=1 operation success

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...