Saving parameters after shut down

More
09 Jan 2020 20:25 - 24 Dec 2020 13:28 #154481 by jurod
Hi
I have problem with paramsaver syntax. "safe tool change" . I would like the syntax and links to hal components. I need at the toolchange, write new tool to paramsavers. I would like to look into yours hal and ini.
I don't know how to use M68, with motion.analog-out-xx.

My hal:
# _DO NOT_ include your HAL commands here.
# Put custom HAL commands in custom_postgui.hal
# The commands in this file are run after the GUI loads

# **** Setup of spindle speed display using pyvcp -START ****

net spindle-vel-cmd-rpm-abs => pyvcp.spindle-speed

#prisavky s materialom
net appc halui.mdi-command-10 pyvcp.appc
net ap halui.mdi-command-12 pyvcp.ap
net am halui.mdi-command-13 pyvcp.am
net nul halui.mdi-command-14 pyvcp.nul


########################## FILE SAVER ###################################
#
loadusr -W paramsaver f=3 s=1 b=0 filename=memory_pins onstart=1 onexit=1

net material_in pyvcp.mat => paramsaver.invalueF-000
net material_out pyvcp.spinbox.0.param_pin <= paramsaver.outvalueF-000

net podlozka_in pyvcp.pris => paramsaver.invalueF-001
net podlozka_out pyvcp.spinbox.1.param_pin <= paramsaver.outvalueF-001

############################### Memory tool #########################################

net tool_number_in iocontrol.0.tool-number => paramsaver.invalueS-000
net tool_number_out ?????????????????? <= paramsaver.outvalueS-000

net writetrigger motion.digital-out-03 paramsaver.writetrigger
net readtrigger motion.digital-out-04 paramsaver.readtrigger

########################## FILE SAVER END ###################################

.......
Last edit: 24 Dec 2020 13:28 by jurod.

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

More
12 Jan 2020 09:13 #154666 by jurod
Please help me. Some example, link, reference, anythink.

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

More
14 Jan 2020 17:09 #154833 by andypugh
What problem do you have?

ie: What do you do, what happens, how is that different from what you expected to happen?

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

More
16 Jan 2020 06:45 - 24 Dec 2020 13:29 #154996 by jurod
I have problem with paramsaver, his syntax. Not worked.
But now i have progress with the paramsaver.
This works:
In custom hal:
loadusr -W paramsaver f=3 s=0 b=0 filename=memory_pins onstart=1 onexit=0 (onexit=0 it has to be)

net tool_number_in motion.analog-out-04 => paramsaver.invalueF-002
net tool_number_out <= paramsaver.outvalueF-002

net writetrigger motion.digital-out-03 paramsaver.writetrigger
net readtrigger motion.digital-out-04 paramsaver.readtrigger


in INI:
MDI_COMMAND=M120 M61 Q[#<_hal[tool_number_out]>]
REMAP=G88.1 modalgroup=1 ngc=g881 (The program that is called on the last calibrated axis)

The program:
o<g881> sub
M61 q#<_hal[tool_number_out]>
o<g881> endsub [1]
m2

Thanks.
Last edit: 24 Dec 2020 13:29 by jurod.

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

More
25 Dec 2020 11:32 - 25 Dec 2020 11:50 #193170 by jurod
Hi
Problem with "paramsaver" in version 2.8.0

For version 2.7.14 in the terminal compile command "halcompile --install --userspace /home/hcnc/linuxcnc/paramsaver.c" looks like this:

Extract from the terminal:
root@H61M-C:/home/hcnc# halcompile --install --userspace /home/hcnc/linuxcnc/paramsaver.c
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os  -o paramsaver /tmp/tmpgNP5a4/paramsaver.c -Wl,-rpath,/lib -L/lib -llinuxcnchal 
root@H61M-C:/home/hcnc#

Works OK on my config machine,
but for version 2.8.0 in the terminal compile command "halcompile --install --userspace /home/hcnc/linuxcnc/paramsaver.c" looks like this:
Extract from the terminal:
root@E8400:/home/hcnc# halcompile --compile --userspace /home/hcnc/linuxcnc/paramsaver.c
gcc -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os  -o paramsaver /tmp/tmpAzSwbK/paramsaver.c -Wl,-rpath,/lib -L/lib -llinuxcnchal 
root@E8400:/home/hcnc#
this no works. The paramsaver component was not created.

From the terminal LinuxCNC Errors:
File "/usr/bin/paramsaver", line 3
    paramsaver component
                       ^
SyntaxError: invalid syntax
pyvcp_options.hal:13: waitpid failed paramsaver paramsaver
pyvcp_options.hal:13: paramsaver exited without becoming ready
3626
3679
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

I have already installed "build-essential" and "linuxcnc-dev"
Where is the problem? Please help.
Last edit: 25 Dec 2020 11:50 by jurod.

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

More
25 Dec 2020 15:21 #193181 by tommylight

Where is the problem? Please help.

Well for one you are using ROOT on a Linux box, and that is never a good idea, from security standpoint and from the issues that arise with software that is made to run as a normal user with limited privileges, access to files and folders, etc.

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

More
25 Dec 2020 21:24 - 25 Dec 2020 21:43 #193194 by phillc54

halcompile --install --userspace /home/hcnc/linuxcnc/paramsaver.c
Works OK on my config machine


halcompile --compile --userspace /home/hcnc/linuxcnc/paramsaver.c
this no works. The paramsaver component was not created.


The second command only compiles the component it does not install it. You need to use the first command to install the component.

Edit:
linuxcnc.org/docs/html/hal/comp.html#_compiling
Last edit: 25 Dec 2020 21:43 by phillc54.

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

More
25 Dec 2020 21:48 - 25 Dec 2020 21:50 #193195 by jurod
BOOM!!!!! I'm stupid. I didn't notice the difference written --install and --compile. Thanks.
It's already working.
Last edit: 25 Dec 2020 21:50 by jurod.

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

More
30 Dec 2020 00:12 #193471 by andypugh
I have been keeping this in my inbox to get back to.

Glad that I didn't need to.

But I will point out that you should probably have saved the file as "paramsaver.comp" and used halcompile --install paramsaver.comp

You don't say if you pre-processed to a C file, but I assume so. There is no need.

The .comp file has the keywords to declare that it is userspace.

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

More
04 May 2021 07:38 - 04 May 2021 16:38 #207799 by jurod
Hi, I have a problem again. After a clean installation 2.8.1 i can't install paramsaver correctly.

From terminal>
hcnc@DH61SA:~$ sudo halcompile --install --userspace /home/hcnc/linuxcnc/paramsaver.c
gcc -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os  -o paramsaver /tmp/tmpbF1yoR/paramsaver.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
Paramsaver is not in the machine configuration.

I did the installation:
BUSTER
sudo apt-get install build-essential
linuxcnc-uspace-dev
linuxcnc-uspace-dbgsym

EDIT: solved
Last edit: 04 May 2021 16:38 by jurod.

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

Time to create page: 0.211 seconds
Powered by Kunena Forum