ReadDeviceNet

Reads data into a spreadsheet cell from the (optional) DeviceNet Interface Module connected to an In-Sight serial port.

Note:
  • The selected serial port must be configured for DeviceNet communications, and the In-Sight vision system must be Online. For more information, see Serial Port Settings Dialog.
  • DeviceNet is only available on In-Sight vision systems using In-Sight firmware 4.x.x, and is not available on In-Sight vision systems running In-Sight firmware 5.1.0 and later. For a complete list of models and supported firmware versions, see Firmware Versions .
  • When using the CIO-1450 I/O Module, if a serial packet is greater than 256 bytes (including termination character), there could be a loss of serial communication between the In-Sight vision system and I/O module, requiring the power to be cycled on both.
  • The ReadDeviceNet function requires a third-party RS-232-to-DeviceNet Gateway adapter. This function is available for legacy installations and should not be used in new applications, unless the RS-232-to-DeviceNet Gateway converter has been thoroughly tested to verify it is suitable for the application.

ReadDeviceNet Inputs

Syntax: ReadDeviceNet(Event,Port,Mapping,Compatibility Mode)

Parameter Description

Event

Specifies the update event on which to read data.

  • This parameter must reference a cell containing an Event function in order to return data. For more information, see Event.
  • The Event function's Trigger parameter must specify Serial Port 1 and the Manual parameter must be unchecked.
  • The Event function will appear in the Job Edit toolbar as Event(65,0).

Port

Specifies the serial port (0 or 1) from which to read data, depending on the port availability of the active In-Sight vision system.

Mapping

Specifies a data mapping, which consists of a list of specifiers delimited by colon (:) characters. Each specifier has two parts:

  • The starting byte.
  • A data type code.

The various data type codes are listed in the following table:

Code Data Type

i

8-bit integer

u

8-bit unsigned integer

il

16-bit integer

ul

16-bit unsigned integer

f

32-bit floating-point number

s

Text string

Example: The data mapping, "0i:1f:5u:6s" specifies that the first data item (at offset 0) is an 8-bit integer, which triggers an acquisition if non-zero; the second item (at offset 1) is a floating-point value; the third (at offset 5) is a 1-byte unsigned integer; and the rest of the packet (starting at offset 6) is a string.

Note: The length of the data must match the DeviceNet block size specified in the DeviceNet details. For more information, see Serial Port Settings Dialog.

Compatibility Mode

Specifies whether or not an In-Sight 1000 interprets the incoming byte stream in the same order as an In-Sight 3000. This parameter is ignored for all other In-Sight models.

ReadDeviceNet Outputs

Returns

A ReadDeviceNet data structure containing the data read into the spreadsheet from the DeviceNet Interface Module, or #ERR if any input parameters are invalid.

Results

Data in the ReadDeviceNet structure is accessed using the GetBufferData function. For more information, see Input/Output.