Check #OnInit section of Expr.txt
https://www.cnczone.com/forums/plane...-expr-txt.html
question: iz it possible to make one time event, when machine start first time some program and the stays ON?
F.e.: my code for "on start"
M62 P1 Q1
G04 P10
(print,OnStart script @ Line: #<line,0>)
but, I don' like it because it delays 10 sec everytime I start new program. Is there some solution that will skip delay if P1 is ON?
Similar Threads:
Check #OnInit section of Expr.txt
https://www.cnczone.com/forums/plane...-expr-txt.html
Thank you, but this exceed my knowledge...
If I understand correctly there are two questions here.
1. How can I turn output on when TNG starts?
2. How can I skip wait if output is already on?
1:
- Open or create "Expr.txt" file in you profile folder.
- Find or create new "#OnInit" section
- Add comand that will turn output on,. For examle:
This will turn output 5 on (note that first output has number 0).Code:#OnInit print('Expr: OnInit'); cmd("Machine.Output", 4 ,1);
Message will also be printed to output window.
2.
Do this in your Onstart script.
Code:#<out1> = #<_hw_output_num|1> M62 P1 Q1 o<chk> if [#<out1> EQ 0] (print, Waiting 10s) G04 P10 o<chk> endif
.
THANK YOU !!
Works like a charm!
Didn't know that 2 files neded adjusting - coding.
Why I need that? Because the fuse is on edge and some delay neded when machine starts first time to VFD goes to ON, delay for VFD is recomended before spindle starts. When ewerything is ON, works perfect.
I am driwing that on IO 1 port with SSR.
THANK YOU !!
Works like a charm!
Didn't know that 2 files neded adjusting - coding.
Why I need that? Because the fuse is on edge and some delay neded when machine starts first time to VFD goes to ON, delay for VFD is recomended before spindle starts. When ewerything is ON, works perfect.
I am driwing that on IO 1 port with SSR.