FB_RoboticsAutoTunePSeries - DeleteFile (Method)
|
Type: |
Method |
|
Available as of: |
V2.0.0.0 |
This chapter provides information on:
oTask
Delete a file from the controller.
With the method DeleteFile(…), a file with a specified name is deleted from the specified directory.
If only the file name is given, the path ide0:/ and the file name extension .DAT is added automatically.
Valid example names:
oExample -> the file ide0:/Example.DAT is deleted from ide0:
oide0:/Example.DAT -> the file ide0:/Example.DAT is deleted from ide0:
ousb2msd:1/Example.DAT -> the file usb2msd:1/Example.DAT is deleted from an USB device.
Valid but not a good practice:
oExample.DAT would result in deleting the file ide0:/Example.DAT.DAT
NOTE: The processing time of this function is a few hundred milliseconds. Therefore, it is a good practice that the call of this method is done in a dedicated file handling task, or that the cycle check of the task is increased with the function FC_CycleCheckTimeSet(…) when calling this method.
|
Input |
Data type |
Description |
|---|---|---|
|
i_sFileName |
STRING[255] |
File name of the file to be deleted. |
|
Output |
Data type |
Description |
|---|---|---|
|
q_etDiag |
General library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message. |
|
|
q_etDiagExt |
ET_DiagExt |
POU-specific output on the diagnostic. q_etDiag = GD.ET_Diag.Ok -> Status message q_etDiag <> GD.ET_Diag.Ok -> Diagnostic message |
|
q_sMsg |
STRING[255] |
Event-triggered message that gives more detailed information on the diagnostic state. |
|
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
|---|---|---|---|
|
OK |
0 |
Ok |
|
|
InputParameterInvalid |
44 |
File does not exist. |
|
|
49 |
A system file is addressed. |
|
Enumeration name: |
FileNotExisting |
|
Enumeration value: |
44 |
|
Description: |
File does not exist. |
|
Issue |
Cause |
Solution |
|---|---|---|
|
File does not exist. |
File does not exist. |
Verify that the filename is correct and the path to the file is correct, and if not, adjust as necessary. |
|
Enumeration name: |
Ok |
|
Enumeration value: |
0 |
|
Description: |
Ok |
Deleting of the file was successful.
|
Enumeration name: |
SystemFile |
|
Enumeration value: |
49 |
|
Description: |
A system file is addressed. |
|
Issue |
Cause |
Solution |
|---|---|---|
|
System files cannot be deleted |
Attempt to delete a system file. |
Verify that the file is not a system file. |