Using the Process Analyst > Process Analyst for Developers > Automation Model > IPen.AddSample

IPen.AddSample

Adds a temporary sample to a pen.

Defined As

Parameters

value

[in] Indicates the value of the sample that will be added.

timeStamp

[in] Indicates at what time the sample will occur in UTC time.

milli

[in] Indicates the millisecond component of the time stamp (0 to 999).

qualityType

[in] Indicates the quality of the sample that will be added.

compactionType

[in] Indicates what display type the sample will be represented as.

Execution Result

If the function succeeds, the return value will be Success. If an argument is bad, the return value will be InvalidArgument. If an argument is out of range, the return value will be InvalidArgument. If the pen is deleted, the return value will be GeneralFailure. If any other unexpected error occurs, the return value will be GeneralFailure.

Remarks

This function has limited use as the samples added are stored in a temporary cache; they can be cleared anytime by time span changes, data refresh calls, or automation.

You can only add samples to analog or digital pens.

See Also

QualityType [Enumeration], QualityCompactionType [Enumeration]

Calling Syntax

Assumes you have passed a valid pen object into the function.

[VBA]

Sub Example(pen As Object)
Dim timeStamp As Date
timestamp = Now
pen.AddSample 75.0, timeStamp, 100, 0, 0
End Sub

[Cicode]

FUNCTION Example(OBJECT hPen)
INT iCitectTime;
REAL rOleTime;
iCitectTime = TimeCurrent(); // Returns seconds since 1970
rOleTime = TimeToOleDate(iCitectTime, 1); // Convert to OLE UTC time
_ObjectCallMethod(hPen, "AddSample", 75.0, timeStamp, 100, 0, 0);
END