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.