Integrating a USB stick
This section shows you how you can integrate a USB stick in TwinCAT/BSD. Check the USB configuration beforehand. To do this, use the command dmesg
to check whether the USB stick appears in the system messages:
umass0: <Generic Mass Storage, class 0/0, rev 2.00/1.01, addr 2> on usbus0
umass0: SCSI over Bulk-Only; quirks = 0x4101
umass0:1:0: Attached to scbus1
da0 at umass-sim0 bus 0 scbus1 target 0 lun 0
da0: <Generic Flash Disk 8.07> Removable Direct Access SPC-2 SCSI device
da0: Serial Number 2EFBC899
da0: 40.000MB/s transfers
da0: 3900MB (7987200 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>
The details of the make, device file (da0), speed and capacity may vary depending on the device.
Requirements:
- The USB stick is formatted with FAT32.
- Connect the USB stick to the Industrial PC.
Proceed as follows:
- 1. Enter the command
gpart show
to search for a FAT partition on the USB stick. The USB stick in this example has a FAT32 partition and a size of 3.8 GB. See entry:1 fat32 (3.8G)
Administrator@CX-3B151A$ gpart show
=> 40 7728256 ada0 GPT (3.7G)
40 409600 1 efi (200M)
409640 2008 - free - (1.0M)
411648 7315456 2 freebsd-zfs (3.5G)
7727104 1192 - free - (596K)
=> 63 7987137 da0 MBR (3.8G)
63 737 - free - (369K)
800 7986400 1 fat32 (3.8G)
Administrator@CX-3B151A$
- 2. Enter the command
ls /dev/da0*
to determine the name of the FAT32 partition.da0s1
orda0p1
.
ls /dev/da0s1
/dev/da0 /dev/da0s1
- 3. Enter the command
doas mkdir /mnt/usb
to create the directory/mnt/usb
. - 4. Enter the command
doas mount -t msdosfs /dev/da0s1 /mnt/usb
in order to mount the USB flash drive under/mnt/usb
. - 5. Use the command
cd /mnt/usb
to navigate to the mount point of the USB flash drive.
- 6. Use the command
ls
to display all the folders in the directory.
- You have successfully integrated a USB stick in TwinCAT/BSD. The settings are not permanently saved. Following a restart the USB stick must be integrated again.
USB devices can also be integrated automatically. This function was disabled ex works in order to increase the safety of TwinCAT/BSD. Further information on the automount service can be found at: https://www.freebsd.org/doc/handbook/usb-disks.html