camOpen (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2/DX4/AX9 pro/MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400

Firmware version:

1.07 / 1.00.00


This opens the camera module and prepares it for use. This function must be called and returned successfully before any other camera function is called.

The camera module is connected to the RS232 port 0 or 1 of the RTCU device and will take over this port until camClose is called.

 

Firmware V3.10 or later is required for CAM-200 series camera support.

 

For NX32L devices, USB cameras are supported instead of RS232 camera modules, and use the usbHostGetCameraPort function to determine the port to open.

 

Input:

port : SINT (0/1, Default: 0)

The serial port where the camera module is connected (see serial port enumeration for X32/NX32 and usbHostGetCameraPort for NX32L).

 

type : SINT (1/2, Default: 1)

The type of camera module connected. Not used under NX32L.

1

- CAM-100 series camera module.

2

- CAM-200 series camera module.

 

Returns: INT

0

- Success.

-1

- Failed. No camera module present or not supported?

-3

- Invalid parameter.

-4

- Serial port is already used by application.

 

Declaration:

FUNCTION camOpen : INT;
VAR_INPUT
  port : SINT := 0;
  type : SINT := 1;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Open the camera library
camOpen();
 
BEGIN
 ...
END;
 
END_PROGRAM;