SetDiscreteInput

Configures input settings that are found in the Discrete I/O Settings dialog. For more information, see Discrete I/O Settings

Note:
  • When issuing this command, the In-Sight system must be Offline.
  • There are two options for enabling serial communication for the In-Sight 70xx - 74xx series vision system: using the Breakout cable or using the CIO-MICRO or CIO-MICRO-CC I/O module. When connected to the Breakout cable (and there is no connection to an I/O module), the vision system allows one discrete input line and one discrete output line to be configured as Serial Receive and Serial Transmit, respectively.
  • Use the Store Settings (TS) native mode command to save changes to the proc.set file. If not saved to the proc.set file, the changes will be lost after power-cycling the In-Sight vision system. For more information, see Store Settings.

SetDiscreteInput Inputs

Syntax: EV SetDiscreteInput(LineID,"Name",Type,Signal)

Note: The Online/Offline, Acquisition Trigger and Job Load Switch input types may not be used on more than one input line simultaneously.
Parameter Description
LineID

In-Sight 2000 series:

  • 0: The vision sensor is connected to the Breakout cable and a Direct I/O connection has been established in the I/O Module Configuration dialog.
  • 1 to 7: The vision sensor is connected to the I/O Module cable and a connection to a CIO-1400 I/O module has been established in the I/O Module Configuration dialog.

In-Sight Micro 1000 series, In-Sight 5000 series and In-Sight 8000 series:

  • 0: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and a Direct I/O connection has been established in the I/O Module Configuration dialog.
  • 0 to 7: The vision system is connected to the I/O Module cable and connect to a supported I/O module. For more information, see I/O Module Support.

In-Sight 70xx - 74xx series:

  • 1 to 3: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and a Direct I/O connection has been established in the I/O Module Configuration dialog.

  • 0 to 7, 9, 10, 11: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and an Ethernet connection to a CIO-MICRO I/O module has been established in the I/O Module Configuration dialog.

In-Sight 7000 Gen2 series and In-Sight 9912 vision systems:

  • 0 to 3: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and a Direct I/O connection has been established in the I/O Module Configuration dialog.
  • 0 to 7, 9, 10, 11: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and an Ethernet connection to a CIO-MICRO I/O module has been established in the I/O Module Configuration dialog.
  • 0 to 7: The vision system is connected to the I/O Module cable (CCB-PWRIO-MOD-xx) and an Ethernet connection to a CIO-MICRO I/O module has been established in the I/O Module Configuration dialog.
  • 1 to 7: The vision system is connected to the I/O Module cable (CCB-PWRIO-MOD-xx) and a connection to a CIO-1400 I/O module has been established in the I/O Module Configuration dialog.

In-Sight 9902L:

  • 1: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and a Direct I/O connection has been established in the I/O Module Configuration dialog.
  • 0 to 7 and 9: The vision system is connected to the Breakout cable (CCB-PWRIO- xx or CCB-PWRIO- xxR) and an Ethernet connection to a CIO-MICRO I/O module has been established in the I/O Module Configuration dialog.
  • 0 to 7: The vision system is connected to the I/O Module cable (CCB-PWRIO-MOD-xx) and an Ethernet connection to a CIO-MICRO I/O module has been established in the I/O Module Configuration dialog.
  • 1 to 7: The vision system is connected to the I/O Module cable (CCB-PWRIO-MOD-xx) and a connection to a CIO-1400 I/O module has been established in the I/O Module Configuration dialog.
"Name"

The name for the input line.

Note: The "Name" input must be enclosed in quotation marks.
Type
  • 0 = User Data (default)
  • 1 = Event Trigger (1= Reset Counters if using the In-Sight 2000 series vision sensor)
  • 2 = Job ID Number (not supported on the In-Sight 2000)
  • 3 = Online/Offline
  • 4 = Acquisition Trigger (not supported on the In-Sight 2000 series vision sensors or the CIO-1400 I/O module.)
  • 5 = Job Load Switch (not supported on the In-Sight 2000)
  • 8 = Serial Receive (Direct I/O only; only valid when LineID = 1)

    Note:
    • Serial Receive is only available when connecting to an In-Sight 70xx - 74xx series vision system with In-Sight Explorer 4.7.1 or later, and using In-Sight 4.7.1 or later firmware.
    • When the SetDiscreteInput command is issued and Input Line 1 is set to Serial Receive, the vision system determines if Output Line 1 is set to Serial Transmit. If not, Input Line 1 is temporarily reset to the default input type for this line. Once the SetDiscreteOutput command is issued, and Output Line 1 is set to Serial Transmit, Input Line 1 is automatically set to Serial Receive.
  • 9 = Job Change (Pulsed)

    Note: Job Change (Pulsed) is only available when connecting to an In-Sight 2000 series vision sensor running In-Sight 5.2.3 or later firmware.
Signal
  • 0 = Rising Edge (default)
  • 1 = Falling Edge
  • 2 = Both Edges

SetDiscreteInput Outputs

Returns a status code, followed by the number of characters (in bytes) for the results, then the results in XML format. The status codes are:

Status Codes Description
1 The command was executed successfully.
0 Unrecognized command.
-2 The command could not be executed.
-6 User does not have Full Access to execute the command. For more information, see User Access Settings Dialog.

SetDiscreteInput Example

To configure the following settings:

  • LineID: 4
  • "Name": Line 4
  • Type: Job ID Number
  • Signal: Rising Edge

Issue the following command:  EV SetDiscreteInput(4,"LINE4",2,0)

The In-Sight sensor responds with a status code (1), followed by the number of characters, in bytes (18). Finally, the results are returned in XML format.