Hello Guest it is April 26, 2024, 04:20:43 PM

Author Topic: Set value high or low with button and save variable  (Read 942 times)

0 Members and 1 Guest are viewing this topic.

Set value high or low with button and save variable
« on: October 21, 2019, 01:12:11 PM »
Dear people,

I am programming some mach4 custom screen sets. But i want a button to set a variable High or low. So like some boolean to be true when the button is pressed and false when it is not pressed. I don't mean an output to be set high or low, but more like a variable to be true or false.

I also want to save a variable or value when i close mach4. I want to use that to let the machine know what tool is in the ATC spindle when i have closed mach4 and to let the machine know what tool is in the chuck when mach4 is opened the next day. like some eeprom or something.

Does someone know how to do this in lua and mach4?

Thanks in advance.
Kind regards,

Jelle

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Set value high or low with button and save variable
« Reply #1 on: October 21, 2019, 05:58:12 PM »
Jelle,

The best thing I have found to use is registers.
Here is a link to a Lua for Dummies I made.
It has some stuff on registers.
https://www.machsupport.com/forum/index.php?topic=39763.msg266718#msg266718
Hope it helps.

Bill
Re: Set value high or low with button and save variable
« Reply #2 on: October 22, 2019, 09:56:57 AM »
Thanks for the reply. It worked indeed and I can also use this to save the values. You saved me alot of headache