FUNCTION_BLOCK SMC_AxisDiagnosticLog
This function block is designed for writing cyclically a set of parameter values belonging to one axis to a file. This output file is ideal for diagnosis purposes. As the writing of data on a data medium usually needs some time, this module stores the collected data in a buffer of size 5 kByte and the data will not be written until module action WriteToFile is called. This action call should be placed in a slower (ca. 50 ms) task of lower priority, in order to prevent the actual motion task as well as the motion itself from being disturbed. As soon as the buffer is exceeded, the module will create an error output.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Inout |
Axis |
|||
Input |
bExecute |
BOOL |
Rising edge: Starts the execution of the function block. |
|
bCloseFile |
BOOL |
The module closes the file as soon as this input gets TRUE. |
||
sFileName |
STRING(255) |
File name (preceded by path). |
||
bSetPosition |
BOOL |
TRUE: The associated value of the axis to be written to the file. |
||
bActPosition |
BOOL |
TRUE: The associated value of the axis to be written to the file. |
||
bSetVelocity |
BOOL |
TRUE: The associated value of the axis to be written to the file. |
||
bActVelocity |
BOOL |
TRUE: The associated value of the axis to be written to the file. |
||
bSetAcceleration |
BOOL |
TRUE: The associated value of the axis to be written to the file. |
||
bActAcceleration |
BOOL |
TRUE: The associated value of the axis to be written to the file. |
||
bySeparatorChar |
BYTE |
9 |
ASCII-Code of the letter, which is to be written between two values of same date. |
|
sRecordSeparatorString |
STRING(3) |
'$R$N' |
String to be written at the end of a date. |
|
eMode |
LOG_CONTINUOUS |
LOG_CONTINUOUS: Continuous logging into file. LOG_AT_CLOSE: Continuous logging into buffer (10kByte). When bCloseFile is set, the buffer content is written to file. |
||
Output |
bDone |
BOOL |
TRUE: Logging has been terminated and file is closed. |
|
bBusy |
BOOL |
FALSE |
TRUE: Execution of function block has not been finished. |
|
bError |
BOOL |
TRUE: Error has occurred within the function block. |
||
ErrorID |
SMC_ERROR |
Error identification |
||
bRecording |
BOOL |
FALSE |
TRUE: Module records. |