GET_PIN_ON_DEVICE

The GET_PIN_ON_DEVICE function returns a reference to a pin on a device. The function can be used in conjunction with GET_PIN_COUNT_ON_DEVICE to enumerate the pins on a device.

Syntax

GET_PIN_ON_DEVICE( STRING deviceReference, INT index )

Parameters

deviceReference

A device reference in the form 'board.device'. The read-only built-in UNIQUE_DEVICE_REF contains this string for the current test device file. The board name is optional, but the device reference must uniquely identify the device; if there is any ambiguity, then the board name must be supplied.

index
The index of the pin on the device to retrieve.

Return value

A STRING value containing a pin reference for the pin, in the form 'board.device.pin' or 'device.pin' if the project only contains a single board. This string can be decomposed using GET_PIN_INFO.

Errors

An error can occur in the following circumstances:

  • The deviceReference supplied does not match any device in the project.
  • The deviceReference supplied does not contain a board name and matches more than one device.
  • The index is equal to or greater than the number of pins on the device as returned by GET_PIN_COUNT_ON_DEVICE.

In all these cases, if the expressions are constant, the error will occur at compile-time. Otherwise, the error will occur at run-time, when the function is run.

Example

STRING pinString;
INT pinIndex;
INT count := GET_PIN_COUNT_ON_DEVICE(UNIQUE_DEVICE_REF);

FOR pinIndex := 0 FOR count
  pinString := GET_PIN_ON_DEVICE(deviceIC1, pinIndex);
  PRINT(pinString, "\n");
END;

Output

IC1.1
IC1.2
IC1.3
IC1.4
IC1.5
IC1.6
IC1.7
IC1.8
IC1.9
IC1.10
IC1.11
IC1.13
IC1.14