I have a text file at location "D:\temp\startup". When I try to open the startup file as shown attached figure, file open function returns "FFFFFF.." value? If you have any suggestion for solving problem, could you please help me?
Most likely you use a Runtime of SP19 or higher, because starting from this version the default setting is that only access to files in the PLC folder are allowed. This is for security reasons.
An example + more information which I got from the CODESYS support team when I had the same question:
** [SysFile]
PlaceholderFilePath.1=C:\tmp, $TMP$
PlaceholderFilePath.2=C:\IEC, $IEC$
PlaceholderFilePath.3=E:, $USB$
PlaceholderFilePath.3.Volatile=1
PlaceholderFilePath.3.View=1
PlaceholderFilePath.4=F:, $USB2$
PlaceholderFilePath.4.Volatile=1
PlaceholderFilePath.4.View=1
To make the placeholder visible in the "Device/Files" window, the view attribute must be set.
The volatile attribute is especially important for Linux-like systems, because here newly inserted disks are mounted in directories.
You can simply assign placeholders for additional drives in Windows and use them from IEC.
The inclined IEC developer then writes
sUsbDir : STRING := '$$USB$$';
sUsbDir2 : STRING := '$$USB2$$';
(with double dollar signs).
And the smart CODESYS programmer then uses, with the above configuration, either
sBaseDir : STRING := 'C:\IEC';
or
sBaseDir : STRING := '$$IEC$$';
Both will then work.
**
π
2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have the same problem. Some of the libraries I created over time depend on writing files to a folders like c:\Temp. I can confirm that proposed solution is not working with 3.5.20 Patch 2.
Can you please specify wich exactly .cfg file needs to be modified and in what way, in order to include c:\Temp in the SysFile path?
Thank you!
Last edit: micik 2024-08-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I have the same problem now with 3.5.20 Patch 3. Normally it works if I ad in CODESYSControl.cfg:
[SysFile]
ForceIecFilePath=0 (This told me codesys last time)
I try to use the placeholders but without success. Something special is that the Files are not in C:. The Plc Configuration Path is not as usual C:\ProgrammData\CODESYS\CODESYSControlRTEV3\, it's E:\Control.
Hi,
I have a text file at location "D:\temp\startup". When I try to open the startup file as shown attached figure, file open function returns "FFFFFF.." value? If you have any suggestion for solving problem, could you please help me?
BR
Necati.
Last edit: necati 2023-08-09
Most likely you use a Runtime of SP19 or higher, because starting from this version the default setting is that only access to files in the PLC folder are allowed. This is for security reasons.
You can allow the runtime to access files outside of this folder, but you have to modify the CODESYSControl_User.cfg. For the exact file name and it's location, see: https://faq.codesys.com/display/CDSFAQ/Location+of+the+configuration+file
Or ask the vendor of your PLC.
One option is to set the IecFilePath, but this limits it to only one folder. More flexible is to use placeholders similar to what you can find in the following link:
https://faq.codesys.com/display/CDSFAQ/SysFile%2C+Persistence+Manager%2C+Datalog+Manager
An example + more information which I got from the CODESYS support team when I had the same question:
**
[SysFile]
PlaceholderFilePath.1=C:\tmp, $TMP$
PlaceholderFilePath.2=C:\IEC, $IEC$
PlaceholderFilePath.3=E:, $USB$
PlaceholderFilePath.3.Volatile=1
PlaceholderFilePath.3.View=1
PlaceholderFilePath.4=F:, $USB2$
PlaceholderFilePath.4.Volatile=1
PlaceholderFilePath.4.View=1
To make the placeholder visible in the "Device/Files" window, the view attribute must be set.
The volatile attribute is especially important for Linux-like systems, because here newly inserted disks are mounted in directories.
You can simply assign placeholders for additional drives in Windows and use them from IEC.
The inclined IEC developer then writes
sUsbDir : STRING := '$$USB$$';
sUsbDir2 : STRING := '$$USB2$$';
(with double dollar signs).
And the smart CODESYS programmer then uses, with the above configuration, either
sBaseDir : STRING := 'C:\IEC';
or
sBaseDir : STRING := '$$IEC$$';
Both will then work.
**
As you mentioned, I have SP19 Patch 1. Your method worked successfully.
Thanks for your detailed explanation. ππππ
BR.
Necati.
Hi,
I couldn't solve the this problem. Could you help me please?
Hi,
I have the same problem. Some of the libraries I created over time depend on writing files to a folders like c:\Temp. I can confirm that proposed solution is not working with 3.5.20 Patch 2.
Can you please specify wich exactly .cfg file needs to be modified and in what way, in order to include c:\Temp in the SysFile path?
Thank you!
Last edit: micik 2024-08-17
Hello, I have the same problem now with 3.5.20 Patch 3. Normally it works if I ad in CODESYSControl.cfg:
[SysFile]
ForceIecFilePath=0 (This told me codesys last time)
I try to use the placeholders but without success. Something special is that the Files are not in C:. The Plc Configuration Path is not as usual C:\ProgrammData\CODESYS\CODESYSControlRTEV3\, it's E:\Control.