# Devices Tags and $ Functions

The Devices tags and $ functions are used to interact with the In-Sight D900 series vision system and In-Sight ViDi PC.

## cam0

This refers to the properties of the vision system or a GigE camera when using the In-Sight ViDi PC.

Tag/$ Function | Data Type | Read-Only | Description
--- | --- | --- | ---
$Devices.cam0.ActualCameraModel | String | X | Gets the name of the camera model actually present in the system.
$Devices.cam0.ApplySettings() | Action | N/A | Forces the camera settings to be applied immediately, so that the effects of the setting updates are already visible in the next acquired image.
$Devices.cam0.Autofocus() Note: This $ function is only supported when connected to an In-Sight D900 series vision system with the autofocus accessory attached.
$Devices.cam0.AutoWhiteBalance() Note: This $ function is not supported.
$Devices.cam0.Delay | Integer |  | Gets and/or sets of the specified camera's delay between the time that a trigger to acquire an image is received, and the time camera begins the image acquisition. No additional triggers are accepted during this delay period, and any received triggers during this period will result in a Missed Trigger event.
$Devices.cam0.Exposure | Double |  | Gets and/or sets the exposure time of the specified camera. When the camera receives an image acquisition trigger signal, light is integrated into the image sensor array for the specified duration. Shorter durations are better suited for stopping motion, but may require larger lens apertures or higher Gain settings to achieve sufficient image intensity.
$Devices.cam0.Focus Note: These tags and $ functions are only supported when connected to an In-Sight D900 series vision system with the autofocus accessory attached.
$Devices.cam0.FlushImages() | Action |  | Removes all images from the vision system image buffer of the selected camera (specified with cam0), preventing queued images from being returned by the subsequent executions. Note: If the Trigger Mode of cam0 is set to Internal, then the next execution will trigger a new image on the camera. If the Trigger Mode is set to Camera, Industrial Ethernet or some precision IO event, then calling this function discards images that may have been acquired but not yet consumed.
$Devices.cam0.Gain | Integer |  | Gets and/or sets the specified camera's gain: Defines the gain of the amplifier stage that precedes the analog-to-digital conversion.
$Devices.cam0.Illumination Note: These tags and $ functions are only supported when connected to an In-Sight D900 series vision system with the illumination accessory attached.
$Devices.cam0.IO Note: These tags and $ functions are not supported.
$Devices.cam0.IsConnected | Boolean | X | Returns True if the camera is connected to the PC, and returns False if the camera is disconnected.
$Devices.cam0.NumberofColumns | Integer | X | Gets and/or sets the number of columns of the image that will be acquired on the specified camera.
$Devices.cam0.NumberOfImageBuffers | Number |  | Gets and/or sets the number of image buffers to allocate for acquisition on the specified camera.
$Devices.cam0.NumberofRows | Integer |  | Gets and/or sets the number of rows of the image that will be acquired on the specified camera.
$Devices.cam0.Offset | Integer |  | Gets and/or sets the Direct Current (DC) level that is added or subtracted from the camera's analog signal before the analog-to-digital conversion of the specified camera. The Offset affects the image's brightness and darkness, while maintaining the dynamic range within the image.
$Devices.cam0.Orientation | Integer |  | Gets and/or sets the orientation of the acquired image of the specified device. 0 = Normal (default) 1 = Vertical Flip 2 = Horizontal Flip 3 = Rotate 180 degrees Note: Do not change the Orientation while the device is online; doing so may put the device in an unpredictable state.
$Devices.cam0.ProjectCameraModel | String | X | Gets the camera type.
$Devices.cam0.StartColumn | Integer | X | Gets and/or sets the first column to be transferred from the image sensor into memory on the specified camera.
$Devices.cam0.StartRow | Integer |  | Gets and/or sets the first row to be transferred from the image sensor into memory on the specified camera.
$Devices.cam0.StrobePolarity | Integer |  | Gets and/or sets the strobe polarity of the specified camera. 0 = High 1 = Low NPN Configuration: When set to High, the signal is HIGH when the image sensor on the device is being exposed, otherwise the signal is LOW. If set to Low, the signal is LOW when the image sensor of the device is being exposed, otherwise the signal is HIGH. The signal is always pulsed for the duration of the exposure. The Exposure time must be 0.50 ms greater than the strobe pulse duration specified on the external strobe device. PNP Configuration: When set to Low, the signal is LOW when the image sensor on the device is being exposed, otherwise the signal is HIGH. If set to Low, the signal is HIGH when the image sensor of the device is being exposed, otherwise the signal is LOW. The signal is always pulsed for the duration of the exposure. The Exposure time must be 0.50 ms greater than the strobe pulse duration specified on the external strobe device.
$Devices.cam0.StrobeStart | Integer |  | Gets and/or sets the mode which controls when the strobe signal fires for the specified camera.
0 | = Acquisition Start: When set to Acquisition Start, the strobe is activated when exposure begins (also includes any configured trigger delays).
1 | = Camera Trigger: When set to Camera Trigger, the strobe is activated when an acquisition trigger is received. The strobe will be active during the specified Delay (ms) period.
2 | = All Rows Exposed: When set to All Rows Exposed, the strobe is activated when all rows of a rolling shutter sensor are simultaneously exposing.
$Devices.cam0.TriggerDebounce | Double |  | Gets and/or sets the trigger debounce period for the specified camera. Defines the amount of time (0-65.535 milliseconds; default = 0.5) that the input trigger must remain active to be recognized as a valid trigger, when the Trigger Mode property is set to Camera. This setting will delay the recognition of a valid trigger by the amount of time specified. For example, if the value is set to 1.0 milliseconds, the direct trigger to the device must be sustained for at least 1.0 milliseconds for an acquisition to be triggered. Note: The Trigger Mode property must be set to Camera to use this property.
$Devices.cam0.TriggerMode | String |  | Gets and/or sets how the specified camera will be triggered to acquire an image. Accepted values when setting:
0 | Camera | Enables image acquisition on the trigger issued directly to the camera.
1 | Timer Interval | Enables image acquisition on triggers issued at a user specified interval.
2 | Continuous (default) | Enables free running (as fast as possible) image acquisitions.
3 | Manual | Enables image acquisition on the trigger issued manually by users.
4 | Industrial Ethernet | Enables image acquisition on triggers originating from an Industrial Ethernet protocol.
5-12 | DiscreteInput 0-7 | Enables image acquisition on triggers originating from a specified discrete input line.
$Devices.cam0.WhiteBalance() Note: These tags and $ functions are not supported.

## CommunicationCard

These tags reference the properties associated with Industrial Communications. When connected to a vision system, the following tags are supported:

Tag/$ Function | Data Type | Read-Only | Description
--- | --- | --- | ---
IsConnected | Boolean | X | Returns True if the Communication Card is connected; returns False if disconnected.
PlcConnectionUp | Boolean | X | Returns True if the PLC connection is active; returns False if the connection to the PLC is disconnected.
ProtocolStatus | Integer | X | Returns the following, based on the PLC connection status: 4931 = Connected 4930 = Connecting -2147478715 = Connection Faulted 4929 = Connection Idle -2147478716 = Connection Rejected -2147478701 = Connection Timeout

## TcpServer

These tags reference a TCP Server connection. When connected to a vision system, the following tag is supported:

Tag | Data Type | Read-Only | Description
--- | --- | --- | ---
IsConnected | Boolean | X | Returns True if the TcpServer is connected; returns False if disconnected.

## TcpClient

These tags reference a TCP Client connection. When connected to a vision system, the following functions and tags are supported:

Description | Data Type | Read-Only | Description
--- | --- | --- | ---
Flush() | Action | N/A | Sends the string specified with the argument message to all connected TCP/IP client devices. message: String, specifying the message to broadcast.
IsConnected | Boolean | X | Returns True if the TcpClient is connected; returns False if disconnected.