FB_RoboticsAutoTunePSeries - WriteFile (Method)
Type: |
Method |
Available as of: |
V2.0.0.0 |
This chapter provides information on:
oTask
Write a file to the file system of the controller which includes the status of tuning, the configuration and parameterization of RoboticsAutoTune.
With the method WriteFile(…), a file with the specified name is written on the specified directory.
If only the file name is given, the path ide0:/ and the file name extension .DAT is added automatically.
If the file does not exist, it is created. If the file exists, the content is deleted and replaced.
Valid example names:
oExample -> the file ide0:/Example.DAT is written to ide0:
oide0:/Example.DAT -> the file ide0:/Example.DAT is written to ide0:
ousb2msd:1/Example.DAT -> the file usb2msd:1/Example.DAT is written to an USB device.
Valid but not a good practice:
oExample.DAT would result in writing 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 written. |
i_xWriteAdditionalData |
BOOL |
Additional data that is written into the file. |
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 |
|
37 |
Size of additional data slots is invalid. |
||
ExecutionAborted |
33 |
The robot is not configured. |
|
45 |
Too many files open. |
||
51 |
Attempt to write to an invalid file type. |
||
ControllerConditionInvalid |
50 |
Not enough space to save the file. |
|
UnexpectedProgramBehavior |
1 |
A feedback value was invalid. |
Enumeration name: |
AdditionalDataRange |
Enumeration value: |
37 |
Description: |
Size of additional data slots is invalid. |
Issue |
Cause |
Solution |
---|---|---|
Writing of the file was successful. |
i_xWriteAdditionalData was set to TRUE but either the property xEnableAdditionalData is not set to TRUE or GPL.Gc_udiMaxNumberOfAdditionalData is zero. |
oDo not set i_xWriteAdditionalData in case no additional data is used. oEnable the usage of additional data and set GPL.Gc_udiMaxNumberOfAdditionalData to a value greater than 0. |
Enumeration name: |
NotConfigured |
Enumeration value: |
33 |
Description: |
The robot is not configured. |
Issue |
Cause |
Solution |
---|---|---|
Configuration is not valid. |
Not configured. Call method Configuration first |
Verify that the method Configuration is called successfully. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
Writing of the file was successful.
Enumeration name: |
SystemOutOfMemory |
Enumeration value: |
50 |
Description: |
Not enough space to save the file. |
Issue |
Cause |
Solution |
---|---|---|
System out of memory. |
Not enough memory space to save the file. |
Provide free memory space to save the file. |
Enumeration name: |
TooManyFilesOpen |
Enumeration value: |
45 |
Description: |
Too many files open. |
Issue |
Cause |
Solution |
---|---|---|
Too many files opened. |
Too many files opened. |
Close opened files. |
Enumeration name: |
WriteException |
Enumeration value: |
51 |
Description: |
Attempt to write to an invalid file type. |
Issue |
Cause |
Solution |
---|---|---|
Write exception. |
Device invalid. |
Choose another device. |
File name invalid. |
Choose another file name. |
Enumeration name: |
UnexpectedFeedback |
Enumeration value: |
1 |
Description: |
A feedback value was invalid. |
Writing the file was unsuccessful.