camGetInfo (Functionblock)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, NX-400

Firmware version:

1.00.00


This functionblock returns information about a connected camera.

 

 

Input:

None.

 

Output:

status        : INT

The status of the camera:

1

- Camera is open.

-1

- Failed. No camera module present.

-5

- Camera interface not open.

 

max_width        : INT

The maximum width of the camera.

max_height        : INT

The maximum height of the camera.

format                : DINT

The ID of the image format of the camera. If the camera supports multiple formats, the format with best support will be shown.

Known formats:

Format

Decimal

Hex

MJPEG

1196444237

47504A4D

 

Declaration:

FUNCTION_BLOCK camGetInfo;
VAR_OUTPUT
  status     : INT;
  max_width : INT;
  max_height : INT;
  format     : DINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
VAR
  camInfo : camGetInfo;
END_VAR;
 
PROGRAM test;
 
  // Open the camera library
  camOpen();
 
BEGIN
   ...
  // Get information about the camera module
   camInfo();
   IF camInfo.status > 0 THEN
      DebugFmt(message := "Max resolution: \1 x \2, format \4", v1 := camInfo.max_width,
                                         v2:=camInfo.max_height, v2:=camInfo.format);
   END_IF;
   ...
END;
END_PROGRAM;