Hi.
I need to write/read simple settings files with content like NAME=VALUE.
I know about Recipe Manager, CAA File etc. - so I can solve it with different methods.
But I want to try find ready simple solution.
I check CmpSettings, but seems like it works only with CODESYSControl.cfg.
Is this a way to use it for my files?
I also check CAA Settings, but seems like it's not implemented in runtime.
Or maybe I missed some another lib?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I do something similar to what you describe.
My HMI with Codesys Soft PLC doesn't have user memory to save persistent variables.
So I save the value of the variable but not the name in a text file and load it when the system boots. It works great.
Yes, I know about CAA File and I can write wrapper for my task.
But it's not the simplest deal.
So I hope to find ready solution.
CmpSettings seems like exactly what I need, but I can't see a way to use it for custom files (only for CODESYSControl.cfg)
I can't understand the reason - I think, it will be fine to add input sFile to functions of this lib.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
easiest and fastest solution is to wrap the data in a structure and write/read this struct data as bin file:
fbFileWrite_Inst(
sNetId:= '',
hFile:= Filehandle,
pWriteBuff:= ADR(ProduktDaten),
cbWriteLen:= SIZEOF(ProduktDaten),
bExecute:= TRUE,
tTimeout:= T#5s,
bBusy=> ,
bError=> ,
nErrId=> udiFileWriteErrorId,
cbWrite=> udicbWrite);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I need to write/read simple settings files with content like NAME=VALUE.
I know about Recipe Manager, CAA File etc. - so I can solve it with different methods.
But I want to try find ready simple solution.
I check CmpSettings, but seems like it works only with CODESYSControl.cfg.
Is this a way to use it for my files?
I also check CAA Settings, but seems like it's not implemented in runtime.
Or maybe I missed some another lib?
Still interesting in any advices.
I do something similar to what you describe.
My HMI with Codesys Soft PLC doesn't have user memory to save persistent variables.
So I save the value of the variable but not the name in a text file and load it when the system boots. It works great.
To do this I use the CAA.File library
https://help.codesys.com/webapp/idx-CAA_FILE-lib;product=CAA_FILE;version=3.5.15.0
The included code examples help a lot.
Yes, I know about CAA File and I can write wrapper for my task.
But it's not the simplest deal.
So I hope to find ready solution.
CmpSettings seems like exactly what I need, but I can't see a way to use it for custom files (only for CODESYSControl.cfg)
I can't understand the reason - I think, it will be fine to add input sFile to functions of this lib.
easiest and fastest solution is to wrap the data in a structure and write/read this struct data as bin file:
fbFileWrite_Inst(
sNetId:= '',
hFile:= Filehandle,
pWriteBuff:= ADR(ProduktDaten),
cbWriteLen:= SIZEOF(ProduktDaten),
bExecute:= TRUE,
tTimeout:= T#5s,
bBusy=> ,
bError=> ,
nErrId=> udiFileWriteErrorId,
cbWrite=> udicbWrite);
In my case I need text files because operator must be able to edit it on his PC.