Saving configuration to EEPROM by script

7 years 7 months ago #29531055 by VRTECH
Dear All,
I use a FBL2360 controller with a script.
After looking at almost of forum subject and taping key for search to reslve my problem, i come today
to ask for a support solution that, i think, is not describe in document user manual and forums.

Like describe in the tittle a want to save the configuration of the controler to EEPROM.

I use a closed speed loop with hall sensor.
In configuration parameters, i do not use the HALL Min limit and Hall Max limit.

So i use this both register to save 2 values that change in my script and need to be loaded in next turn ON power.

I know that is not good to save by script to EEPROM many times, so i use a input to only save when i request by external.

Here is my code :
CRot = 0
Ctrans = -10
SAVEPOS = Getvalue(_DIN,1)
if SAVEPOS = 1 Then
SetCommand(_GO,1,0)
SetCommand(_GO,2,0)
'wait until motor 1 is stopped
Do
HC1=GetValue(_BLRCNTR,1)
wait(50)
Loop While HC1 =0
'wait until motor 2 is stopped
Do
HC2=GetValue(_BLRCNTR,2)
wait(50)
Loop While HC2 =0
'Set values to the configuration parameters
SetConfig(_BHL,1,CRot)
SetConfig(_BLL,1,CTrans)
'Sauvegarde de la configuration dans EEPROM
SetCommand(_EESAV,1)
End if

Please can you tel me what is wrong and what i must do to save correctly ?

Thank you in advance for your support
Best regards

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

7 years 7 months ago - 7 years 7 months ago #29531058 by TechSupport
The command you sent for saving is correct, but it may be that the script itself isn't actually setting those values.

First verify that the script makes the actual changes(configurations) and run it. To verify, run the script, and then go to the configuration tab and click on "Load from controller". Look for the changes. If it didn't change over, then likely there is a bug in the scripting commands that is causing the changes to not occur.

If you are trying to save ram data such as counts and other things that are collected, then that is a different issue.

There is a way to do it, but I'll have to get back to you on how to do this.

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

7 years 7 months ago #29531061 by roboteq
Replied by roboteq on topic Saving configuration to EEPROM by script
Also, while it is generally safe to store data in configuraton parameters that are unused, best is that you use the _EE . These are reserved for users. They are signed 16-bit.

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

7 years 7 months ago #29531062 by VRTECH
Dear thank you for your quick answer.

I want to save two constructed integer counter.

So i have read that it is quite easy to store those values in configuration parameters that are unused.
That is what i have tried. and problem related previously.

All i want to do is to store two value somewhere in the EEPROM. So i can get them back on next power ON

DIM CRot as integer
DIM CTrans as integer
...
'Somewhere in the script i do a change on those variables.
CRot = 2222
CTrans = -111
...

Then i want to save to EEPROM like describe previously.
Please can you give me a sample code that work for save to EEPROM two values (-6000;6000).
No matter where are they stored.
I just wan to read them on next power ON.

Thank you again

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

7 years 7 months ago - 7 years 7 months ago #29531063 by TechSupport
setconfig(_ee, 1, value to store)
setconfig(_ee, 2, value to store)

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

7 years 7 months ago #29531064 by VRTECH
Dear sorry but i do not find the _EE command in the user manual.
I have only _EES that is the short of _EESAV.
Thank you.

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

7 years 7 months ago #29531065 by VRTECH

TechSupport wrote: setconfig(_ee, 1, value to store)
setconfig(_ee, 2, value to store)


Thank you.
I the roboteq utility help page there is no _ee describe in setconfig parameters table.
In the Nextgen usermanual, i can not find this.

So i agree to test those line but then what must i call to get data on next power ON ?

Best regards

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

7 years 7 months ago #29531066 by TechSupport
getconfig(_ee, 1)
getconfig(_ee, 2)

This is an undocumented feature.

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

7 years 7 months ago #29531067 by VRTECH

TechSupport wrote: getconfig(_ee, 1)
getconfig(_ee, 2)

This is an undocumented feature.



Ok thank you for your support. I will test this tomorow morning and will tell you.

Event if you have a good product you also have a very good support.

Thank U again, sure i will keep roboteq controller for all new system/ industrial system requestig brushless.

Best regards

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

7 years 7 months ago #29531072 by VRTECH
Ok i have tested and it works fine.
Best regards

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

Time to create page: 0.102 seconds