Hello Guest it is March 28, 2024, 08:27:06 AM

Author Topic: Variables reading and writing  (Read 16917 times)

0 Members and 1 Guest are viewing this topic.

Offline Bodini

*
  •  216 216
    • View Profile
Re: Variables reading and writing
« Reply #30 on: May 18, 2014, 04:23:18 PM »
found this worked to 15000 for me (at least I did not get any messages, so assume it works)

    if (v1 < -1000000 or v1 > 1000000) then
        --filters out big numbers
    elseif v1 ~= 0 then
        l1output = string.format ("%5d = %0.6f \n",rowno,v1)  --formats registry var number for writing
        file:write(l1output)  --writes to file
    else
    end

Thanks Nick ya did good. nice to have new tools.  ;D

Nice one, Craig.  I had a feeling it could be improved on, but once it worked for me i said 'screw it' and quit for the night. ;-)
Re: Variables reading and writing
« Reply #31 on: May 18, 2014, 06:19:08 PM »
Added a Feed Rate Over Ride DRO and took the view variables idea to the next step and put all values not equal to zero in a combobox

The update button is attempt to update the combo box, haven't quite got the handle on getting that to work as of yet.  :P
« Last Edit: May 18, 2014, 06:23:30 PM by Ya-Nvr-No »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Variables reading and writing
« Reply #32 on: May 19, 2014, 11:39:57 PM »
HIYA Craig, In your Var list  is shows

#define CURRENT_X      5021
#define CURRENT_Y      5022
#define CURRENT_Z      5023
#define CURRENT_A      5024
#define CURRENT_B      5025
#define CURRENT_C      5026

These appear to be machine coords, would you know what the work coords numbers are ? 

Also you can add to the upper list #500 -#600 are global persistant vars's

(;-) TP

Re: Variables reading and writing
« Reply #33 on: May 20, 2014, 07:02:15 AM »
Lets hope they get to all Fanuc variables someday, I used to love 3001 for getting run times, when I had to meet a cycle time.
there is a slew of great variables which would be nice to see implemented.
Found variables one of the best ways to keep people from editing your program.
What they don't see they can not change.
I could change positions mcodes, feedrates, tools, spindle speeds just as an example while a program was running by just changing the variable before the next time it called it.
Great for production runs when you can't stop edit and then restart.
Perfect for when your doing an evaluation on new tooling with a salesman
create a variable using 3001 to update your cycle timer then during the run tweak some variables and see how the changes effect overall times.
If nothing else Mach4/Macro B should make better programmers out of the people that write programs.
As a desktop simulator, saves on testing at the machine.
Just that feature alone should sell Mach4 to industry, prove to yourself and your boss your program works before you get that machine time.

This link is a great resource for learning Macro B programming
http://www.machinetoolhelp.com/Applications/macro/macro_variables.html

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Variables reading and writing
« Reply #34 on: May 21, 2014, 11:46:38 AM »
YEP those #var are darn handy.

But The 2 series we have to use  BOTH are in MACHINE Coordinates  and are for the most part useless

#define CURRENT_X      5021

#define Last_Output_X     5001

Hopefully Soon we will get it all updated /Fixed ,etc

(;-) TP