Adding user toolbar buttons in PlanetCNC TNG software

Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: Adding user toolbar buttons in PlanetCNC TNG software

  1. #1
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0


  2. #2
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    It definitely does, with even more options. If you look for threads that I have posted in you will find my questions that where answered by the awesome developer.
    I have buttons that control my vacuum, compressor etc via the web and sonoff devices.

    Simon



  3. #3
    Member maki's Avatar
    Join Date
    Feb 2011
    Location
    Slowenia
    Posts
    138
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    I have add just 3 more button, that is vhat I need, look to my post's there is whole zip you need



  4. #4
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Quote Originally Posted by maki View Post
    I have add just 3 more button, that is vhat I need, look to my post's there is whole zip you need
    I can't find a .zip file in your posts. Can you remember the topic name?



  5. #5
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Have a read of this thread and see if it answers your questions.

    https://www.cnczone.com/forums/plane...ns-solved.html



  6. #6
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    And that's where my problems begin. I understand ...
    To create button for "User Command" use this:
    cmd: "Machine.User_Commands.UserCommand_1"
    ... Not.

    I have no idea where to find the file. Or can I have it created first?
    what does cmd mean?



  7. #7
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    OK, i find the .zip. i will try it ...



  8. #8
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    You need to create the files in your profile directory as in the old versions, otherwise it just uses the internal defaults. You can either just add to existing toolbars, or completely remove the default and do your own. You turn off the defaults in Settings->Toolbars->Buttons (hide). Doing that gives you complete control. The icons.zip file attached by planetcnc in that thread has example files.



  9. #9
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    OK. I have now got a button.
    The button should e.g. Execute M8.
    How is the code that it does while the machine is processing GCode.
    Second question is. the button should behave like a standard button. It should have a yellow background when active. If you press it again, it should execute a different code. Is that possible?



  10. #10
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    This is all possible. The thread I linked has lots of useful info, I suggest you read it all carefully. Sorry it is late here and I need some sleep. If you get stuck I can send you an export of my profile. It is massively customised and even has the ability to turn on/off stuff using my home automation. Let me know if you get stuck.
    Also the icons for buttons are best done as SVG files (from memory with a 50x50px workspace. Look at the ones in the icons.zip file to check the spces.

    Cheers
    Simon



  11. #11
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Your profile folder will definitely help me. But tomorrow is another day. Good night!



  12. #12
    Member maki's Avatar
    Join Date
    Feb 2011
    Location
    Slowenia
    Posts
    138
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    sorry for late reply....

    Attached Files Attached Files


  13. #13
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Danke!



  14. #14
    Member maki's Avatar
    Join Date
    Feb 2011
    Location
    Slowenia
    Posts
    138
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Just pay attention of exit pins, in file are MY OWN adjustemt !! Yours can way diferent!
    Look at top of the window, three new button apears...Adding user toolbar buttons in PlanetCNC TNG software-screen_buttons-jpg



  15. #15
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Unfortunately, it doesn't work as requested.
    When pressed, button 1 should execute code M63 P1 Q50 and light up yellow.
    If the button is pressed again, it should have the code code M63 P1 Q0 and the yellow light should go out.

    expr: "cmd('Machine.Start_Code', 'M63 P1 Q50')" "Button 1" imagechange="False" stroke=1 tooltip="PWM Set to 50"

    Another problem is that the button only works if no G code is processed.



  16. #16
    Member maki's Avatar
    Join Date
    Feb 2011
    Location
    Slowenia
    Posts
    138
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    Works for me, I have connected ext (4 in my case) with button nr.1, and in PP I have defined how - what it shoud do. Here is the part from PP which is delivered with TNG:

    begin HEADER

    "( [TP_FILENAME] )"
    "( File created: [DATE] - [TIME])"
    "( USBCNC Postprocessor )"
    "( Material Size)"
    "( X= [XLENGTH], Y= [YLENGTH], Z= [ZLENGTH])"
    "([FILE_NOTES])"
    "(Toolpaths used in this file"
    "([TOOLPATHS_OUTPUT])"
    "(Tools used in this file: )"
    "([TOOLS_USED])"
    "[N]G00G21G17G90G40G49"
    "[N]G80"
    "[N]M62 P2 Q1"
    "[N][S]M03"
    "[N] ([TOOLNAME])"
    "[N]G00G43[ZH]H[T]"
    "[N]M62 P4 Q1"
    "[N]M62 P6 Q1"
    "[N]M62 P8 Q1"

    "[N](Toolpath:- [TOOLPATH_NAME])"
    "[N]([TOOLPATH_NOTES])"
    "[N]G94"
    "[N][XH][YH][F]"

    meaning, which output shoud do something. Is the same if you go "machine/exit/output (1-8)



  17. #17
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    I would like to mention that I am not a programmer.
    Where should I copy the code to?



  18. #18
    Member maki's Avatar
    Join Date
    Feb 2011
    Location
    Slowenia
    Posts
    138
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    The code is in PP delivered with TNG software. It is in "Program Files\Planet CNC\Samples\Postprocessors\*.*" There is 3 of them, I dont know which one u are using... This is from Vectric PP.
    By the way, If u copy files from zip file shoud work without anny G code. Obtain if on "ext" buttons in TNG changing from red to green and back. Then u shoud just connect proper ext (1-8) from MB to do something fe. make connection with some SSR, start cooling, vacuum, etc.
    And I am not a programmer ider....;-)



  19. #19
    Member tantemay's Avatar
    Join Date
    Nov 2015
    Location
    Warendorf
    Posts
    260
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    The three buttons from the ZIP of you work. With this I can only switch the outputs on and off.
    But I want to switch a PWM signal output with it. To do this, code should be executed by pressing the button. But then it doesn't work with the yellow highlighted.



  20. #20
    Member theRat's Avatar
    Join Date
    Jun 2017
    Location
    Australia
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default Re: Adding user toolbar buttons in PlanetCNC TNG software

    This is how I do toggle buttons.
    In BtnTop.txt I add a line for the button
    Code:
    expr: "startcode('M910')" "" image="Icons/IMG_Compressor.svg" tooltip="Compressor" imagechange="true" stroke=3.0 updown="_compressor == 1" updatefast="true"
    This will use the variable _compressor to maintain the state. The you need to create a script file something line this:
    Code:
    (print,Start M910)
    
    
    O<Test> if[NOTEXISTS[#<_compressor>]]
      #<_compressor> = 0
    O<Test> endif
    
    
    O<Toggle> if[#<_compressor>]
      #<_compressor> = 0
      M63 P1 Q0
    O<Toggle> else
      #<_compressor> = 1
      M63 P1 Q50
    O<Toggle> endif
    
    
    (print,End M910)
    Hope this helps. Once again I suggest using svg's for you buttons as they scale properly if you change the size of the toolbar.

    Simon



Page 1 of 2 12 LastLast

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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Adding user toolbar buttons in PlanetCNC TNG software

Adding user toolbar buttons in PlanetCNC TNG software