Saving parameters after shut down

More
13 years 5 months ago #34976 by tld70
Now I got you,

It works perfect

Thank you


Thomas

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #34995 by mariusl
Hi ArcEye
Two things. The wiki contains incorrect descriptions of the pins - like this F.00 instead of F-00
Code:
Then you can link say the hal-pin of a spinbox to paramsaver.invalueF.00 and the new param-pin of the spinbox to paramsaver.outvalueF.00 Set paramsaver.writetrigger to true and create a file Set paramsaver.readtrigger to true and the value will be inserted back into the spinbox.

Secondly, I have a problem getting a spinbox to value to the file value. These are the two lines that I use to connect the lot.
Code:
#setp pyvcp.spinbox.1.param_pin [THC]VOLT_SETTING ---------------- this one works net init_volts pyvcp.spinbox.1.param_pin paramsaver.outvalueF-01 ------------- this remains 0 net involt pyvcp.set-volts => paramsaver.invalueF-01 -------------- this is spinbox 1

Regards
Marius


www.bluearccnc.com

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago - 13 years 5 months ago #35004 by mariusl
I have done some more testing. It would seem that the read on start up is not doing what is expected. The write at shut down works fine. I had to explicitly trigger the read function with an edge detector on the halui.machine.is-on pin.

I dont know if precedence has something to do with what is not happening.

Regards
Marius


www.bluearccnc.com

Last edit: 13 years 5 months ago by mariusl.

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago - 13 years 5 months ago #35005 by ArcEye
Hi

The wiki contains incorrect descriptions of the pins - like this F.00 instead of F-00


Sorted out, thanks for the heads up.

I have done some more testing. It would seem that the read on start up is not doing what is expected


I'll be able to look at it later today. Read obviously won't work if the file doesn't exist or it cannot open it for some reason.
I have forgotten most of it already, but a quick scan of the code shows that it should work so long as it was loaded with onstart=1

I'll get back to you

regards
Last edit: 13 years 5 months ago by ArcEye.

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago - 13 years 5 months ago #35007 by mariusl
ArcEye
The file is present and can be read as I do with the manual trigger. It does not give any error but the values are all zero when I look at it in HAL. So the comp function as I see it, it is just the read at start up that seems to have a timing issue or something else.

Regards
Marius


www.bluearccnc.com

Last edit: 13 years 5 months ago by mariusl.

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago - 13 years 5 months ago #35018 by ArcEye
Hi

Typically I cannot reproduce this

I had a file ~/linuxcnc/param.sav which contained
10.000000
20.000000
30.000000
40.000000
50.000000
60.000000


From a terminal I did

root@INTEL-QUAD:/prog/EMC/Userspace_modules/paramsaver# halrun
halcmd: loadusr ./paramsaver f=6 onstart=1 onexit=1
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
5 float IN 0 paramsaver.invalueF-00
5 float IN 0 paramsaver.invalueF-01
5 float IN 0 paramsaver.invalueF-02
5 float IN 0 paramsaver.invalueF-03
5 float IN 0 paramsaver.invalueF-04
5 float IN 0 paramsaver.invalueF-05
5 float OUT 10 paramsaver.outvalueF-00
5 float OUT 20 paramsaver.outvalueF-01
5 float OUT 30 paramsaver.outvalueF-02
5 float OUT 40 paramsaver.outvalueF-03
5 float OUT 50 paramsaver.outvalueF-04
5 float OUT 60 paramsaver.outvalueF-05
5 bit IN FALSE paramsaver.readtrigger
5 bit IN FALSE paramsaver.writetrigger
halcmd : exit


As you can see the out pins were filled from the file.

When I quit, the file param.sav contained six 0.000000 values, as all the in pins were zero.

So all as expected? I take it you are using the newest version?

I do have to make some changes to restrict the number of pins that can be created and expand the number fields, currently run out at 99.
I will probably restrict to 1000, can't see any possibility that someone would need more than that, unless you have other ideas.
(probably 99 would be enough in reality)

Try the same test as above and see if it sheds any light on why your set up does not work like that

regards
Last edit: 13 years 5 months ago by ArcEye.

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds
Powered by Kunena Forum