585,676 active members*
5,844 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > Adding user toolbar buttons in PlanetCNC TNG software
Page 1 of 2 12
Results 1 to 20 of 28
  1. #1
    Join Date
    Nov 2015
    Posts
    260

    Adding user toolbar buttons in PlanetCNC TNG software

    https://planet-cnc.com/adding-user-t...-tng-software/

    Does this also work in the TNG v2 software?

  2. #2
    Join Date
    Jun 2017
    Posts
    143

    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
    Join Date
    Feb 2011
    Posts
    138

    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
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Jun 2017
    Posts
    143

    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
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Nov 2015
    Posts
    260

    Re: Adding user toolbar buttons in PlanetCNC TNG software

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

  8. #8
    Join Date
    Jun 2017
    Posts
    143

    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
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Jun 2017
    Posts
    143

    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
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Feb 2011
    Posts
    138

    Re: Adding user toolbar buttons in PlanetCNC TNG software

    sorry for late reply....
    Attached Files Attached Files

  13. #13
    Join Date
    Nov 2015
    Posts
    260

    Re: Adding user toolbar buttons in PlanetCNC TNG software

    Danke!

  14. #14
    Join Date
    Feb 2011
    Posts
    138

    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...Click image for larger version. 

Name:	screen_buttons.jpg 
Views:	2 
Size:	37.2 KB 
ID:	442326

  15. #15
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Feb 2011
    Posts
    138

    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
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Feb 2011
    Posts
    138

    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
    Join Date
    Nov 2015
    Posts
    260

    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
    Join Date
    Jun 2017
    Posts
    143

    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

Similar Threads

  1. Is the PlanetCNC software license transferable?
    By retrosmith in forum PlanetCNC
    Replies: 3
    Last Post: 01-23-2019, 02:25 AM
  2. Adding buttons to Mach 3
    By Jkountz in forum Mach Wizards, Macros, & Addons
    Replies: 6
    Last Post: 02-24-2013, 07:48 PM
  3. Some help with EMC2, adding buttons....
    By Vegabond in forum LinuxCNC (formerly EMC2)
    Replies: 4
    Last Post: 08-27-2009, 05:37 PM
  4. Plot toolbar and user interface
    By single phase in forum NCPlot G-Code editor / backplotter
    Replies: 6
    Last Post: 10-11-2006, 08:39 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
  •