Jump to content
OMRON Forums

Recommended Posts

Posted

Although there is no way to directly support a line like ‘PowerBrick[0].GpioData[0].16.1=1’ in Power PMAC-NC, there are ways to do it indirectly.

 

You can embed this line into a custom M-code. For Example you could do it discretely for separate On/Off M-codes:

 

// M12 - Turn Valve ON with synchronous assignment

n12000:

PowerBrick[0].GpioData[0].16.1 == 1

if (RunOptions & UI_SingleBlock == UI_SingleBlock) dwell 0

return;

 

// M13 - Turn Valve OFF with synchronous assignment

n13000:

PowerBrick[0].GpioData[0].16.1 == 0

if (RunOptions & UI_SingleBlock == UI_SingleBlock) dwell 0

return;

 

You could also get more sophisticated and create a single M-code which supports multiple I/O points including the On/Off state:

 

// M12 - Multiple Output Control with Synchronous Assignment

n12000:

read(P,X) // P - Brick Output Number, X - Turn ON=1, Turn OFF=0.

 

if (ArgPassVar & PargMask){BrickGpIoOutput = Parg}

if (ArgPassVar & XargMask){IoState = Xarg}

 

switch (BrickGpIoOutput)

{

case 1:

Acc68E[0].DataReg[3].0.1 == IoState

break;

case 2:

Acc68E[0].DataReg[3].1.1 == IoState

break;

case 3:

Acc68E[0].DataReg[3].2.1 == IoState

break;

case 4:

Acc68E[0].DataReg[3].3.1 == IoState

break;

}

if (RunOptions & UI_SingleBlock == UI_SingleBlock) dwell 0

return;

 

The above M-codes could then be replaced in the actual NC file by using either the #define or #include features. Using the #include method allows you to add entire alias groups with only a single line of NC code. Then these groups can be stored and used as necessary.

 

You could then code the actual NC program using the direct M-code, or alias' as follows:

 

#define ValveOn M12 P3 X1

#define ValveOff M12 P3 X2

 

G00 X0

M12 P2 X1

G04 X4

M12 P2 X0

G04 X4

ValveOn

G04 X4

ValveOff

G04 X4

M30

 

or....

 

#include "C:\CustomAliasDefines.txt"

 

G00 X0

M12 P2 X1

G04 X4

M12 P2 X0

G04 X4

ValveOn

G04 X4

ValveOff

G04 X4

M30

 

Then ultimately you could cheat, and use the secret ‘Pass on through without parsing character - |’ as follows:

 

|PowerBrick[0].GpioData[0].16.1

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Guest
This topic is now closed to further replies.

×
×
  • Create New...