Saving parameters after shut down

More
13 years 5 months ago #35061 by mariusl
I am using the latest.
I can read the file under manual control but not when my complete system starts up. All the pins of the component are zero although the file has contents.
I am using the halui.machine.is-on for now to trigger a read and that suits me better for now.

Regards
Marius


www.bluearccnc.com

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

More
13 years 5 months ago #35103 by ArcEye
Hi

I have tried tests with loading the component with loadusr -W , thinking that might affect timings but makes no difference, the values from file are copied to the pins.

I can only suggest you try loading the component at the start of your main hal file and then reference it later in the custom_postgui.hal file, that should give plenty of time for it to initialize.
But I am not sure if it should actually make any difference.

I have added a debug printout into the file read which is only printed if onstart=1 at the initial read of the file.
See if that prints to stderr and contains the right file name.

Rename the file paramsaver.c and compile with comp --install --userspace paramsaver.c

regards


File Attachment:

File Name: paramsaver.txt
File Size:8.94 KB

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

More
13 years 5 months ago #35116 by mariusl
Hi
I load the component right at the start. Well just after my usbio component. I will try your debug print and see what it does.

Regards
Marius


www.bluearccnc.com

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

More
13 years 4 months ago #35284 by jlviloria
hello,

What a great job, works perfect .... but I have a doubt.

Variables:

paramsaver.writetrigger
paramsaver.readtrigger

what would be the most optimal way so there is no conflict with what you read, what you write.

I tried the following:
net machine-on halui.machine.is-on paramsaver.readtrigger
net machine-on paramsaver.writetrigger

but I work in a variable but in another nop.

I'm trying to use this for my chuck, ID / OD, open / close.

attached my files, I am trying to gmoccapy, which is the GUI I use, with classicladder.

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

More
13 years 4 months ago #35285 by mariusl
@jl

I used two edge components with a time-on delay of 2 seconds and a time-off delay of 0,

here is my code for that
Code:
loadusr -W paramsaver f=10 s=0 b=0 filename=mc200 onstart=0 onexit=0 loadrt edge count=2 addf edge.0 servo-thread addf edge.1 servo-thread setp edge.0.in-edge 0 #rising edge setp edge.0.out-width-ns 2000000000 setp edge.1.in-edge 1 #falling edge setp edge.1.out-width-ns 2000000000 ############### FILE SAVER ################### net plasmaOn edge.0.in edge.1.in net file_read edge.0.out paramsaver.readtrigger net file_write edge.1.out paramsaver.writetrigger

Regards
Marius


www.bluearccnc.com

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

More
13 years 4 months ago #35288 by mariusl
And this is how I used it
Code:
################# THCCALC #################### setp thc200.arc-threshold 10 net init_0 paramsaver.outvalueF-00 pyvcp.spinbox.0.param_pin net init_1 paramsaver.outvalueF-01 pyvcp.spinbox.1.param_pin net init_2 paramsaver.outvalueF-02 pyvcp.spinbox.2.param_pin net init_3 paramsaver.outvalueF-03 pyvcp.spinbox.3.param_pin net init_4 paramsaver.outvalueF-04 pyvcp.spinbox.4.param_pin net init_5 paramsaver.outvalueF-05 pyvcp.spinbox.5.param_pin net init_6 paramsaver.outvalueF-06 pyvcp.spinbox.6.param_pin net involt paramsaver.invalueF-00 net thc-vel-tol paramsaver.invalueF-01 net thc-cor-vel paramsaver.invalueF-02 net thc-win paramsaver.invalueF-03 net thc-min paramsaver.invalueF-04 net thc-max paramsaver.invalueF-05 net thc-delay paramsaver.invalueF-06 net involt pyvcp.set-volts thc200.set-voltage-in ############################# THC connections ################################## net thc-enable pyvcp.thc-enable thcud.enable #net thc-voltset pyvcp.volts-requested thcud.volts-requested #net thc-req-vel thcud.requested-vel motion.requested-vel #net thc-cur-vel thcud.current-vel motion.current-vel net thc-vel-status pyvcp.vel-status thcud.vel-status net thc-vel-tol pyvcp.vel-tol thcud.velocity-tol net thc-cor-vel pyvcp.thc-velocity => thcud.speed net thc-min pyvcp.thc-min thcud.min-offset net thc-max pyvcp.thc-max thcud.max-offset net thc-win pyvcp.thc-window thc200.voltage-window net ArcOK => pyvcp.arc-ok net volt_ok thc200.volts-ok => pyvcp.volts-ok net MoveUp => pyvcp.volts-under net MoveDown => pyvcp.volts-high net offset thcud.cur-offset => pyvcp.offset net thc-delay pyvcp.thc-delay timedelay.1.on-delay
I dont know why the forum box dont keep my formatting :(

Regards
Marius


www.bluearccnc.com

The following user(s) said Thank You: ArcEye

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

Time to create page: 0.205 seconds
Powered by Kunena Forum