LaserSteve Posted December 9, 2010 Share Posted December 9, 2010 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. Link to comment Share on other sites More sharing options...
Ron22 Posted December 9, 2010 Share Posted December 9, 2010 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 [/code] 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 [/code] 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. Link to comment Share on other sites More sharing options...
LaserSteve Posted December 10, 2010 Author Share Posted December 10, 2010 [quote='Ron22' pid='928' dateline='1291926818'] 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 [/code] 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 [/code] 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. [/quote] 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 Link to comment Share on other sites More sharing options...
Ron22 Posted December 10, 2010 Share Posted December 10, 2010 Sorry my mistake. You want Mill.M. Link to comment Share on other sites More sharing options...
LaserSteve Posted December 11, 2010 Author Share Posted December 11, 2010 [quote='Ron22' pid='936' dateline='1292004191'] Sorry my mistake. You want Mill.M. [/quote] Hi, Yes I tried that and it still doesn't work? Link to comment Share on other sites More sharing options...
steve.milici Posted December 15, 2010 Share Posted December 15, 2010 [quote='LaserSteve' pid='927' dateline='1291924709'] 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. [/quote] 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 Link to comment Share on other sites More sharing options...
steve.milici Posted December 15, 2010 Share Posted December 15, 2010 [quote='LaserSteve' pid='927' dateline='1291924709'] 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. [/quote] Also - don't forget to download the edited Mill.m file to the PMAC. Link to comment Share on other sites More sharing options...
LaserSteve Posted December 16, 2010 Author Share Posted December 16, 2010 [quote='steve.milici' pid='946' dateline='1292448869'] [quote='LaserSteve' pid='927' dateline='1291924709'] 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. [/quote] Also - don't forget to download the edited Mill.m file to the PMAC. [/quote] 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. Link to comment Share on other sites More sharing options...
Recommended Posts