I cannot use the File Operations structure, which I have used frequently in my projects with Automation Studio in version 4.9.2.46, in version 4.12.5.95. I have to switch to this version due to the controller I use (X90CP154_60_00). I will tell you the structure I have set up as I used it in previous projects and I would like to get ideas and help from you about why it is not in my current project.
The configuration I used in the old structure is as above. It works completely in the improvements I made in the code. If there was a problem there, I would have had the same problem in previous projects, so I donât think there is a problem with the code.
In my researches about the error, I realized 2 different points. First, I cannot use the D:\ path that I used in the image I threw above in this version. However, I could not find a place that explains exactly what I should write instead, the problem did not improve when I used A. I would appreciate if someone can explain this in detail.
Secondly, after every FILE_OPEN and FILE_CREATE operation after 4.12, FILE_CLOSE is executed. In version 4.9 I didnât do this and didnât have a problem, but this time I added a FILE_CLOSE under all FILE_OPEN and FILE_CREATE operations to be sure.
The configuration of the project I am currently using is as follows.
The first thing I do in my project is to open a file and try to read it. If the file does not exist, I automatically recreate it, but I get the following error when I try to open the file.
due to missing code I can only speculate, but here are my findings and input:
a) You used the name âHARDDISKâ in your old config but âHDDâ in your new one. Does your code reflect that change?
b) Regarding not being able to use "D:" anymore: See B&R Online Help, scroll all the way down to Error numbers - âfiERR_ACCESSâ explains: Read and write operations on the partitions of the safe module system (D: and E:) are no longer possible.
c) You assigned the letter "A:" - what device is it / should it be?
Regularly you have (had) access to C:, D:\ and E:\ (Safe Partition Scheme) and a User partition, which is meant for - guess - user files. You can create one in the same settings by specifying a minimum user partition size, itâs all the way up in the cpu configuration. It will then be located at F:. Starting from some (not so recent, but newer than the one you had before) AR, writing to the systemâs partitions was forbidden.
So the error might be either the A:\ partition or the rename of HDD (or a combination of both)
Regarding your file close: Every file open should be matched with a FileClose. A CPU only has so many handles for files and you could run out of them. It should not be a problem if you open a file once, but once you start opening files regularly you might be facing Error 20702: fiERR_NO_MORE_ENTRIES
a-) Yes, I made the change in the part used in the code. I defined a macro for this and updated it in the same way as below.
b-) I also discovered that D and E cannot be used by using the help, so I did not use it in my new project, as you can already see.
c-) I donât know exactly why I defined âAâ, I just looked at a B&R help page and I did it because I saw that an example was given in this way. Whatever I need to define here, I already want help from you on that subject. I have attached the screenshot of the help page I took as an example from B&R below.
When I make the settings as shown here, I get the following error when transferring the project. Even though I reduced the Mib to 10, it did not improve.
The system will have to make an initial installation since you need a new partition (F:) on the CF card. The easiest way would be to recreate the CF in a card reader if you have issues transferringâŚ
After I booted the controller and reconnected, I tried to set my partition settings as Marcel did and tried to embed my project again, but it didnât work. Is there any way to know the partition size I can use in my controller? Maybe 100 is too big for me.
I made all the changes you shared with me as you can see in the screenshots below and imported my project into the controller, but unfortunately I am still getting errors.
Then youâll have to check your code⌠The error number suggests the handle is invalid or something like it. To verify the user partition is fine, you can:
Use a sample task or create a minimal task with a FileCreate.
Configure FTP access to the user partition, so you can connect with a ftp client to check / modify / place files.