---
title: "How To: Test with Example Images Instead of a Camera"
description: "Set up a simulated camera in LumiScan Cam Driver that plays a folder of example images - to set up and test other LumiScan applications without camera hardware."
product: "LumiScan Cam Driver"
component: "lumiscan-cam-driver"
version: "2.2.1"
display_version: "2.2.1.10"
latest_version: true
language: "en"
url: "https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/how-tos/test-with-example-images.html"
---

# How To: Test with Example Images Instead of a Camera – LumiScan Cam Driver

A **simulated camera** is a camera module of LumiScan Cam Driver that does not talk to a camera. Each capture loads the next image from a folder instead. To the other LumiScan applications it looks exactly like a real camera: the image appears on the same Data Layer nodes.

Use it to set up and test an evaluation - a code reader, LumiScan Template Finder, LumiScan AI Object Matching - with known example images, before the camera is installed or without stopping the line.

When you have finished, a module named `simulation` delivers your example images, one per capture, on `hdvisionsystems/lumiscan-cam-driver/simulation/output/image`.

## Before you start {#prerequisites}

- LumiScan Cam Driver installed on the ctrlX CORE, with a licence, see [Requirements](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/lumiscan-camdriver/requirements.html)
- Example images as PNG files, ideally taken with the camera and lighting that will be used later
- A browser with access to the ctrlX web interface

## How it fits together {#overview}

Whether a camera module is simulated depends on its `serial`: a serial that contains `simulation` makes the module play images from the storage folder rather than search for a camera. The `id` is free.

The images are taken from the storage folder configured in `lumiscan-cam-driver.json`, in a sub-folder named after the module’s `id`: `images/simulation` for the settings in this guide. When the camera is connected, the module scans this folder; each capture then loads the next image.

> [!NOTE]
> Since v2.0.0, the images are taken from the sub-folder `<id>`, not from the storage folder itself. If `unifiedStorage` is set to `true` in the system settings (from v2.2.0), the storage folder itself is used.

## Step 1 - Create the module file {#step-1-module}

1. In the ctrlX web interface, go to **Home > Manage app data** and click **Open file view**.

   ![Manage app data page of the ctrlX web interface with the Open file view button](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/_images/howto-simulation-file-view.png)

   *Figure 1. Manage app data with the Open file view button*

2. Open the folder `lumiscan-cam-driver`.

3. Create the file `simulation.json`, for example as a copy of the example module file, with these values:
   ```json
   {
     "id": "simulation",
     "serial": "simulation"
   }
   ```

   Keep the `$schema` and `meta` entries of the example file.

   ![Module file in the file view with the serial simulation](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/_images/howto-simulation-module-file.png)

   *Figure 2. Module file of a simulated camera: the serial contains simulation*

4. Open `lumiscan-cam-driver.json` and add `simulation.json` to the `modules` list:
   ```json
   "modules": [
     "simulation.json"
   ]
   ```

5. Check that `system` holds a storage, for example the internal storage:
   ```json
   "storage": {
     "type": "Internal",
     "parameters": {
       "rootPath": "images"
     }
   }
   ```

   See [Storage settings](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/lumiscan-camdriver/application-settings-content-example.html#storage-settings).

## Step 2 - Upload the example images {#step-2-images}

1. In the file view of `lumiscan-cam-driver`, open the storage folder, `images` for the settings above.
2. Create a sub-folder named exactly like the module’s `id`: `simulation`.
3. Upload the example images into this folder.

The first capture loads the first image of the folder. For larger amounts of images, upload them with WebDAV, see [Uploading Data](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/lumiscan-camdriver/uploading-data.html).

## Step 3 - Restart LumiScan Cam Driver {#step-3-restart}

Under **Settings > Apps**, select **LumiScan Cam Driver** and click **Restart**. The application reads its settings files only at start.

Expected: under `hdvisionsystems/lumiscan-cam-driver`, a folder `simulation` exists.

## Step 4 - Connect and capture {#step-4-capture}

Values on the Data Layer can be set in the ctrlX web interface under **Settings > Data Layer**, or by another application, for example a PLC program.

1. Connect the simulated camera with the handshake on `hdvisionsystems/lumiscan-cam-driver/simulation/control/connect-camera`: wait until `ready` is `true`, set `request` to `true`, wait until `ready` is `false`, set `request` to `false`.
2. Check that `simulation/device-info/is-connected` is `true`.
3. Write to `hdvisionsystems/lumiscan-cam-driver/simulation/control/capture/execute`.

Expected: `simulation/control/status/code` is `0`, and the first example image is on `hdvisionsystems/lumiscan-cam-driver/simulation/output/image`. Each further capture loads the next image.

> [!TIP]
> To see which image is loaded, open LumiScan Cockpit. It shows the image of the module `simulation` like that of a real camera.

## Step 5 - Use the images in another application {#step-5-use}

Point the image address of the evaluating application at the simulated camera:

```
hdvisionsystems/lumiscan-cam-driver/simulation/output/image
```

For LumiScan DMC Reader, for example, this is `input/image-address`; for LumiScan AI Object Matching, `externalImagePath` in the module file. To change to the real camera later, change only this address, or replace the module’s `serial` with that of the camera.

## Result {#result}

- LumiScan Cam Driver has a simulated camera, `simulation`.
- Each capture loads the next example image onto `hdvisionsystems/lumiscan-cam-driver/simulation/output/image`.
- Other LumiScan applications can be set up and tested with these images, without camera hardware.

More on simulation mode: [FAQ: How does simulation mode work?](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/faq.html#faq-simulation-mode) and [Loading Images](https://docs.hdvisionsystems.com/en/lumiscan-cam-driver/2.2.1/lumiscan-camdriver/initializing-the-camera.html#loading-images).
