Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
M code operation
#1
Hi, I am new to Delta Tau and the Pmac system.
Our machine is a laser cutting machine. The bed is driven by a Geo Brick and Pmac nc software. I need to open and close a laser shutter. A relay has been wired into pin 12 of the geo brick J7 plug. By addressing the pin I can open the shutter by supplying 24v with the command m33 value 1 using Pwin32 config software.

How do I transfer this to cnc code in the PHMI front end. I need to assign an m code somehow but am a bit lost at the moment.
Reply
#2
The M-code from NC will call program 1001 line M-code * 1000
(M21 will run N21000)


Open Mill.h (if you have one) in pewin. It should have been made by NC setup and installed in your machine directory

Add this at the top after all the #includes
Code:
#define RL_Shutter M3001
   M3001->Y:$078802,0,1 // Output 1 J6 Pin#12 Pin#30

Then add this before
// End of Program
N30000
Code:
//----------------------------
      // M21 shutter Open
      //----------------------------
  N21000
      DWE0
      RL_Shutter== 1
      DWE0
  RET
  
      //----------------------------
      // M22 Shutter Closed
      //----------------------------
  N22000
      DWE0
      RL_Shutter== 0
      DWE0
  RET

Download the file.

Then in NC in MDI mode run the following

G1 P.1
M21
G1 P4
M22
G1 P.1
M30

It should open the shutter for 4 second then close it.

Let me know if this helps.
Reply
#3
(12-09-2010, 01:33 PM)Ron22 Wrote: The M-code from NC will call program 1001 line M-code * 1000
(M21 will run N21000)


Open Mill.h (if you have one) in pewin. It should have been made by NC setup and installed in your machine directory

Add this at the top after all the #includes
Code:
#define RL_Shutter M3001
   M3001->Y:$078802,0,1 // Output 1 J6 Pin#12 Pin#30

Then add this before
// End of Program
N30000
Code:
//----------------------------
      // M21 shutter Open
      //----------------------------
  N21000
      DWE0
      RL_Shutter== 1
      DWE0
  RET
  
      //----------------------------
      // M22 Shutter Closed
      //----------------------------
  N22000
      DWE0
      RL_Shutter== 0
      DWE0
  RET

Download the file.

Then in NC in MDI mode run the following

G1 P.1
M21
G1 P4
M22
G1 P.1
M30

It should open the shutter for 4 second then close it.

Let me know if this helps.

Hi, there....

Firstly thanks for trying to help.

I am afraid it did not work.

I do not seem to have Mill.h file.

I have

NCPLC.H
OEM.H
Address.H
LDI01_userdifines.h (LDI01 is the name of the laser machine)
NC_I_Var.IVR
Initialise.PLC
Override.OLC
Home.PLC
Reset.PLC
Handle.PLC
GPTimer.PLC
PositionReport.PLC
LDI01.CFG
Mill.G
Mill.M
Mill.T

cheers
Reply
#4
Sorry my mistake. You want Mill.M.
Reply
#5
(12-10-2010, 11:03 AM)Ron22 Wrote: Sorry my mistake. You want Mill.M.

Hi, Yes I tried that and it still doesn't work?
Reply
#6
(12-09-2010, 12:58 PM)LaserSteve Wrote: Hi, I am new to Delta Tau and the Pmac system.
Our machine is a laser cutting machine. The bed is driven by a Geo Brick and Pmac nc software. I need to open and close a laser shutter. A relay has been wired into pin 12 of the geo brick J7 plug. By addressing the pin I can open the shutter by supplying 24v with the command m33 value 1 using Pwin32 config software.

How do I transfer this to cnc code in the PHMI front end. I need to assign an m code somehow but am a bit lost at the moment.


You can add an M-code to the “mill.m” or “lathe.m” files (depending on the machine type you have setup). This is the PMAC PROG 1001 so it takes normal PMAC motion program commands.

For example if you wanted to add the M-codes M15 and M16 to execute M33=1 and M33=0 statements you would insert the following code into the mill.m file:


N15000
M33=1
RETURN

N16000
M33=0
RETURN
Reply
#7
(12-09-2010, 12:58 PM)LaserSteve Wrote: Hi, I am new to Delta Tau and the Pmac system.
Our machine is a laser cutting machine. The bed is driven by a Geo Brick and Pmac nc software. I need to open and close a laser shutter. A relay has been wired into pin 12 of the geo brick J7 plug. By addressing the pin I can open the shutter by supplying 24v with the command m33 value 1 using Pwin32 config software.

How do I transfer this to cnc code in the PHMI front end. I need to assign an m code somehow but am a bit lost at the moment.

Also - don't forget to download the edited Mill.m file to the PMAC.
Reply
#8
(12-15-2010, 02:34 PM)steve.milici Wrote:
(12-09-2010, 12:58 PM)LaserSteve Wrote: Hi, I am new to Delta Tau and the Pmac system.
Our machine is a laser cutting machine. The bed is driven by a Geo Brick and Pmac nc software. I need to open and close a laser shutter. A relay has been wired into pin 12 of the geo brick J7 plug. By addressing the pin I can open the shutter by supplying 24v with the command m33 value 1 using Pwin32 config software.

How do I transfer this to cnc code in the PHMI front end. I need to assign an m code somehow but am a bit lost at the moment.

Also - don't forget to download the edited Mill.m file to the PMAC.

Thanks for all your help guys.

I eventually got things working with the following code

In Mill.M

I added:
#define SHUTTER M1102
M1102->Y:$78802,0,8

then
N21000
DWE0
SHUTTER== 1
DWE0
RET

N22000
DWE0
SHUTTER== 0
DWE0
RET

This code is almost Identical to to Ronn22's except for the M1102 not M3001

It seems I/0 inputs and output variables reside at M1100 to M11032
with address range Y:$78802 to Y:$78832. The only reason I chose M1102 was for ease of assigning if I need to use any other I/O's

thanks for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)