In general since Control plus Studio V5.8 includes environment variables that can be used in every object for every parameter:
You can also create your own environment variables, very helpful also for simulation:
But there is a limitation on file access with TwinCAT. TwinCAT can access only files with a local path "C:\..." or "D:\...", not on any network path (even if this path is targeting to the local harddisk) and not on any mapped network drive.
That is why this robot parameter must be a path like "D:\OpconData\...", see also our example project Digital Machine:
PS: If you are doing cyclic file backups of your target system data (e.g. with MES CyclicUpdate) I do not recommend to save the log file inside the main robot directory. Otherwise every log entry will trigger the backup routine:
... View more