FB_SamplingDataAsynchron

Overview

Type:

Function block

Available as of:

V1.0.0.0

Functional Description

The function block FB_SamplingDataAsynchron retrieves data from the drive in asynchronous mode. It must be called in a cyclic task. The duration of the sampling process is fixed to 100 ms, accordingly it provides 800 data records. The sampled data are stored on the drive. When the sampling process is finished, the application is retrieving the single packages from the drive in a certain interval. After the packages have been retrieved, the function block indicates that the sampling process is done and provides the recorded data in the array at iq_aalrSampledData.

The xStartSampling property is additionally provided to start the sampling process. For a quick start of the sampling process, it can be called in a fast task.

No additional configuration is necessary to use asynchronous sampling.

Interface

Input

Data type

Description

i_xEnable

BOOL

Activation and initialization of the function block.

Refer to Behavior of Function Blocks with the Input i_xEnable.

i_aetParameter

ARRAY [0...3] OF ET_Parameter

Specify the parameters to be sampled.

i_etPositionTrend

ET_PositionTrend

Specifies whether set positions of the axis are considered for sampling.

i_xUseTracePlot

BOOL

If TRUE, the sampled data is plotted to an IEC trace graph, also refer to Displaying Sampled Data in a Trace Plot.

i_ifDrive

SystemConfigurationItf.IF_Drive

Specifies the axis from which data is sampled.

Input/Output

Data type

Description

iq_aalrSampledData

ARRAY [0...799] OF ARRAY [0...3] OF REAL

Array for storing the sampled data. The meaning and the order of the parameters per data record correspond to the specified parameter at i_aetParameter.

Output

Data type

Description

q_xActive

BOOL

If this output is set to TRUE, the function block is active.

q_xReady

BOOL

If this output is set to TRUE, the activation was successful.

q_xError

BOOL

If this output is set to TRUE, an error has been detected. For details, refer to q_etResult and q_sResultMsg.

q_xSamplingDone

BOOL

If this output is set to TRUE, the sampling process is finished and the recorded data are provided in the array at iq_aalrSampledData.

q_etResult

ET_Result

Provides diagnostic and status information as a numeric value.

q_sResultMsg

STRING [80]

Provides additional diagnostic and status information as a text message.

Property

Data type

Access

Description

xStartSampling

BOOL

Read/write

Input that initiates the start of the sampling process.

The input can be called in a fast task. For further information, refer to Behavior of the Property xStartSampling.

NOTE:

While the sampling process is in progress, an Online Change of the application cannot be performed. The sampling process is outsourced to a separate task. As long as this task is not completed, a requested online change is rejected. If this is the case, Logic Builder issues a message informing you that an online change cannot be performed.