In this topic Hide
Data chunks allow you to add supplementary information to individual image acquisitions. The desired supplementary information is generated and appended as data chunks to the image data.
Image data is also considered a "chunk". This "image data chunk" can't be disabled and is always the first chunk transmitted by the camera. If one or more data chunks are enabled, these chunks are transmitted as chunk 2, 3, and so on.
The figure below shows a set of chunks with the leading image data chunk and appended data chunks. The example assumes that the CRC checksum chunk feature is enabled.
After data chunks have been transmitted to the computer, they must be retrieved to obtain their information. The exact procedure depends on your camera model and the programming language used for your application. For more information about retrieving data chunks, see the Programmer's Guide and Reference Documentation delivered with the Basler pylon Camera Software Suite.
Additional Metadata
Besides the data chunks, the camera adds additional metadata to individual images, e.g., the image height, image width, the image ROI offset, and the pixel format used. This information can be retrieved by accessing the grab result data via the pylon API.
If all of the following conditions are met, the grab result data doesn't contain any useful information (image height, image width, etc. will be set to -1):
In this case, you must retrieve the additional metadata using the pylon chunk parser. For more information, see the code samples in the Programmer's Guide and Reference Documentation delivered with the Basler pylon Camera Software Suite.
Data chunks can also be viewed in the pylon Viewer.
If this chunk is available and enabled, the camera appends the gain used for image acquisition to every image.
The data chunk includes the GainRawGain parameter value.
If this chunk is enabled, the camera appends the exposure time used for image acquisition to every image.
The data chunk includes the ExposureTimeAbsExposureTime parameter value.
When using the Trigger Width exposure mode, the Exposure Time chunk feature is not available.
If this chunk is enabled, the camera appends the internal timestamp (in ticks) of the moment when image acquisition was triggered to every image.
If this chunk is enabled, the camera appends the status of all I/O lines at the moment when image acquisition was triggered to every image.
The data chunk includes the LineStatusAll parameter value.
If this chunk is available and enabled, the camera appends the number of hardware frame start trigger signals received to every image.
To do so, the camera retrieves the current value of the Counter 1 counter. On cameras with the Trigger Input Counter chunk, Counter 1 counts the number of hardware trigger signals received.
To manually reset the counter, reset Counter 1.
The trigger input counter only counts hardware trigger signals. If the camera is configured for software triggering or free run, the counter value will not increase.
If this chunk is available and enabled, the camera appends the number of acquired images to every image.
To do so, the camera retrieves the current value of the Counter 1 counter. On cameras with the Counter Value chunk, Counter 1 counts the number of acquired images.
To manually reset the counter, reset Counter 1.
If this chunk is available and enabled, the camera appends the number of acquired images to every image.
To do so, the camera retrieves the current value of the Counter 2 counter. On cameras with the Frame Counter chunk, Counter 2 counts the number of acquired images.
To manually reset the counter, reset Counter 2.
Numbers in the counting sequence may be skipped when the acquisition mode is changed from Continuous to Single Frame. Numbers may also be skipped when overtriggering occurs.
If this chunk is available and enabled, the camera appends the sequencer set used for image acquisition to every image.
The data chunk includes the SequencerSetActive or SequenceSetIndex parameter value (depending on your camera model).
Enabling this chunk is only useful if the camera's Sequencer feature is used for image acquisition.
If this chunk is available and enabled, the camera appends the status of the target brightness adjustments to every image.
Target brightness adjustments are performed whenever the Exposure Auto or the Gain Auto auto function or both are enabled.
The chunk can have the following values:
If this chunk is enabled, the camera appends a CRC (Cyclic Redundancy Check) checksum to every image.
The checksum is calculated using the X-modem method and includes the image data and all appended chunks, if any, except the CRC chunk itself.
The CRC checksum chunk is always the last chunk appended to image data.
Camera Model | Available Data Chunks |
---|---|
All ace 2 GigE camera models | Data Chunks feature not supported |
All ace 2 USB 3.0 camera models | Data Chunks feature not supported |
All ace GigE camera models |
|
acA640-750um |
|
acA640-750uc |
|
acA640-90um |
|
acA640-90uc |
|
acA640-120um |
|
acA640-120uc |
|
acA720-520um |
|
acA720-520uc |
|
acA800-510um |
|
acA800-510uc |
|
acA1300-200um |
|
acA1300-200uc |
|
acA1300-30um |
|
acA1300-30uc |
|
acA1440-220um |
|
acA1440-220uc |
|
acA1600-20um |
|
acA1600-20uc |
|
acA1920-25um |
|
acA1920-25uc |
|
acA1920-40um |
|
acA1920-40uc |
|
acA1920-40umMED |
|
acA1920-40ucMED |
|
acA1920-150um |
|
acA1920-150uc |
|
acA1920-155um |
|
acA1920-155uc |
|
acA1920-155umMED |
|
acA1920-155ucMED |
|
acA2040-90um |
|
acA2040-90umNIR |
|
acA2040-90uc |
|
acA2000-165um |
|
acA2000-165umNIR |
|
acA2000-165uc |
|
acA2040-55um |
|
acA2040-55uc |
|
acA2040-120um |
|
acA2040-120uc |
|
acA2440-35um |
|
acA2440-35uc |
|
acA2440-35umMED |
|
acA2440-35ucMED |
|
acA2440-75um |
|
acA2440-75uc |
|
acA2440-75umMED |
|
acA2440-75ucMED |
|
acA2500-14um |
|
acA2500-14uc |
|
acA2500-60um |
|
acA2500-60uc |
|
acA3088-57um |
|
acA3088-57uc |
|
acA3800-14um |
|
acA3800-14uc |
|
acA4024-29um |
|
acA4024-29uc |
|
acA4096-30um |
|
acA4096-30uc |
|
acA4096-30umMED |
|
acA4096-30ucMED |
|
acA4096-40um |
|
acA4096-40uc |
|
acA4096-40umMED |
|
acA4096-40ucMED |
|
acA4112-20um |
|
acA4112-20uc |
|
acA4112-20umMED |
|
acA4112-20ucMED |
|
acA4112-30um |
|
acA4112-30uc |
|
acA4112-30umMED |
|
acA4112-30ucMED |
|
acA4600-10uc |
|
acA5472-17um |
|
acA5472-17uc |
|
All boost CXP-12 camera models | Data Chunks feature not supported |
All dart BCON for LVDS camera models | Data Chunks feature not supported |
All dart BCON for MIPI camera models | Data Chunks feature not supported |
All dart USB 3.0 camera models | Data Chunks feature not supported |
All pulse USB 3.0 camera models | Data Chunks feature not supported |
The following source code is provided as an example.
// Enable data chunks
camera.ChunkModeActive.SetValue(true);
// Select and enable Gain All chunk
camera.ChunkSelector.SetValue(ChunkSelector_GainAll);
camera.ChunkEnable.SetValue(true);
// Select and enable Exposure Time chunk
camera.ChunkSelector.SetValue(ChunkSelector_ExposureTime);
camera.ChunkEnable.SetValue(true);
// Select and enable Timestamp chunk
camera.ChunkSelector.SetValue(ChunkSelector_Timestamp);
camera.ChunkEnable.SetValue(true);
// Select and enable Line Status All chunk
camera.ChunkSelector.SetValue(ChunkSelector_LineStatusAll);
camera.ChunkEnable.SetValue(true);
// Select and enable Trigger Input Counter chunk
camera.ChunkSelector.SetValue(ChunkSelector_Triggerinputcounter);
camera.ChunkEnable.SetValue(true);
// Select and enable Frame Counter chunk
camera.ChunkSelector.SetValue(ChunkSelector_Framecounter);
camera.ChunkEnable.SetValue(true);
// Select and enable Sequence Set Index chunk
camera.ChunkSelector.SetValue(ChunkSelector_SequenceSetIndex);
camera.ChunkEnable.SetValue(true);
// Select and enable CRC checksum chunk
camera.ChunkSelector.SetValue(ChunkSelector_PayloadCRC16);
camera.ChunkEnable.SetValue(true);
// Enable Chunk Mode Active
camera.ChunkModeActive.SetValue(true);
// Select and enable Gain chunk
camera.ChunkSelector.SetValue(ChunkSelector_Gain);
camera.ChunkEnable.SetValue(true);
// Select and enable Exposure Time chunk
camera.ChunkSelector.SetValue(ChunkSelector_ExposureTime);
camera.ChunkEnable.SetValue(true);
// Select and enable Timestamp chunk
camera.ChunkSelector.SetValue(ChunkSelector_Timestamp);
camera.ChunkEnable.SetValue(true);
// Select and enable Line Status All chunk
camera.ChunkSelector.SetValue(ChunkSelector_LineStatusAll);
camera.ChunkEnable.SetValue(true);
// Select and enable Counter Value chunk
camera.ChunkSelector.SetValue(ChunkSelector_CounterValue);
camera.ChunkEnable.SetValue(true);
// Select and enable Sequencer Set Active chunk
camera.ChunkSelector.SetValue(ChunkSelector_SequencerSetActive);
camera.ChunkEnable.SetValue(true);
// Select and enable CRC checksum chunk
camera.ChunkSelector.SetValue(ChunkSelector_PayloadCRC16);
camera.ChunkEnable.SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Enable data chunks
CBooleanPtr(nodemap.GetNode("ChunkModeActive"))->SetValue(true);
// Select and enable Gain All chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("GainAll");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Exposure Time chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("ExposureTime");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Timestamp chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("Timestamp");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Line Status All chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("LineStatusAll");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Trigger Input Counter chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("Triggerinputcounter");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Frame Counter chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("Framecounter");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Sequence Set Index chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("SequenceSetIndex");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable CRC checksum chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("PayloadCRC16");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Enable Chunk Mode Active
CBooleanPtr(nodemap.GetNode("ChunkModeActive"))->SetValue(true);
// Select and enable Gain chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("Gain");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Exposure Time chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("ExposureTime");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Timestamp chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("Timestamp");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Line Status All chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("LineStatusAll");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Counter Value chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("CounterValue");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable Sequencer Set Active chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("SequencerSetActive");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Select and enable CRC checksum chunk
CEnumerationPtr(nodemap.GetNode("ChunkSelector"))->FromString("PayloadCRC16");
CBooleanPtr(nodemap.GetNode("ChunkEnable"))->SetValue(true);
// Enable data chunks
camera.Parameters[PLCamera.ChunkModeActive].SetValue(true);
// Select and enable Gain All chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.GainAll);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Exposure Time chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.ExposureTime);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Timestamp chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.Timestamp);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Line Status All chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.LineStatusAll);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Trigger Input Counter chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.Triggerinputcounter);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Frame Counter chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.Framecounter);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Sequence Set Index chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.SequenceSetIndex);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable CRC checksum chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.PayloadCRC16);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Enable Chunk Mode Active
camera.Parameters[PLCamera.ChunkModeActive].SetValue(true);
// Select and enable Gain chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.Gain);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Exposure Time chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.ExposureTime);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Timestamp chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.Timestamp);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Line Status All chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.LineStatusAll);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Counter Value chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.CounterValue);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable Sequencer Set Active chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.SequencerSetActive);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Select and enable CRC checksum chunk
camera.Parameters[PLCamera.ChunkSelector].SetValue(PLCamera.ChunkSelector.PayloadCRC16);
camera.Parameters[PLCamera.ChunkEnable].SetValue(true);
// Enable data chunks
Pylon.DeviceSetBooleanFeature(hdev, "ChunkModeActive", true);
// Select and enable Gain All chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "GainAll");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Exposure Time chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "ExposureTime");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Timestamp chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "Timestamp");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Line Status All chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "LineStatusAll");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Trigger Input Counter chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "Triggerinputcounter");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Frame Counter chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "Framecounter");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Sequence Set Index chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "SequenceSetIndex");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable CRC checksum chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "PayloadCRC16");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Enable Chunk Mode Active
Pylon.DeviceSetBooleanFeature(hdev, "ChunkModeActive", true);
// Select and enable Gain chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "Gain");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Exposure Time chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "ExposureTime");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Timestamp chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "Timestamp");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Line Status All chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "LineStatusAll");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Counter Value chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "CounterValue");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable Sequencer Set Active chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "SequencerSetActive");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
// Select and enable CRC checksum chunk
Pylon.DeviceFeatureFromString(hdev, "ChunkSelector", "PayloadCRC16");
Pylon.DeviceSetBooleanFeature(hdev, "ChunkEnable", true);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK; /* Return value of pylon methods */
/* Enable data chunks */
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkModeActive", 1);
CHECK(errRes);
/* Select and enable Gain All chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "GainAll");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Exposure Time chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "ExposureTime");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Timestamp chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "Timestamp");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Line Status All chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "LineStatusAll");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Trigger Input Counter chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "Triggerinputcounter");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Frame Counter chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "Framecounter");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Sequence Set Index chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "SequenceSetIndex");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable CRC checksum chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "PayloadCRC16");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Enable Chunk Mode Active */
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkModeActive", 1);
CHECK(errRes);
/* Select and enable Gain chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "Gain");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Exposure Time chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "ExposureTime");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Timestamp chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "Timestamp");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Line Status All chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "LineStatusAll");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Counter Value chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "CounterValue");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable Sequencer Set Active chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "SequencerSetActive");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
/* Select and enable CRC checksum chunk */
errRes = PylonDeviceFeatureFromString(hdev, "ChunkSelector", "PayloadCRC16");
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "ChunkEnable", 1);
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.