User`s manual
AW00098504000 I/O Control
Basler ace Camera Link 61
6.3 Checking the State of the I/O Lines
6.3.1 Checking the State of a Single Line
Checking the State Using Basler Pylon
You can determine the current state of each I/O line using Basler Pylon:
Use the Line Selector parameter to select a line.
Read the value of the Line Status parameter to determine the current state of the line. A value
of true means the line’s state is currently high and a value of false means the line’s state is
currently low.
You can set the Line Selector and read the Line Status parameter value from within your application
software by using the Basler pylon API. The following code snippet illustrates using the API to set
the selector and read the parameter value:
// Select the GPIO line and read the state
Camera.LineSelector.SetValue( LineSelector_Line1 );
bool Line1State = Camera.LineStatus.GetValue( );
// Select the CLSpare line and read the state
Camera.LineSelector.SetValue( LineSelector_ClSpare );
bool ClSpareState = Camera.LineStatus.GetValue( );
// Select the CC1 line and read the state
Camera.LineSelector.SetValue( LineSelector_CC1 );
bool CC1 = Camera.LineStatus.GetValue( );
You can also use the Basler pylon Viewer application to easily set the parameters.
For more information about the pylon API and the pylon Viewer, see Section 3.1 on page 19.
Checking the State Using Direct Register Access
To check the current state of an I/O line via direct register access:
For the GPIO line, read the value of the Line Status Line 1 register. The value will indicate 1
(true) or 0 (false).
For the CL Spare line, read the value of the Line Status CL Spare register.
For the CC1 line, read the value of the Line Status CC1 register.
For the CC2 line, read the value of the Line Status CC2 register.
For the CC3 line, read the value of the Line Status CC3 register.
For more information about direct register access, see Section 3.2 on page 21.