For my very first project at DMC, I was tasked with setting up a file handling system through B&R Automation Studio 3. The application was to create a CSV file, populate the file with the revelant information, and then move the file to a new folder. As a new engineer, setting up a brand new system architecture can be a little daunting, so I was happy to find that Automation Studio makes it extremely straighforward to set up paths to different folders on your local storage (in this case, a compact flash card) or external storage (USB).
Purpose: To set up locations to send files/data, both locally (compact flash card), and externally (USB).
- To setup a location, navigate to the File Devices tab (Configuration View > Double Click sysconf.br > File Devices tab).
- At this point, destination paths and names can be added.
- To add a location to the local Compact Flash, set the path to “C:\”. If the destination is a folder on the Compact Flash, set the path to “C:\foldername”.
- To add a location to a USB, insert a USB mass storage into the physical view (Physical View > Right click under USB 1 > Insert > usbms01). The slot listed to the right of the usbms01 becomes the path for the USB in the File Devices tab.
Now that your file devices are all set up, you're well on your way to setting up a fully functional file handling system.
I utilized B&R's filehandling function blocks (FileCreate, FileCopy, and FileDelete) to move files between different storage locations. If you're looking to add more complexity to your file handling system, B&R's FileIO library also contains function blocks to manipulate directories, link to networks, and read/write attributes. Overall, in doing my first project, I found the B&R platform easy to use, and conducive to file handling and manipulation.
Learn more about DMC's B&R Automation Studio programming services.