DataChannel Communications

The In-Sight DataChannel integrates alphanumeric data and images into a developer's customized Graphical User Interface (GUI) application. Using DataChannel, the In-Sight vision system acts as a TCP/IP Server, while the GUI application acts as a TCP/IP Client. This configuration provides a fast and efficient mechanism for transferring images and data from an In-Sight vision system to a PC.

Establish a Connection to the DataChannel

To use the DataChannel in a custom GUI application, follow the steps below.

  1. Open a TCP connection to the In-Sight vision system.

    Note: 50000 is the default TCP/IP port number for the DataChannel. If you need to specify a different port number, use the Put Portnum Native Mode command.
  2. Connect to the port from the Client.
  3. After the connection is established, the Client must log in using a valid user name and password. The default login user name is "admin" with a null string password. The In-Sight vision system will not prompt for the login. A Carriage Return/Line Feed (CRLF) must be sent after both the user name and the password.
    • If either the user name or password is not sent to the In-Sight vision system within 5 seconds or if either is invalid, the following message is sent, and the connection is terminated:

      "<Prompt><Accept>Invalid Password</Accept></Prompt>" + CRLF
    • If the username and password are valid, the following greeting message is sent:

      "<Prompt><Accept>ok</Accept><DataSession>0</DataSession><OpcSession>0</OpcSession><ImageSession>0</ImageSession>
      <SystemType>22</SystemType><Screen><High>480</High><Wide>640</Wide><Color>0</Color></Screen>
      <ToolEnabledBits>FEF6FFFF300000000000000000000000</ToolEnabledBits></Prompt>" + CRLF
      Note:
      • The OpcSession is for internal use only.
      • The SystemType indicates the In-Sight vision system's hardware type.
      • The ToolEnabledBits is for internal use only.
    • If the username and password are not valid, In-Sight will send the following message and close the connection:

      "<Prompt><Accept>Invalid 
       Password</Accept></Prompt>" + CRLF
    • If there are no other active network connections to the In-Sight vision system, up to six DataChannel connections can be established at a time. If there are six active network connections, the In-Sight vision system sends the following message:

      "<Prompt><Accept>Too many 
       connections</Accept></Prompt>" + CRLF
  4. After a successful login, the Client needs to specify the type of information that is to be received over the DataChannel. The Client must send "IMG"+CRLF to receive image information or "DAT"+CRLF to receive data. Whenever the spreadsheet is updated, the image or data is sent through the DataChannel. Like the login, if either command is not sent to the In-Sight vision system within 5 seconds, the following message is displayed, and the connection is terminated:

    "<Prompt><Accept>Connection 
     Closed</Accept></Prompt>" + CRLF
  5. If the connection is configured to send data, specify the output cells using the Put Watch Native Mode command.

    Note:
    • If any changes are made to the In-Sight spreadsheet, the Put Watch command must be sent again.
    • The DataChannel can monitor any cell containing numeric or string data. The Data Output is sent in XML format. Data is only sent from a monitored cell when that cell is evaluated, calculated or the value within the cell has changed. A constant value is evaluated only once after it is inserted into the spreadsheet because it does not depend on any other cells (changing the values of other cells will not change the value of a constant cell). For more information on cell evaluation and dependency, see Spreadsheet Cell Execution and Editing Reference.
    • Instead of sending the Put Watch command, the SetWatch function can be inserted in the In-Sight spreadsheet to automatically send information to the DataChannel.
    • The value for the AcqSeqNum can be used to match the data output with the corresponding image output. When the spreadsheet is updated by an Event or a Manual Trigger, two cycles occur. Any other acquisition trigger outputs only one cycle. When two cycles occur, the second cycle should be used to match the data output with the corresponding image output.

Test DataChannel Using a Telnet Client

  1. Open a command prompt. From the command prompt, log on to the vision system using a telnet client. When logging on, specify the host name or IP address and port number 23, which is the reserved Native Mode command port. For example: telnet is8402_010203 23.

  2. From the telnet client, type the following command: EV B0 1 Count($A$0,9999999,0,0). A Count function, using the default parameters, is inserted in cell B0.

  3. From the telnet client, type the following command: Put Watch B000 1 .

  4. From the command prompt, start a second telnet session and log on to the In-Sight vision system. When logging on, specify the host name or IP address and port number 50000, which is the default DataChannel port. For example: telnet telnet is8402_010203 50000.

  5. From the second telnet session, type "admin" and press Enter. Press Enter again to accept the null password.
  6. From the second telnet session, type "DAT" and press Enter.

  7. Acquire once on your In-Sight vision system. You should see data streaming to the second telnet program.

Data Output Format

The data output is sent in XML format.  The following is example output from a telnet session using the example described above; the In-Sight vision system was manually triggered twice.

Note: When the spreadsheet is updated by an Event or a Manual Trigger, two cycles occur. Any other acquisition trigger outputs only one cycle.
Admin
******
<Prompt><Accept>ok</Accept><DataSession>0</DataSession><OpcSession>0</OpcSession><ImageSession>0</ImageSession>
<SystemType>22</SystemType><Screen><High>480</High><Wide>640</Wide><Color>0</Color></Screen>
<ToolEnabledBits>FEF6FFFF300000000000000000000000</ToolEnabledBits></Prompt>
dat
<Cycle AcqSeqNum="1">
</Cycle>
<Cycle AcqSeqNum="2">
<Cell Id="B0">
  <Float>1</Float>
</Cell>
</Cycle>
<Cycle AcqSeqNum="2">
</Cycle>
<Cycle AcqSeqNum="3">
<Cell Id="B0">
  <Float>2</Float>
</Cell>
</Cycle>

DataChannel SystemType

In-Sight Model SystemType Output

In-Sight 5100

16, 17, 19, 22, 36, 44, 48, 52, 102

In-Sight 5100C

24, 61, 109, 111

In-Sight 5110

20, 26, 42, 49

In-Sight 5400

14, 40, 41,

In-Sight 5400C

33, 109, 111

In-Sight 5403

38

In-Sight 5410

21, 37, 47

In-Sight 5413

43

In-Sight 5600

53, 118

In-Sight 5603

60, 120

In-Sight 5604

88, 114

In-Sight 5605

100

In-Sight 5610

67

In-Sight 5613

66

In-Sight 5614

98

In-Sight 5615

101

In-Sight 5705 139
In-Sight 5715 139
In-Sight 5705C 137

In-Sight Micro 1020

79

In-Sight Micro 1050

80

In-Sight Micro 1100

76

In-Sight Micro 1100C

87

In-Sight Micro 1110

81

In-Sight Micro 1400

77

In-Sight Micro 1400C

86, 125

In-Sight Micro 1402 127
In-Sight Micro 1403

78, 124

In-Sight Micro 1403C

89, 126

In-Sight Micro 1410

82

In-Sight Micro 1412 127

In-Sight Micro 1413

83

In-Sight Micro 1500 135

In-Sight 7010

129

In-Sight 7010C

133

In-Sight 7020

129
In-Sight 7050 129
In-Sight 7200 129
In-Sight 7200C 133
In-Sight 7210 129
In-Sight 7230 129
In-Sight 7400 129
In-Sight 7400C 133
In-Sight 7410 129
In-Sight 7430 129
In-Sight 7402 129
In-Sight 7402C 133
In-Sight 7412 129
In-Sight 7432 129
In-Sight 7500 144
In-Sight 7500C 144
In-Sight 7501 144
In-Sight 7501C 144
In-Sight 7600 144
In-Sight 7600C 144
In-Sight 7800 144
In-Sight 7800C 144
In-Sight 7801 144
In-Sight 7801C 144
In-Sight 7802 144
In-Sight 7802C 144
In-Sight 7802P 144
In-Sight 7900 144
In-Sight 7900C 144
In-Sight 7901 144
In-Sight 7901C 144
In-Sight 7902 144
In-Sight 7902C 144
In-Sight 7902P 144
In-Sight 7905 144
In-Sight 7905C 144
In-Sight 8100 141
In-Sight 8100C 141
In-Sight 8101 141
In-Sight 8101C 141
In-Sight 8200 141
In-Sight 8200C 141
In-Sight 8400 141
In-Sight 8400C 141
In-Sight 8401 141
In-Sight 8401C 141
In-Sight 8402 141
In-Sight 8402C 141
In-Sight 8405 138
In-Sight 8502P 150
In-Sight 8502CP 150
In-Sight 8505P 150
In-Sight 8505CP 150
In-Sight 9902L 149
In-Sight 9912 144
In-Sight 9912C 144

Image Output Format

The image output consists of 2 parts: Header and Body. The image output is always binary in Big Endian format (PCs are little endian; applications need to convert endianness). In-Sight sends the default image from cell A0, and always send a full image. After the Header, the Body follows, which is raw pixel data starting from row0. To access the pixel data, the application should use the 'Offset' value in the Header. Image data consists of column-row ordered pixels starting from pixel 0,0.  For greyscale vision systems, pixels are 8-bit greyscale value. Color vision systems may be programmed to output one of three types of images: 0 = greyscale image; 1 = Bayer image and 4 = 24-bit color image.

Note: 24-bit color images are transmitted beginning at pixel 0,0, proceeding row-by-row. Each pixel is represented by three bytes (24 bits), with the first bit being Blue, the second bit being Green and the third bit is Red.

Header Format

Data Type Property Name Description
unsigned integer 32 bits

Length;

// length of packet including raw img

// data, excluding 'Length' itself.

unsigned integer 16 bits

Offset;

// offset from 'Ver' field to the raw image pixel data.

unsigned integer 16 bits

Ver;

// version = 0.

unsigned integer 16 bits

ImgHigh,ImgWide;

// original high x wide in pixels.

unsigned integer 16 bits

Row,Col;

// row & col of upper-left corner for

// this page, in original image scale.

unsigned integer 16 bits

High,Wide;

// high & wide of this page in pixel.

unsigned integer 16 bits

Rsub, Csub;

// image sub-sampling rate.

unsigned integer 16 bits

CellRow,CellCol;

// cell-coordinates for the image. 0.0 for cell A0.

unsigned integer 16 bits

RowIdx,ColIdx;

// interleaved index = 0.0 (for future use).

unsigned integer 32 bits

Color;

// RGB bits - should be 0 for greyscale, 1 for Bayer or 4 for 24-bit color.

unsigned integer 32 bits

AcqSeqNum;

// Acquisition Sequence Number

unsigned integer 32 bits

Rsrvd[1];

// reserved.

signed character 8 bits

Tag[16];

// optional tag string - null

// terminated (for future use).