Unable to Access (Read / Copy) files from C:/ when using ARsim in AS 6.3

Hello,

I am in the process of upgrading my project from AS 4.12 to AS 6.3 and i am running into an issue accessing local files in simulation. The main software that i use to control the machine generates a gcode file that it is only able to place in “C:/CNC”. On an actual machine i am able to copy that file to the USER FileDevice and run it from there without issue. However i do a lot of testing in sim and previously in AS 4.12 I was able to make a file device for C:/CNC and was able to run the gcode from there.

I saw some topics mentioning that i cant write to the C: drive in sim which is fine, but no matter what i try i am unable to read files from it.

I tried creating a Devlink connection to C:/CNC and i am able to generate a handle. However if i try to use DirInfo to verify the device is connected i either receive 20723 fiERR_DIR_NOT_EXIST, or 20798 fiERR_DEVICE_MANAGER. Thinking maybe there was just an issue with that function block i then directly tried DirCopy with the same result.

Instead of connecting with Devlink I tried setting it up as a FileDevice like before but i ran into the same issues with DirInfo and DirCopy.

There has to be someway to read from the C:/ drive when in simulation. Any help would be much appreciated.

I do realize i can manually on my PC copy files to the USER directory but my project has over 30 configurations some of which have very similar names and it would be very easy to copy the files to the wrong config when testing. This is very inconvenient especially when it would need to be done every time i make a change in my program and want to see how sim responds to it.

Hello and welcome to the Community,

See the reason why you can’t access Windows C:\ in the help (“In Automation Runtime 6, the ARsim drive mappings for C: to F: have been changed. These drive letters no longer correspond to the Windows system drives C: to F:. Instead, they now point to the system folder within Automation Runtime, namely to the Temp\Simulation directory.”).

The best would be to use USER_PATH instead of the drive letter. It works with a real PLC as well as with ArSim. USER_PATH maps to the \Project\Temp\Simulation\Configuration\CPU\USER in the ArSim, see details.

You can copy folders from Windows C:\ to the user partition while doing offline commissioning of the ArSim.

1 Like

Hello,

The system has changed to better suite the switch between Simulation and Real PLC,
and to secure the Filesystem on PLC and on your Windows PC aswell.

If you want to have a common Directory i think there is a posibility to use the upward change dir ..\ ; in the past i have used it to access a Directory in my Logical View.
I think this could still work. But you have to try it.

This example leads to the Folder CFFiles in Root of Logical View.
image

With some adaption you may get up to the C:
Good luck in Testing.

Greetings
Michael

3 Likes

Hi,

Another possibility is to use symlinks to create a link between your “C:\CNC” and the simulation USER folder, a problem by using it is that if you make an initial installation of the ARSim or delete temporary files the symlink will be deleted too.

Regards,
Florent

This seems to be the best option and after testing it worked. Thank you.

Some notes for people that find this post later is i got error 9999 ERR_NOTIMPLEMENTED when trying to use the upward change dir for a devlink connection. Setting it up directly as a file device in the cpu configuration works however. Also if you go upward say 10 directories but the root (in my case C:/) is only up 6 directories it will still start at the root. Since me and my coworkers who also need to work on the project have our githubs in different directories i just need to put extra dir changes and it will work for us both.

Ex: File Device Path “USER_PATH\..\..\..\..\..\..\..\..\..\..\CNC“ (10 Dir up)

C:\Users\Name\Documents\GitHub\PLC_Project\Temp\Simulation\Config\5PPC3100_KBU1_000\USER

C:\GitHub\PLC_Project\Temp\Simulation\Config\5PPC3100_KBU1_000\USER

Both of the above paths will resolve to C:\CNC

2 Likes

Please note that in AS6 / AR6 we try to prevent the user from accessing the host file system outside the ARSim working directory. So this relative back moving in directory structure could be disabled in the next releases.

Last correction was made in AR6.5.0 with QCAS-3216 reference. see revinfo AR 6.5.1 RevInfo | B&R Industrial Automation

2 Likes

While I understand making directories dynamic and consolidating all files to the USER FileDevice for simplicity when in simulation making it impossible to access the local file system seems like a bad idea.

In my case for example my external program that runs my machine updates the files in the C:/CNC every time that start cycle is initiated. And i cant dynamically change the location it saves the files/ at the very least it doesn’t know which config folder it needs to write to so i would have to manually adjust this every time i test a different configuration. Like what is the benefit to removing a basic feature like accessing the host file system.

1 Like

as you said JB this was just a workaround for arsim not for real machine so not very critical issue.
If in the future with new release that workaround will not work I’m sure Michael’s creativity will find another workaround.
We are already busy on testing new fixes we got from R&D, let’s focus on them…HeHe

Ciao
Valerio