You can use all SD card instructions with an FP-XH Ethernet PLC even though it has no SD card slot. Instead of using an SD card for reading/writing data, the data is stored internally in the RAM.
Please note that data is not stored when the PLC is turned off.
The memory size is limited to 1MB.
FP_SD_GET_FREE_KBYTES returns the amount of free space.
Upon execution of an SD card instruction, the following checks are conducted:
Is an SD card present?
Is the cover closed?
Is the SD card write-protected?
During the execution, the SD memory access active flag (sys_bIsSDMemoryAccessActive) is TRUE, and the SD memory access done flag (sys_bIsSDMemoryAccessDone) is FALSE.
The execution of an SD card instruction is performed through multiple scans.
Upon completion of the execution, the SD memory access error flag (sys_bIsSDMemoryAccessError) turns to TRUE or FALSE, depending on the result. Use this flag to judge whether the SD card instruction has completed normally or abnormally when the SD memory access done flag (sys_bIsSDMemoryAccessDone) turns to TRUE. The error code is stored in a system data register which can be accessed using sys_iSDMemoryAccessErrorCode.
Only one type of SD card instruction can be executed at the same time. To execute more than one instruction, use flags such as the SD memory access active flag (sys_bIsSDMemoryAccessActive).
Use FP_SET_ERROR to clear error flags.
SD card instructions cannot be used in interrupt programs.
When one of the following errors is detected, completion is announced immediately and the SD memory access active flag does not turn to TRUE:
Error code | Name of error | Cause | Affected instructions |
---|---|---|---|
0 |
Completed without error |
||
1 |
No SD card | No SD card is installed, or the cover is open. |
All SD card instructions at the time of execution. |
2 |
Write-protection of SD card enabled | The SD card is write-protected. |
|
3 |
File/directory name error | The syntax for specifying the file name and directory is wrong or too many subdirectories were specified. |
|
4 |
File not specified | The specified file does not exist. |
|
5 |
File exists |
The specified file already exists. |
|
6 |
Reading error |
All read instructions at the time of execution. |
|
7 |
Writing error |
The specified file is write-protected. |
|
8 |
Wrong position |
The reading or writing position is wrong. |
At the time of execution. |
9 |
SD card full | There is not enough free capacity on the SD card. |
|
10 |
Wrong reading format |
Error in the conversion format when reading a file. |
At the time of execution. |
11 |
File access conflict |
The specified file is being logged or is being accessed via FTP. |
|
-1 to -99 |
Others |
All SD card instructions |
Specify the full path (up to 256 characters).
Do not specify the drive name.
Specify a file extension, e.g. .txt.
To save data in a file called abc.txt in the root directory, enter this: \abc.txt
To save data in a file called def.txt in a subdirectory called "sub", enter this: \sub\def.txt
To save data in a file called def.txt in a new subdirectory called "new", enter this: \new\def.txt
If two or more files are specified, error 4 "File not specified" occurs.
SD |
SDHC |
|
---|---|---|
File system |
FAT16 |
FAT32 |
Max. length of file name |
Supports long file names (VFAT) |
|
Max. capacity |
2GB |
32GB |
Max. file size |
2GB |
4GB |
Max. number of files (8.3 format) in root directory |
512 |
65535 |
Max. number of files (8.3 format) in sub directory |
65534 |
65534 |
Max. number of files (long format) in root directory |
170 |
21845 |
Max. number of files (long format) in sub directory |
56634 |
65534 |
Item |
Description |
Long file name |
255 bytes (256 bytes including full path) |
File name/directory name |
ASCII characters (16#20–16#7E) |