Saving parameters after shut down

More
13 years 5 months ago #34252 by mariusl
ArcEye,
I tested it on my simulator and it work great. I will integrate it with the machine as soon as I have my troubles sorted with the plasma THC.

Regards
Marius


www.bluearccnc.com

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

More
13 years 5 months ago #34255 by ArcEye

mariusl wrote: ArcEye,
I tested it on my simulator and it work great. I will integrate it with the machine as soon as I have my troubles sorted with the plasma THC.


Thanks for the feedback

regards

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

More
13 years 5 months ago - 13 years 5 months ago #34331 by ArcEye

It could do with making more efficient regards memory allocation, for the reasons Andy was outlining regards not being able easily to have dynamic arrays etc in a file compiled by comp.
Works perfectly well as is, just offends the OCD side of my nature. Next job on the jotter.


Found a way to do it, quite similar to your solution Andy.

Made a struct xstruct, which contained one of each type of pin.
Then declared the struct __comp_state with the 2 fixed bit pins and a dynamic array of pointers to xstruct.

Thereafter just had to allocate the right amount of memory for the struct __comp_state and hal_malloc each xstruct as required and populate the array.

I shall definitely do it this way again, gives powerful direct indexing but does not break comp compatibility for compiling

EDIT

Now no reason to have 32 pin limit, limit raised to 1000 (0-999) and a bit of code optimisation and clean up done

IF YOU HAVE EXISTING CODE USING THIS COMPONENT YOU WILL NEED TO CHANGE PIN NUMBERS TO 3 DIGIT FORMAT
eg paramsaver.outvalueF-00 becomes paramsaver.outvalueF-000

New .zip attached

regards



File Attachment:

File Name: paramsaver6.zip
File Size:11.19 KB
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 #34538 by ArcEye
Now posted on Contributed Components on the Wiki

wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...ents#Parameter_Saver

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

More
13 years 5 months ago #34971 by tld70
Hello ArcEye

I try to use your paramsaver.
How can I write my Spindle tool to this file?

net Spindelwerkzeug => paramsaver.outvalueF.01
this tells the pin does not exists

net wsw_testen paramsaver.writetrigger <= pyvcp.Spindelwerkzeug_setzen
this will work and write the fils ( with 0 bytes )

Do you have a exemple?

Regards
Thomas

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

More
13 years 5 months ago #34974 by ArcEye
Hi again Thomas

net Spindelwerkzeug => paramsaver.outvalueF.01
this tells the pin does not exists


The pin, if created, is called paramsaver.outvalueF-01 (dash not dot)

Also you are connecting to a signal only, which is OK as long as something else is connected to it to supply data.

In the zip is paramsaver.9 which is a compressed man file
copy to /usr/share/man/man9
and you will be able to get up the man page just using man paramsaver

If in doubt, you can always run the component through halcmd, to see what is created and what the syntax is
eg
Code:
root@INTEL-QUAD:/prog/EMC/Userspace_modules/paramsaver# halrun halcmd: loadusr paramsaver f=2 s=2 b=2 halcmd: show pin Component Pins: Owner Type Dir Value Name 5 bit IN FALSE paramsaver.invalueB-00 5 bit IN FALSE paramsaver.invalueB-01 5 float IN 0 paramsaver.invalueF-00 5 float IN 0 paramsaver.invalueF-01 5 s32 IN 0 paramsaver.invalueS-00 5 s32 IN 0 paramsaver.invalueS-01 5 bit OUT FALSE paramsaver.outvalueB-00 5 bit OUT FALSE paramsaver.outvalueB-01 5 float OUT 0 paramsaver.outvalueF-00 5 float OUT 0 paramsaver.outvalueF-01 5 s32 OUT 0 paramsaver.outvalueS-00 5 s32 OUT 0 paramsaver.outvalueS-01 5 bit IN FALSE paramsaver.readtrigger 5 bit IN FALSE paramsaver.writetrigger halcmd: exit

regards
The following user(s) said Thank You: tld70

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

Time to create page: 0.435 seconds
Powered by Kunena Forum