Using the Digital Input and Output

<< Click to Display Table of Contents >>

Navigation:  NxLib API > HowTo's > Basic Camera Operations >

Using the Digital Input and Output

The camera's digital output is controlled via the Output node. Please first read about restrictions of controlling the output pin here.

The camera's digital input state can be read from the Input node. When using a hardware trigger mode the electrical signal is used to trigger the camera exposure in hardware.

Note: The state of the input can be read from the Input node also when using hardware triggering, but the node replicates the electrical state with low frequency of around 5Hz, so you will not be able to safely detect trigger signals of 200ms or shorter by polling this node!

Code Examples

Flash output

This example configures the output pin to output a low-active flash signal for 5ms synchronized to the camera's exposure

hmtoggle_plus1C++
hmtoggle_plus1Halcon/HDevelop

 

Statically setting the output state

The following example will switch the output on for the duration of 1s.

Note: This example does not work with N20, N30 and N35 cameras as they do not support to set the output statically.

hmtoggle_plus1C++
hmtoggle_plus1Halcon/HDevelop

 

Reading the input state

hmtoggle_plus1C++
hmtoggle_plus1Halcon/HDevelop