SaveSample(Int32,Int32,Int32,DBInt,DBInt,DBString,DBString) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The SaveSample() method adds a data log record to the Data_Log table, using the current values stored in the Data_Log_Value table as the sample values. This facilitates using the PLC to collect values from external servers and save them independently, and then trigger a new sample to be logged to the relevant Data_Log table.
In this overload of the method, the data log group is identified by its group ID and the entity is identified by its entity ID.
public static void SaveSample(
int sessionId,
int grpId,
int entId,
DBInt jobPos,
DBInt stepNo,
DBString lotNo,
DBString subLotNo
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- grpId
- Required. Holds the ID of the data log group to be sampled.
- entId
- Required. Holds the ID of the entity where the sample is collected.
- jobPos
- Optional. Holds the job position. If > 1, then jobs are running on this entity.
- stepNo
- Optional. Holds the job step number that is associated with this sample.
- lotNo
- Optional. Holds the number of the lot that is associated with this sample.
- subLotNo
- Optional. Holds the number of the sublot that is associated with this sample.
Observe the following input parameter rules:
- Required non-DB* parameters: Must pass a value. Cannot be empty or null.
- Optional non-DB* parameters: Either enter a value or pass a null. If passing a null and a default value has been defined, the default value will be used for the parameter.
- Required DB* parameters: Must pass a value. To enter an empty value for the parameter, pass DB*.null (e.g., DBInt.null).
- Optional DB* parameters: To enter no value for the parameter, pass DB*.null (e.g., DBInt.null). To use the default value for the parameter if one has been defined for the object being added, pass a null.
The assumption in using this method is that all samples that need to be logged are collected and saved up front in the Data_Log_Value table before triggering this method to log the samples.
If the entity exists and there is a job currently running on the entity, then those job details are used while logging the sample data along with the current shift details for the entity. The method goes through each and every non-null value in the Data_Log_Value table that is assigned to this group, and copies the value to the appropriate valuen column in the Data_Log table to collect this sample.