Delta RMC151 User Manual

Page 189

Advertising
background image

3 Controller Features

Use the Plot State register to tell whether the plot is continuously capturing. The plot

is continuously capturing when the Plot State register is 0:

0 = not triggered, 1 = capturing, 2 = complete.

2. Write 2 to the Upload Mode/Status Register

Write a value of two (2) to the Upload Mode/Status Register. This sets the upload

mode to "continuous" and resets the Current Index register to zero. The Current

Index register indicates which sample number of the plot the next read will start at.

When it resets to 0, the next read will start at sample 0. In continuous mode, the

Current Index may become very large. It is a 32-bit number and will wrap when it

reaches its limit.

3. Write the Requested Read Samples per Data Set

Write the number of samples per data set that you would like returned per read to the

Requested Read Samples register. The minimum length of the read itself will be

affected by this value, as described later.

4. Read the Plot Data Starting from Dynamic Plot Upload register #0

Upload Mode 2 will return valid data only if there is enough captured data to fill the

request. If there is not enough captured data, the Samples Uploaded register will

return 0. Therefore, the typical method of reading a plot is to keep reading the plot data

and only using the data when the Samples Uploaded register is non-zero.
If the read falls too far behind to keep up with the data, the Upload Status bits will be

set to two (2) to indicate an overrun error. To recover, restart the plot by writing zero

(0) to the Current Index register.
Each time you read the plot data, start the read at Dynamic Plot Upload register #0.

The Current Index register will automatically be set to the index of the first sample of

the data returned in the read. Each read will return Dynamic Plot Upload registers 0-

4 and the plot samples beginning at the sample number in the Current Index register.

Since each read includes registers 0-4, you will have access to this information after

each read.
To read the plot data repeat these steps:
a. Calculate the Length of the Read.

The length of the read must be long enough to receive the number of samples per

data set you wrote to the Requested Read Samples register. In addition to

returning Dynamic Plot Upload registers 0-4, each read will return an equal

number of samples from each data set in the plot. Use the following equation to

calculate the length of the read based on how many samples you wish to read:

length = (Requested Read Samples) x (# of data sets) + 5

The number of samples should not be more the number of samples in the plot.

Typically, you will make this calculation once and then always make reads of the

same length.

b. Read from Dynamic Plot Upload register #0

Read from the Dynamic Plot Upload register #0 with the length calculated in step

a.

c. Do any Error Checking

If you wish, you can use Dynamic Plot Upload registers 0-4 to do error checking,

as described below:

Verify that the Upload Status is 0, meaning no errors have occurred.

If the Upload Status is 1, the plot has been triggered, completed capturing,

and has been completely uploaded. To recover, issue the Rearm Plot (103)

command to set it to continuous capture.
If the Upload Status is 2, the capturing data overran the data you were

going to read. To recover from this error, write zero (0) to the Current Index

register, which will restart the plot. You will have to restart reading the plot

data.

deltamotion.com

169

Advertising
This manual is related to the following products: