The method SetRandomSeed sets the internal seed, used for the generation of the random sequence of targets, to a constant value provided by you.
Calling the method multiple times would force a reinitialization of the internal random sequence generator. In particular, calling this method providing a seed value equal to the one currently used by the function block, restarts the current random sequence.
If the seed is left or set to 0, at the next call of a target generation method the seed is automatically initialized based on the current status of the CPU timer, using SystemInterface.FC_GetTSC().
Input |
Data type |
Description |
---|---|---|
i_uiValue |
UINT |
Random seed used for the generation of a sequence of random numbers. If i_uiValue is set to 0, at the first call of one of the methods used to generate random targets, the function block initializes the seed based on the current status of the CPU timer. This results in a different random sequence every time the function block is enabled. |
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 = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
q_sMsg |
STRING[80] |
Event-triggered message that gives more detailed information on the diagnostic state. |
q_etDiag |
q_etDiagExt |
Enumeration value of q_etDiagExt |
Description |
---|---|---|---|
Ok |
Ok |
0 |
Ok |
UnexpectedProgramBehavior |
RandomSeedInvalid |
39 |
A feedback value is indeterminable. |