GET_PIN_ON_NET

The GET_PIN_ON_NET function returns a string containing a reference to a particular pin on a net. The function can be used in conjunction with GET_PIN_COUNT_ON_NET to enumerate the pins on a net. If the net is connected to others, e.g. via a series resistor, the pins returned are from all the linked nets.

Syntax

GET_PIN_ON_NET( STRING netName, INT index )

Parameters

netName

A string identifying a net in the form 'board.net', e.g. a string returned from GET_NET_FROM_PIN. The board name is optional, but the net name must uniquely identify the net, so if there is any ambiguity then the board name must be supplied.

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 netName supplied does not contain a board name and matches more than one net.
  • The index is equal to or greater than the number of pins on the net as returned by GET_PIN_COUNT_ON_NET.

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 dataNet := GET_NET_FROM_PIN(DATA[0]);
STRING pinString;
INT pinIndex;
INT count := GET_PIN_COUNT_ON_NET(dataNet);

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

Output

IC5.9
JP2.1
JP5.2
JP2.2
IC3.2
R29.2