585,712 active members*
3,644 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > BobCad-Cam > Using .CustomSettings in Lathe Post
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2008
    Posts
    65

    Using .CustomSettings in Lathe Post

    Ok, created LathePost.CustomSettings as follows:

    EDIT_BOX,1,REAL
    TEXT_LABEL,1,X (G53) Home
    DEFAULT_REAL,1,-10

    EDIT_BOX,2,REAL
    TEXT_LABEL,2,Z (G53) Home
    DEFAULT_REAL,2,-15

    Updated LathePost.LathePst as follows:

    2010. program_block_10
    EB_1 = LATHE_GetUserEditRealVariable(1)

    LATHE_OutputText("(<--DEBUG.2010: EB_1 = " & EB_1 & ")")

    'CALL LATHE_SetReturnString(EB_1)


    LATHE_OutputText indicates EB_1 = 0, no matter what numbers I enter into the Adv Post Tab? Am I using the LATHE_GetUserEditRealVariable(1) function correctly?


    Thanks
    Steve
    V28/29 4x Pro, Haas VF-3SSYT, Haas SL-30

  2. #2
    Join Date
    Apr 2008
    Posts
    1577

    Re: Using .CustomSettings in Lathe Post

    Nothing looks out of the ordinary. LATHE_GetUserEditRealVariable(1) is going to return the value typed into EDIT_BOX,2

    The API is picky about having a carriage return at the end of a *.Custom* file. Sometimes it won't read the last line. Maybe it's something that easy? You may have to post a sample file and your entire post processor (including the *.Custom* files) to track it down. I've never used the lathe side of the scripting.

  3. #3
    Join Date
    Aug 2004
    Posts
    55

    Re: Using .CustomSettings in Lathe Post

    I had some problems getting a EDM post working, I found I needed to use GetUserEditRealSettingsVariable not GetUserEditRealVariable.

    Just a tip but you can get quicker feedback using

    Code:
    	MsgBox ("(<--DEBUG.2010: EB_1 = " & EB_1 & ")")
    Then just comment out when you're happy.

    Mark.

  4. #4
    Join Date
    Oct 2008
    Posts
    65

    Re: Using .CustomSettings in Lathe Post

    Yes, your correct SBC Cycle, the API can be finicky, and some years back I came across the need for a carriage return (blank line) at the bottom of the post processor. Both the .CustomSettings and .LathPst files have carriage returns at the bottom of the file.

    HughesBros, I tried GetUserEditRealSettingsVariable() as well as others, but no luck, and yes, I do use MsgBox occasionally, however, to help teach post processing to new programmers, the LATHE_OutputText() function allows me to place the ouput directly in the code adjacent to its use. This helps the programmer learn exactly what the code is accomplishing.

    Thanks to both of you, I'll continue looking for an answer. If I get stymied I'll upload the two files.

    Thanks Again,
    Steve
    V28/29 4x Pro, Haas VF-3SSYT, Haas SL-30

  5. #5
    Join Date
    Apr 2008
    Posts
    1577

    Re: Using .CustomSettings in Lathe Post

    Actually, I believe Mark is correct. I forgot this was a *.CustomSettings variable you were trying to retrieve. If trying to grab a variable in the Advanced Posting page in the "Current Settings" dialog (not a Adv. Post page in a feature) MILL_GetUserEditRealSettingsVariable() is the correct usage.

    Remember the EDIT_BOX index is different than the MILL_GetUserEditRealSettingsVariable index. The EDIT_BOX index starts at 1 and the corresponding MILL_GetUserEditRealSettingsVariable index is (0).

    MILL_GetUserEditRealSettingsVariable(1) is going to grab EDIT_BOX 2 and so on. Just a reminder, you probably know but it's easy to forget.

  6. #6
    Join Date
    Oct 2008
    Posts
    65

    Re: Using .CustomSettings in Lathe Post

    SBC Cycle, you are correct and I believe it works fine in the MILL, but not the LATHE. My solution, and to perhaps help someone else, was to use the LATHE_GetUserEditIntegerSettingsVariable() as opposed to the Real, as follows:


    LathePost.CustomSettings

    EDIT_BOX,1,INTEGER
    TEXT_LABEL,1,X (G53) Home
    DEFAULT_INTEGER,1,-10

    EDIT_BOX,2,INTEGER
    TEXT_LABEL,2,Z (G53) Home
    DEFAULT_INTEGER,2,-15


    LathePost.LathePst

    2010. program_block_10, Sets Blocks 2 & 3 G53 Tool Change Position
    XH1 = LATHE_GetUserEditIntegerSettingsVariable(0)
    XH1 = XH1/2
    ZH2 = LATHE_GetUserEditIntegerSettingsVariable(1)

    If XH1 > 0 OR ZH2 > 0 Then
    MsgBox "Both X(G53) Home and Z(G53) Home Must be <= 0" & vbCrLf & _
    "Return to Turning Job->Current Settings->Adv Posting" & vbCrLf & _
    "to correct value(s)", _
    vbCritical + vbOkOnly, _
    "Critical Error - Click Ok to Continue"
    End If

    LCt = LCt + 1
    defaultMsg = "Using Default G53 Tool Change Postion" & vbCrLf & _
    "in Turning Job->Current Settings->Adv Posting" & vbCrLf & vbCrLf & _
    "G53 X-10. Z-15."

    If LCt = 1 AND XH1*2 = -10 AND ZH2 = -15 Then
    MsgBox defaultMsg, vbInformation + vbOkOnly, "Information Only - Click OK to Continue"
    LCt = 255
    End If

    CALL LATHE_SetXHome(XH1)
    CALL LATHE_SetZHome(ZH2)

    'LATHE_OutputText("(<--DEBUG.2010: XH1/ZH2 = " & XH1 & "/" & ZH2 & ")")
    LATHE_ProcessPostLine("n,'G00 G53',force_x,xh,force_z,zh")

    2011. program_block_11, Sets Blocks 3 & 5 G53 Rapid Postion for End of Tool Cycle
    CALL LATHE_SetXHome(XH1)
    CALL LATHE_SetZHome(ZH2)

    LATHE_ProcessPostLine("n,rapid_move,'G53',force_x, xh,force_z,zh")


    This works just rounds to an integer as opposed to a decimal. If anyone finds out why the LATHE_GetUserEditRealSettingsVariable() does not work, please let us know. If anyone would like to see the entire post just let me know.
    Thanks guys!
    Steve
    V28/29 4x Pro, Haas VF-3SSYT, Haas SL-30

  7. #7
    Join Date
    Apr 2008
    Posts
    1577

    Re: Using .CustomSettings in Lathe Post

    Doh, I see I accidentally said to use MILL_GetUserEditRealSettingsVariable and I meant LATHE_GetUserEditRealSettingsVariable() but anyway....

    I will try to run a simple script to verify what you are seeing. I'm working on my own lathe post at the moment so it wouldn't be hard to slip one in.

Similar Threads

  1. Replies: 4
    Last Post: 02-23-2015, 06:11 AM
  2. lathe Post for Dyna Myte 3000 lathe?
    By Big Chips in forum Dyna Mechtronics
    Replies: 2
    Last Post: 11-13-2014, 05:15 PM
  3. lathe Post for Dyna Myte 3000 lathe?
    By Big Chips in forum BobCad-Cam
    Replies: 0
    Last Post: 11-05-2014, 04:28 AM
  4. Lathe G81 MC post
    By Talon17th in forum Post Processors for MC
    Replies: 0
    Last Post: 06-08-2011, 01:49 PM
  5. CNC Lathe Post
    By RB222 in forum Community Club House
    Replies: 0
    Last Post: 10-02-2009, 02:58 PM

Tags for this Thread

Posting Permissions

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