alfrank
Posts: 2
Joined: Sat Apr 08, 2023 12:39 pm

5.0.2 - {IF NEWTOOL= ... not working

If I try to use the {IF ... statement in any script S3D V5.0.2 doesn't interpret it and (if true) just put the gCode after the closing bracket "}" into the gCode output file but the whole line including everything inside the brackets, no matter if it's true or not.

Here's an example which I use in the post tool change script for my Snapmaker J1:
{IF NEWTOOL=0}G1 X[next_position_x] Y[next_position_y] F9000 ; go to next position at high speed
{IF NEWTOOL=1}G1 X[current_position_x] Y[current_position_y] F9000 ; go to next position at high speed

Depending on which tool is the next one it should put one of the following two lines (the 100s just as example coordinates) into the gCode output file, not one of the full above lines:

G1 X100 Y100 F9000 ; go to next position at high speed
G1 X100 Y100 F9000 ; go to next position at high speed

This is clearly a new bug, it worked in similar use cases in V4.x.
S3D-Jason
Posts: 1608
Joined: Sun May 31, 2015 6:01 am

Re: 5.0.2 - {IF NEWTOOL= ... not working

I think that syntax only works in the pre tool change script. S3D V4 only had 1 tool change script, and that acted the same as the pre tool change script in V5. So if you're trying to match the behavior of V4 in V5, you should copy that script into the pre tool change section.
alfrank
Posts: 2
Joined: Sat Apr 08, 2023 12:39 pm

Re: 5.0.2 - {IF NEWTOOL= ... not working

As I already stated it doesn't work in any script anymore.
S3D-Jason
Posts: 1608
Joined: Sun May 31, 2015 6:01 am

Re: 5.0.2 - {IF NEWTOOL= ... not working

I just tested that in 5.0.2 and it worked fine in the PRE tool change script. Make sure you aren't using the POST script.

Return to “Troubleshooting and Bug Reports”