I see in a toolchange subprog something like:
IF[71EQ#4006] GOTO 10 IF[21EQ#4006] GOTO 10 #100001=#100001/25.4 #100002=#100002/25.4 #100003=#100003/25.4 N10
And it's ok, but I don't understand where #4006 variable is set, I don't see it in any loaded CCF and there isn't in gcode file or subprog. Could you please help me to find where it is created and set?
joycejois right this G20/21/70/71is where our ISV Simulation sets the variable, which then later will be evaluated inside the tool change program. In these OOTB example we like to use one single tool change program independent of the units of the main program.
but none of these GFunctions are called, when I start simulation (just the app "Simulate Machine Code File") I see that #4006 is equal to 21, and my .INI file is empty
Upon initialization of CSE two topics could influence the initial state.
1. *.ini files sets a default. You can check your Program Manager
2. A method called CSEInitializeChannel is called. In our OOTB we do set a default unit type here.
my .ini file is empty and I tried to copy CSEInitializeChannel in current file to edit it and nothing about #4006.
In my .MCF i use
Variable is set in a method called GMe_SetUnit, but how can I know when a method is called? Initialized method I mean, for example how can I create a method that it will be call while open machine simulation?
you already found it.
On start of simulation the system calls automatically the method CSEInitializeChannel.
Afterwards all ini files which are listed in the program manager will be sourced.