# Best Practice when dealing with CIFS with DevLink

**URL:** <https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073>\
**Category:** B&R Software & Runtime\
**Tags:** automation-runtime, library\
**Created:** [February 9, 2026, 5:52am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073 "2026-02-09T05:52:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel.chua](https://avatars.discourse-cdn.com/v4/letter/s/FF8800/32.png) [@samuel.chua](https://community.br-automation.com/u/samuel.chua)\
**Post date:** [February 9, 2026, 5:52am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/1 "2026-02-09T05:52:04Z")

</div>

Hi Community,

Was wondering if anyone had any best practices when using DevLink to access a CIFS network drive?

Is there anything we should take note (e.g. auto disconnections from Windows, etc).

Is there a way to know if the session is still valid? Or perhaps it is better to DevUnlink it every time after using it (read/write files).

Best,

Samuel

---

<div class="post-metadata">

**Author:** ![alexander.hefner](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/alexander.hefner/32/111_2.png) [@alexander.hefner](https://community.br-automation.com/u/alexander.hefner)\
**Post date:** [February 9, 2026, 6:03am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/2 "2026-02-09T06:03:46Z")

</div>

Hi,

from my past experience, a CIFS connection can be interrupted by Windows (for example when there are longer timespans with no data transfer) . If that happens, there’s no reliable way to detect a broken connection, and can lead to very long function blocks call times in status BUSY until the channel can be re-established.  
My recommendation is always using DevLink and DevUnlink together with the FileIO function blocks when accessing files via CIFS, and so to establish and close the channel every time when you need it.

Best regards.

---

<div class="post-metadata">

**Author:** ![samuel.chua](https://avatars.discourse-cdn.com/v4/letter/s/FF8800/32.png) [@samuel.chua](https://community.br-automation.com/u/samuel.chua)\
**Post date:** [February 9, 2026, 6:32am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/3 "2026-02-09T06:32:37Z")

</div>

Hi Alexander,

Thanks for the input! Sometimes we experience DevLink getting stuck at BUSY and seems like there were no way to terminate anything other than Warm Restart of AR. Perhaps what you described is exactly the cause.

---

<div class="post-metadata">

**Author:** ![stephan.stricker](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/stephan.stricker/32/105_2.png) [@stephan.stricker](https://community.br-automation.com/u/stephan.stricker)\
**Post date:** [February 9, 2026, 7:54am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/4 "2026-02-09T07:54:06Z")

</div>

Hi,  
if you only use the share rarely I would recommend to unlink the connection when you do not need it and then establish the connection every time you need it again. There has been an upgrade of the SMB/CIFS stack in AR 6.4. You could give that a try to see if it improves the connection.

Stephan

---

<div class="post-metadata">

**Author:** ![samuel.chua](https://avatars.discourse-cdn.com/v4/letter/s/FF8800/32.png) [@samuel.chua](https://community.br-automation.com/u/samuel.chua)\
**Post date:** [February 9, 2026, 8:32am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/5 "2026-02-09T08:32:44Z")

</div>

Hi Stephan,

Thanks for your input!

We will give AR 6.4 a try.

The application would sometimes require quite often access to the network drive. Depends on the machine’s condition but I guess general strategy would be reduce as much active connection as possible.

---

<div class="post-metadata">

**Author:** ![valerio.manenti](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/valerio.manenti/32/11712_2.png) [@valerio.manenti](https://community.br-automation.com/u/valerio.manenti)\
**Post date:** [September 2, 2026, 1:01am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/6 "2026-09-02T01:01:13Z")

</div>

Hi @alexander.hefner and @stephan.stricker ,  
instead using DevLink to access a CIFS network drive, what do think about FTP connection?

Use case:

- Hypervisor system
- PPC3100 HW
- GPOS windows
- cnc application
- On the HMI the g-code is generated on fly; when the operator press the run button, the HMI copies the cnc program to USER file device. The USER file device is configured as location for user program:

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/5/51f63fced2126ff54443c1c7a4437293872a9db3.png)

Thanks for your help  
Ciao  
Valerio

---

<div class="post-metadata">

**Author:** ![alexander.hefner](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/alexander.hefner/32/111_2.png) [@alexander.hefner](https://community.br-automation.com/u/alexander.hefner)\
**Post date:** [September 2, 2026, 6:25am UTC](https://community.br-automation.com/t/best-practice-when-dealing-with-cifs-with-devlink/10073/7 "2026-09-02T06:25:25Z")

</div>

Hi @valerio.manenti,

not sure about your concrete use-case:  
is the g-code always generated on the local USER partition, and the remote storage should just be used as backup / persistent storage? Or do you want to create, read, write files directly on the remote storage?  
As FTP is dedicated designed for file **transfer** , in my opinion it’s not usable for file **handling**. The’re some restrictions how files are accessed/accessible by FTP . Just one example: afaik, if you want to open a file, append some data, and close it using FileIO, beneath the surface using FTP it means: the file is transferred via FTP to your local RAM in the PLC, is adapted there, is is transferred back. And some functions for file handling (for example reading file infos) aren’t possible via FTP.

So my opinion:

- FTP is great for any transfer job from “remote to PLC and vice versa” - file copying, moving, backing up and so on - I personally prefer FTP if available for such tasks.
- If you need some kind of remote file handling (e.g. editing files, advanced folder handling, and so on), you should use CIFS but always use the complete procedure including opening / closing the connection via DevLink (at least from my experience).
- In general: independent of FTP or CIFS, I would always prefer doing **as much local file handling (on the local user partition) as possible** and using the remote system as “add-on”… Investing a bit time into some more lines of code (and architecture) will make the complete software much more robust against network & server failures, updates, restarts and other temporary breakdowns of the connection to the server (also: at least from my experience).

Sure, you’re on a hypervisor system, so a loss of network connection between GPOS and AR is very unlikely … but who bets on that the hardware architecture will never change to “something with a physical network in between”? 😉

Regards! Alex
