How To: Connect a GenICam Camera to ctrlX CORE
This guide connects an Ethernet camera that follows the GenICam standard (GigE Vision) to a ctrlX CORE and takes it as far as a captured image on the ctrlX Data Layer. It uses only the ctrlX web interface.
When you have finished:
-
the camera has a fixed IP address in the network of the ctrlX CORE,
-
LumiScan Cam Driver has a module for the camera and finds it,
-
the camera is connected, and every capture puts an image on the Data Layer,
-
captured images can optionally be saved to internal storage, a USB storage device, an SD card or a network share.
Before you start
Hardware
-
ctrlX CORE, for example ctrlX CORE X3 or X7
-
GenICam-compliant Ethernet camera (GigE Vision)
-
Engineering PC with a browser
-
Shielded Ethernet cables (foil shielded twisted pair)
-
Optional: an Ethernet switch that supports jumbo frames
Software and licences
-
LumiScan Cam Driver installed on the ctrlX CORE, with a licence for each camera, see Requirements
-
The configuration tool of the camera manufacturer, to set the camera’s IP address
How it fits together
LumiScan Cam Driver is configured with two kinds of files and controlled entirely through the Data Layer:
-
lumiscan-cam-driver.json, the application settings, lists the camera modules to load inmodulesand holds the settings of the device, such as logging and image storage. -
One module file per camera, for example
camera1.json, names the camera by its serial number and sets its exposure time and pixel format. Itsidbecomes the module’s name on the Data Layer:hdvisionsystems/lumiscan-cam-driver/<id>/….
Every operation of a module - connect, capture, save - sits under
hdvisionsystems/lumiscan-cam-driver/<id>/control/<operation>/. It is started either with the
ready/request handshake or, for most operations, with a single write to execute. See
Execute a Method and
General Concept of Handshake.
The settings files are read only when the application starts. Restart LumiScan Cam Driver after every change to them.
Step 1 - Set up the network
-
Give the camera a fixed IP address with the manufacturer’s configuration tool:
-
Set a static (persistent) IP address, for example
192.168.1.21, subnet mask255.255.255.0. -
Switch off DHCP and Auto IP (link local).
The address must lie in the subnet of the ctrlX CORE port the camera will use. If the camera is already connected to the ctrlX CORE but in the wrong subnet, you can also set its address from there, see Setup Camera IP Address.
-
-
Connect the camera, the ctrlX CORE and the engineering PC. Two topologies are possible - all three on one switch, or the camera directly on the ctrlX CORE. Both are described in Hardware Setup for ctrlX X3.
-
Give the engineering PC an unused address in the same subnet, for example
192.168.1.123. Do not use the address of the ctrlX CORE port; on a ctrlX CORE X3, XF10 has192.168.1.1. -
In the ctrlX web interface, open Settings > Network Interfaces and select the port the camera is connected to.
-
Check the static IPv4 address of the port and switch off DHCP.
-
Under Advanced settings, set MTU to
8000or9000, and click Save.
Figure 1. Network interface of the ctrlX CORE with static IP address and MTU
|
Images are large, so the camera sends them in jumbo frames. Without a large MTU - on the ctrlX CORE
port, and on every switch in between - captures fail with status code |
Step 2 - Configure LumiScan Cam Driver
-
In the ctrlX web interface, go to Home > Manage app data and click Open file view.
Figure 2. Opening the file view of the app data -
Open the folder
lumiscan-cam-driver. It holds the application settings, the module files, and the foldersschemasandimages. -
Create the module file for your camera, for example
camera1.json. The easiest way is to copy the example module file the application installed, then change these values:{ "id": "camera1", "serial": "LX123456", "exposureTimeUS": 4321, "pixelFormat": "RGB8" }-
id- the module’s name on the Data Layer. Only lower-case letters, digits,-and_, unique across all modules. -
serial- the camera’s serial number, as printed on the camera or shown by the manufacturer’s tool. -
exposureTimeUS- exposure time in microseconds. -
pixelFormat-RGB8orMono8.Keep the
$schemaandmetaentries of the example file. All parameters are described in Camera Example File Content Example.
-
-
Open
lumiscan-cam-driver.jsonand enter the module file in themoduleslist:"modules": [ "camera1.json" ]Each file in the list must exist, and no two modules may use the same camera serial number.
Figure 3. Application settings with the list of module files -
Click Save, then restart LumiScan Cam Driver: Settings > Apps, select LumiScan Cam Driver and click Restart.
The settings can also be read and changed on the Data Layer, on
hdvisionsystems/lumiscan-cam-driver/system/settings. See
Settings on the Data Layer.
|
Step 3 - Check that the camera is found
Open Settings > Data Layer in the ctrlX web interface and go to
hdvisionsystems/lumiscan-cam-driver/system. The cameras found in the network are listed in:
-
found-camera-serials -
found-camera-ip-addresses -
found-camera-mac-addresses -
found-camera-modules
The lists are in the same order, so the first serial belongs to the first IP address and the first MAC address.
Expected: the serial number from your module file is listed, with an IP address in the subnet of the
ctrlX CORE port. Below hdvisionsystems/lumiscan-cam-driver, a folder with your module’s id exists.
If the camera is missing, check the cabling and the subnet first. If the module folder is missing, read
system/settings: a module file that could not be read is shown there with the reason.
Step 4 - Connect the camera
Connecting takes several seconds, so it is only offered as a handshake. Use these nodes:
hdvisionsystems/lumiscan-cam-driver/camera1/control/connect-camera/ready hdvisionsystems/lumiscan-cam-driver/camera1/control/connect-camera/request
-
Wait until
readyistrue. -
Set
requesttotrue. -
Wait until
readyisfalse: the application has seen the request. -
Set
requestback tofalse. -
Check
hdvisionsystems/lumiscan-cam-driver/camera1/device-info/is-connected.
Expected: is-connected is true. The camera is connected and ready to capture.
|
Check the connection with |
Step 5 - Capture an image
The simplest way is one write to the execute method:
-
Write to
hdvisionsystems/lumiscan-cam-driver/camera1/control/capture/execute. The write returns when the capture has finished. -
Read
hdvisionsystems/lumiscan-cam-driver/camera1/control/status/code.
Expected: the status code is 0, and output/package-identifier has grown by one. The image is now on
hdvisionsystems/lumiscan-cam-driver/camera1/output/image
with its data, width, height and pixel-type. Other LumiScan applications read it from this
address.
You can also capture with the handshake on control/capture/ready and control/capture/request. A
failed capture then ends at status code 3; see
When a Functionality Runs.
output/image holds raw sensor data. To look at the image, open LumiScan Cockpit, or switch on
camera1/input/preview/enable to get a PNG on camera1/output/preview/encoded-data after each
capture (from v2.1.0).
|
Step 6 - Save captured images (optional)
Images are saved only when a storage is configured. It is set in the system section of
lumiscan-cam-driver.json. For the application’s internal storage:
"system": {
"storage": {
"type": "Internal",
"parameters": {
"rootPath": "images"
}
}
}
A relative rootPath is a folder inside the application’s own directory. For a USB storage device or
an SD card, use its mount path, for example /media/sdb1/myCapturedImages. For a Windows shared folder,
use the type Samba. All options are described in
Storage settings and
Saving Image Files.
-
Save the file and restart LumiScan Cam Driver.
-
Connect the camera (step 4) and capture an image (step 5).
-
Write to
hdvisionsystems/lumiscan-cam-driver/camera1/control/save/execute.
Expected: the status code is 0, and the image appears as a PNG file in the storage folder, by default
in a sub-folder named after the camera.
Result
-
The camera has a fixed IP address and is found by LumiScan Cam Driver.
-
The camera module is configured and connected.
-
Every capture puts a new image on
hdvisionsystems/lumiscan-cam-driver/camera1/output/image. -
Captured images can be saved to the configured storage.
Next steps
-
Look at the images and results in LumiScan Cockpit.
-
Evaluate the image with another LumiScan application: point its image address at
hdvisionsystems/lumiscan-cam-driver/camera1/output/image. -
Set camera features such as gain or trigger mode under
camera1/features, see GenICam features. -
Problems with detection, connection or capture: see Troubleshooting.