The pin mapper

The pin mapper draws your MicroController. Each pin you use gets a block, and each block is tied to a tag.

The pin mapper for an Arduino Mega 2560: a servo on D9, a motor on D5, D30 and D31, and a stepper on D22 to D25
The pin mapper on an Arduino Mega 2560, with a servo, a motor and a stepper.

Map a pin

  1. Connect the MicroController and open its MicroController Link. Stop the PLC.
  2. Open the Link's mapping page. It shows your board.
  3. Drag a block onto a pin. Or select a block and press Enter on a pin.
  4. Choose a tag that exists, or type a new name and pick Create <Name>, which makes a Global tag of the type the block needs. An existing tag must already have that type.
  5. Save the mapping, then run a small test and watch the tag change.

The mapping blocks

BlockTag it fills or reads
Digital Input (DI)A BOOL. On when the pin reads high. Choose pull-up, pull-down or no pull where the board allows.
Digital Output (DO)A BOOL your logic writes to the pin.
Analog Input (AI)A number read from an analog pin. A temperature preset scales it to °C.
Analog Output (AO)A DINT from 0 to 255, written to a true analog output. Only some boards have one.
PWMA DINT from 0 to 255 for brightness or speed. Needs the Connection Service route.
Device (DEV)A part that uses one or more pins and owns several tags. See below.

Devices

A Device block places a whole part, such as a servo or a keypad. Name it, pick its pins, and the mapper creates the device's tags under that name, such as Servo1.Angle.

  • Servo: set an angle from 0 to 180 degrees.
  • Stepper: move a number of steps forward or back, with a Remaining count and a State.
  • DC motor or fan: set a speed from 0 to 100 percent, one direction only.
  • Buzzer: play a tone of a set frequency and length.
  • Distance sensor, temperature sensors, a temperature and humidity sensor, a pulse counter, an IR receiver and a 4x4 keypad as inputs.
  • An accelerometer and gyroscope, an OLED display, a 4-digit display, a one-digit display, a shift register and a card reader, where the board offers them.

Servo, stepper and motor are for low-voltage training parts on a bench, each on its own external supply. They are not for machinery or anything a person relies on for safety.

What each MicroController supports

MicroControllerInput pullNotes
Arduino Uno R3Pull-up and no pullFewer servos, steppers and counters than the Mega 2560.
Arduino UNO R4 WiFiPull-up and no pullUses the D2 to D13 header.
Arduino Mega 2560Pull-up and no pullMore pins than the Uno R3 and the UNO R4 WiFi.
Raspberry Pi Pico (RP2040)Pull-up, pull-down and no pullHas no analog output. Use PWM for brightness or speed.
ESP32 DevKitPull-up, pull-down and no pullHas analog outputs, on GPIO25 and GPIO26.

All five boards offer digital inputs and outputs, analog inputs, PWM and the device blocks above. What a board can do is read from the board itself, so a block or pin that does not fit is greyed out with the reason. Update the firmware if a board shows less than you expect.

Good to know

  • A pin can hold one block. A pin a device claims is greyed for everything else.
  • Change a mapping only while the PLC is stopped.
  • A mapping stops being approved when the mapping, the board or its pins change, or when the Link disconnects. Review and authorize it again.

Related