https://planet-cnc.com/adding-user-t...-tng-software/
Does this also work in the TNG v2 software?
https://planet-cnc.com/adding-user-t...-tng-software/
Does this also work in the TNG v2 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
I have add just 3 more button, that is vhat I need, look to my post's there is whole zip you need
Have a read of this thread and see if it answers your questions.
https://www.cnczone.com/forums/plane...ns-solved.html
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?
OK, i find the .zip. i will try it ...
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.
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?
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
Your profile folder will definitely help me. But tomorrow is another day. Good night!
sorry for late reply....
Danke!
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.
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)
I would like to mention that I am not a programmer.
Where should I copy the code to?
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....;-)
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.
This is how I do toggle buttons.
In BtnTop.txt I add a line for the button
This will use the variable _compressor to maintain the state. The you need to create a script file something line this:Code:expr: "startcode('M910')" "" image="Icons/IMG_Compressor.svg" tooltip="Compressor" imagechange="true" stroke=3.0 updown="_compressor == 1" updatefast="true"
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.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)
Simon