Hello Guest it is May 07, 2024, 11:15:15 AM

Author Topic: Jog Rate lost each shutdown  (Read 1512 times)

0 Members and 1 Guest are viewing this topic.

Jog Rate lost each shutdown
« on: July 29, 2021, 11:51:01 PM »
I asked about this a while back, but I don't think I got any replies.  Mach 4 doesn't save my current jog rate.  I can manually change it in the ini file and that works.  Am I doing something wrong?

Not a big deal, but just something I'd like to fix if possible. 

I am using the Avid screenset.  Mach 4.  Nothing unique. 

Thanks for the help.

Tony
Re: Jog Rate lost each shutdown
« Reply #1 on: July 31, 2021, 04:41:28 AM »
I think it depends on how Avid have set this up.. When you update the ini file manually which parameter are you changing? If you can upload the screenset I could have a look at it. Which mach4 build are using also?
Re: Jog Rate lost each shutdown
« Reply #2 on: July 31, 2021, 04:54:48 PM »
I am using Mach 4 Version 4.2.0.43222    Build 4322.  The profile is AvidCNC. 

In the machine.ini file, there is a variable on a line by itself:

JogRate=20.000000

Whatever I set that value to using Notepad, loads when I start Mach 4.   BUt if I change it in Mach 4, it is not ever saved.  I know it had to have saved a value at one point because it was set to something like 3 (not sure why).

Also, I am using an ESS  (WARP 9 - Build 253).

Thanks for the help!

Tony
Re: Jog Rate lost each shutdown
« Reply #3 on: August 01, 2021, 05:46:11 AM »
Hi,
you may be familiar with the ScreenLoad script, which as described populates all the screen elements
but what you may not be familiar with is the ScreenUnLoad script......it has code that saves all the pertinent data
for the next session.  Why not include an instruction to save the jog rate at the moment of shutdown?.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Jog Rate lost each shutdown
« Reply #4 on: August 02, 2021, 10:03:25 PM »
This is from the unload script...

--Save Jog Rate % to .ini
local valJogRate = scr.GetProperty("droJogRate", "Value")
mc.mcProfileWriteString(inst, "Preferences", "JogRate", valJogRate)

Doesn't seem to work though. 
« Last Edit: August 02, 2021, 10:05:58 PM by TonyMemphis »
Re: Jog Rate lost each shutdown
« Reply #5 on: August 04, 2021, 05:26:08 AM »
Hi,
 this is the code snippet that is the 'OnModify' event behavior of JogRate%:

Code: [Select]
local inst = mc.mcGetInstance()
local val = scr.GetProperty("droJogRate", "Value")
mc.mcProfileWriteString(inst, "PersistentDROs", "droJogRate", string.format (val)) --Create a register and write the machine coordinates to it

Which suggests that it is a string that must be written to the .ini file.

Try it and see.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Jog Rate lost each shutdown
« Reply #6 on: August 04, 2021, 06:39:54 PM »
Well, it looks like that is what it is trying to do.  The Value it gets is a string I think.

I deleted the JogRate line from the machine.ini file, then ran Mach4.  When I exited, the jog rate was saved.  But the next time I changed it and exited, it was not. 

Thanks for helping!  I appreciate it.  I may just drop a note to the AVID folks. 

Tony

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Jog Rate lost each shutdown
« Reply #7 on: August 08, 2021, 03:29:42 PM »
Like Craig suggested putting it in the shutdown script is good, but one extra thing is in your screen load script or first run of the PLC script is to use 'mc.mcJogSetRate' as a way of setting the jog rate but you will have to set this for all axis xyz etc.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Jog Rate lost each shutdown
« Reply #8 on: August 08, 2021, 05:21:44 PM »
Well, I must not be masking this clear.  Sorry!  But the AVID screen unload script DOES have code that is supposed to save the current jog rate.  But it doesn't.  The only time I can make it work is if I edit the machine.ini file with Notepad and remove the jog rate line.  After that, the rate is saved once but never again. 

Thanks,

Tony

Code: [Select]
--Screen unload
inst = mc.mcGetInstance()

if (Tframe ~= nil) then -- touch plate frame
Tframe:Close()
-- Tframe:Destroy()
end

if (ASframe ~= nil) then -- touch plate advanced settings frame
ASframe:Close()
-- ASframe:Destroy()
end

--Save Jog Rate % to .ini
local valJogRate = scr.GetProperty("droJogRate", "Value")
mc.mcProfileWriteString(inst, "Preferences", "JogRate", valJogRate)

-- check modified state of config files
pf.CheckAllConfigFiles()

Re: Jog Rate lost each shutdown
« Reply #9 on: August 10, 2021, 12:42:53 PM »
Well, after a lot of searching and reading, etc., I still can't make it work.  I can use mc.mcJogGetRate for a single axis and that works fine,  The problem seems to be the screen call doesn't ever return anything.  I tried getting the Values and Labels from numerous things on the screen and I never get anything but a nil or a "".   

I am using the AVID setup and my Mach 4 version is 4.2.0.4322.

Any ideas? 

This is what is NOT working:   local valJogRate = scr.GetProperty("droJogRate", "Value")

Thanks,

Tony