Facing a mystery ! The same writeBlock does not output the same thing when called from somewhere else...

Facing a mystery ! The same writeBlock does not output the same thing when called from somewhere else...

bernard5BABD
Advocate Advocate
202 Views
2 Replies
Message 1 of 3

Facing a mystery ! The same writeBlock does not output the same thing when called from somewhere else...

bernard5BABD
Advocate
Advocate

I really don't understand what I am seeing. Here the first output, which is exactly what I am expecting:

 

G0 G99 X150. Z150. T0100 (LINE 4582 - XPOS=150 ZPOS=150)

 

now, here is the second one:

 

G0 G99 T0600 (LINE 4582 - XPOS=150 ZPOS=150)

 

You can notice that in both cases, the variables contains the proper values

Here is the writeBlock in question:

 

if ((getProperty("useTailStock") == "false") || !machineState.tailstockIsActive) { // don't retract B-axis if used as a tailstock
      // writeDebug("homePositionX = " + tmpXPos);
      // writeDebug("homePositionZ = " + tmpZPos);
      writeBlock(
        gMotionModal.format(0),
        gFormat.format(99),        
        xOutput.format(tmpXPos / 2),
        zOutput.format(tmpZPos),        
        cmbiToolInit.format(currentToolCode),    
        formatComment("line 4582 - XPos=" + tmpXPos + " ZPos=" + tmpZPos )
        )    ;
        //conditional(_comment, formatComment(_comment))
    }   

 


As I thought the problem was that, in one case, it was not able to get the properties values, I made the call to getProperty above, but the end result is exactly the same.

Any one would have a brilliant idea to help me ? I am really stuck here.
Thanks for you help,

Bernard Grosperrin, Retired, Maker, and Autodesk Certified Instructor
Blog : Le Bear CNC | Forum : Le Bear CNC Forum | Addin : Airfoil Sketch from file
0 Likes
Accepted solutions (1)
203 Views
2 Replies
Replies (2)
Message 2 of 3

BrandonTBFBF
Collaborator
Collaborator
Accepted solution

Have you tried adding a forceAny(); above it?

0 Likes
Message 3 of 3

bernard5BABD
Advocate
Advocate

No, as I did not know this function. I am going to try and let you know.
Just tested, works perfectly. Thank you!

Bernard Grosperrin, Retired, Maker, and Autodesk Certified Instructor
Blog : Le Bear CNC | Forum : Le Bear CNC Forum | Addin : Airfoil Sketch from file