This is a sample project for mounting a network share on a B&R PLC. The task creates a file device with the name "NET_DEVICE". This device name can the be used with all libraries that support files devices, e.x. FileIO.
Download the latest release from here.
The task uses a variable structure to communicate with the outside world that can also be used to interact with other tasks. The structure* looks as follows:
| Level 1 | Level 2 | Level Description | ||
| CMD | Used to trigger commands. | |||
|---|---|---|---|---|
| connect | Connect to network share | |||
| disconnect | Disconnect from network share | |||
| error_reset | Reset pendiing errors | |||
| PAR | Parameters tructure | |||
| server_name | Name of the network share. Use this name or IP address | |||
| server_ip | IP address ofthe network share. Use IP address or network name. | |||
| server_port | Port on the network target. Leave empty to use default port. | |||
| server_protocol | Type of network connection. Use ftp, cifs, nfs or tftp. | |||
| server_domain | Domain name. | |||
| server_share | Name of the network share on the target. | |||
| user_name | User name. | |||
| user_password | User password. | |||
| enable_connect | Used to enable/disable the connect and disconnect button in HMI. | |||
| can_ping | Indicates that the network share can be pinged. | |||
| is_linked | Indicates that the network share is linked. | |||
| ERR | Information about errors | |||
| no | Error number | |||
| state | State where the error occurred | |||
| status | Current status | |||
- Automation Studio 4.5
- Automation Runtime D4.52
Recommended task class is #8 with a 10ms cycle time.
- Remove state variable from PAR structure
- Added status variable to main structure
- Added disconnect command
- Ping is now executed all the time to detect connection interruption
- Added ping support
- Initial commit
