Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: How to check for offset-mode inside a sbp file... ?

  1. #1
    Join Date
    Aug 2012
    Location
    Victoriaville, QC, Canada
    Posts
    53

    Default How to check for offset-mode inside a sbp file... ?

    Need some help figuring this one out.

    I wrote a custom post processor for vcarve for my laser. Everything fine but... yesterday I wanted to burn multiple copies of the same logo so I manually created a new sbp file with multiple FP command from different origin using the 2D offset mode of the FP command.

    The problem is that I need to change my post processor in order to check if the file is running in 2D offset mode or not and I don't know how.

    I tried check if system variables %(61) or %(62) are not zero but this does not work because the previous offset is still in there from the last time an offset mode was used even though the current execution is not in offset mode.

    I need this to skip a pause in my laser sbp file if it's running in offset mode because the idea is to be able to make multiple copies without user intervention. On the other hand, when I run just a single file (not in offset mode), I want a user confirmation before starting the laser and tell him not to forget to wear the safety goggles.

    Any help would be appreciated.

  2. #2
    Join Date
    Dec 2000
    Location
    Thorp, WI
    Posts
    2,724

    Default

    Have you looked at the VO command...

    VO -Value Temporary Tool Offset {Activate Offset, Offset-X, Offset-Y, Offset-Z, Offset-A, Offset-B, Offset-C}

    This command turns on or off a t
    emporary off-setting of movement in each of the axis given a designated offset.All moves are offset from the time the command is activated until it is turned off or the Part File exited.The offsets are added to the current display such that the true current position is displayed in the position readout. The temporary offsets are added to whatever other offsetting or proportioning may be applicable within the file. This command is typically used with a second head such as a dual Z or an air drill.ActivateTool Offset (1 -ON, 2 -OFF)Turns the Temporary Tool Offset ON or OFF. Can be used with or without axis offset parameters. Offset parameters are those most recently entered. Offset Distance X ... C Distance to offset any axis given in the next 6 parameters. Inches or mm.

    It's been a while since I've run SB3 and I had many custom files like this, but if a file is run in 2D offset, doesn't it automatically turn it off when finished? I've use the VO command with variables for the desired offset for cutting multiple parts from 4 x 8 sheets and it worked nicely.

    You could possibly use an unused output that you turn off/on and then check the status of it.

    I'm sure that there are numerous ways to do what you want, just need to find the one that works as desired.

    "He who would trade liberty for some temporary security, deserves neither liberty nor security" - Benjamin Franklin
    "Make yourself sheep and the wolves will eat you" - Benjamin Franklin
    "Symbolism is for the symbol minded" - George Carlin




  3. #3
    Join Date
    Aug 2012
    Location
    Victoriaville, QC, Canada
    Posts
    53

    Default

    Hi srwtlc,

    I did not know of the VO command but it does not solve my problem. I am french canadian so my english is probably not crystal clear.

    I need to be able to check, inside a sbp file, whether an offset is being applied because I need the sbp file to perform alternate instructions in case we are in a situation where the file is being repeated for multiple copies of a toolpath. The VO command is yet another way to restart a toolpath from a different starting origin but it does not tell me how to test if the current file is being run «under the influence of VO» or not.

  4. #4
    Join Date
    Dec 2000
    Location
    Thorp, WI
    Posts
    2,724

    Default

    Could you set a variable (True/False) when you are doing multiples or not and then check for it?

    Turn on a unused output and check for it with %101-%108 and show a msgbox if needed. Turn it off at the end of the file that is being run in offset mode when it's done.

    "He who would trade liberty for some temporary security, deserves neither liberty nor security" - Benjamin Franklin
    "Make yourself sheep and the wolves will eat you" - Benjamin Franklin
    "Symbolism is for the symbol minded" - George Carlin




  5. #5
    Join Date
    Aug 2012
    Location
    Victoriaville, QC, Canada
    Posts
    53

    Default

    Yes, that could work. I'll look into it.

    At first I was hoping to get the current mode from one of the system variables but your idea might be viable too. Thanks for the input.

  6. #6
    Join Date
    Aug 2012
    Location
    Victoriaville, QC, Canada
    Posts
    53

    Default

    I feel really stupid when I find out that things did not work as expected because I made an obvious programming error...

    So in case it can benefit others, in a sbp file, it is possible to detect that we are running with an offset for X and Y by testing system variables 61 (for x offset) and 62 (for y).
    What I do is something like this:

    &tmpoff = abs(%(61)) + abs(%(62))
    if &tmpoff > 0.001 then goto runningwithoffset

    sorry again for creating this post for nothing really.

  7. #7
    Join Date
    Dec 2000
    Location
    Thorp, WI
    Posts
    2,724

    Default

    Good job, glad you got it worked out! What was your error, just a little syntax?

    It wasn't for nothing, someone else may come across a similar situation and now there's answer.

    "He who would trade liberty for some temporary security, deserves neither liberty nor security" - Benjamin Franklin
    "Make yourself sheep and the wolves will eat you" - Benjamin Franklin
    "Symbolism is for the symbol minded" - George Carlin




  8. #8
    Join Date
    May 2014
    Location
    MA
    Posts
    523

    Default

    Hey Mark, I'm genuinely curious as to why you didn't just repeat the job in VCarve/Aspire instead of writing a custom post? I'm sure there's a reason, I'd be interested in knowing what it is.

  9. #9
    Join Date
    Aug 2012
    Location
    Victoriaville, QC, Canada
    Posts
    53

    Default

    [QUOTE=srwtlc;207356]Good job, glad you got it worked out! What was your error, just a little syntax?

    The error was that I forgot the first line «&tmpoff = abs(%(61)) + abs(%(62))» at one point in time in my tests so I was always testing with a previous value for &tmpoff... silly me

  10. #10
    Join Date
    Aug 2012
    Location
    Victoriaville, QC, Canada
    Posts
    53

    Default

    Hi Eric,

    I'm not sure I understand your question but I hope this clears things:

    I am using a custom post processor because the toolpath that I am running using a laser to engrave some logo.

    Last year, when I installed my laser, I had to write a new post processor for VCarve because the way my laser is turned on and off is different than the way a router (or spindle) is turned on or off.

    Because of those differences, I had to add a couple of lines at the beginning of my post-processor to PAUSE the operation and remind the user to put on his protective goggles and so on.

    Everything was fine until recently wher I had to put the same logo on multiple wood pieces. So I manually wrote a small sbp file with a series of M2 commands followed by an FP command. With the FP command, you can set an offset-mode and tell it to run the specified sbp file from the current x,y without having to change anything in the sbp file. I think this can also be done with another command (VO maybe??).

    The problem was that the PAUSE and the warning from my laser sbp file was popping for every part I wanted to engrave, not just the first one - so it was impossible to leave the shop and have the shopbot do all the work. Now, I changed my laser post processor in order to check whether the sbp file is being run with an offset - meaning it's probably a multiple copy operation and therefore avoid the PAUSE statement.

    Note that I never had to do multiple part with a standard router-cut file so I don't know whether a standard sbp file (one with one of the provided post-processor) have the same issue that I had with the file I created from my laser post-processor.

    Is this clearer ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •