Skip to Content

I/O Panel

Operate the inputs of your Add-On Instruction in Rungs Studio as real pilot devices — push buttons, emergency stops, selector switches and potentiometers — and watch what your logic does with them.

An Add-On Instruction (AOI) does nothing on its own. Something has to call it and hand it values: a start button, a door switch, a level reading. On a real machine those values come from devices wired to the controller. In Rungs Studio they come from the I/O Panel, which stands in for the program that calls your AOI.

The panel is the I/O Panel tab in the right sidebar. It lists every tag with its current value. You can change Input and InOut tags, because those are the values a caller supplies. Output and Local tags are read-only, because your logic sets them.

Inputs are pilot devices

A real input is never just a 0 or a 1. It comes from a button or a switch on a control panel, and that device decides how the value changes. A start button gives a 1 only while a finger is on it. An emergency stop stays pressed until someone releases it by hand. Logic that works with a switch you click on and off can fail with a real push button, so the panel lets you try your logic with the device it will meet.

The buttons and switches that a person operates on a control panel are called pilot devices. The part of a pilot device that switches one input is a contact block. A pilot device can have several contact blocks, and it moves them together.

Every BOOL Input is one contact block on one of these pilot devices:

Pilot deviceHow it moves
Push buttonPressed while you hold it. It springs back when you let go
Emergency stopStays pressed until you click it again to release it
Selector switchA knob with two or three positions. It stays where you turn it
General switchStays where you put it, like a door switch or a limit switch

A new BOOL Input is a general switch: one click turns it on, and the next turns it off. How it is drawn depends on the view you choose, described below. To make it another pilot device, right-click its row and choose from the menu. You can do this while the program runs: it keeps running, and only the pilot device you changed starts over.

Normally open and normally closed

Each contact block is normally open (NO) or normally closed (NC). "Normally" means at rest, with nobody touching the pilot device. Your program reads 1 while the contact block is closed.

Contact blockAt restOperated
Normally open (NO)01
Normally closed (NC)10

A stop button is usually wired normally closed. It reads 1 all the time and drops to 0 when pressed. If the wire breaks, the input also drops to 0, and the machine stops. That is why stop circuits are built this way, and why your logic for a stop button usually looks for a 0.

For example, make In_Stop a push button with a normally closed contact block. It reads 1 until you press it:

What you doIn_Stop reads
Nothing1
Hold the button0
Let go1

Operating a pilot device

  • Push button: hold it down to press it and let go to release it. To keep it pressed without holding, Shift-click it, or choose Keep pressed in its menu. The next click lets it go.
  • Emergency stop and general switch: click to turn it over. It stays.
  • Selector switch with two positions: click to turn it to the other position.
  • Selector switch with three positions: click one of its inputs to turn the switch to the nearest position that changes that input.

The positions of a selector switch

On a selector switch, each contact block sits in a position: left or right, and on one with three positions also the centre. The switch operates a contact block while it stands in that position. So a normally open contact block reads 1 there and 0 in every other position. A normally closed one reads 0 there and 1 in every other position.

For example, a selector switch with two positions has a normally open contact block for In_Run at the right:

PositionIn_Run
Left0
Right1

You choose the position of a contact block in the Position part of the menu. A position holds one contact block, so a selector switch takes as many contact blocks as it has positions. If you choose a position that is taken, the two contact blocks swap places.

The menu lists 2-position selector switch and 3-position selector switch as two pilot devices. A switch with three positions can become one with two as long as no contact block is at the centre, because a switch with two positions has no centre. Until then the menu shows 2-position selector switch greyed out with the reason. Move that contact block to a side first.

You can always make a selector switch another pilot device, such as a push button. Each contact block keeps whether it is normally open or normally closed.

A selector switch can spring back, like a jog switch that returns when you let go. On a switch with three positions, tick Springs back from left or Springs back from right in the menu, and that side returns to the centre. On a switch with two positions, tick Springs back from right, and it returns to the left. A side that springs back works like a push button: hold it, or Shift-click to keep it.

One pilot device, several inputs

Some pilot devices switch more than one input. A two-channel emergency stop has two normally closed contact blocks and opens both at once. A Hand/Off/Auto selector switch has one contact block for Hand and one for Auto, and the centre closes neither.

To put two inputs on one pilot device, right-click one of them, choose Link with, and pick the other. The input you right-clicked joins the pilot device of the one you picked, and keeps its own contact block. The panel then shows them as one block, and one click moves them together. Unlink from makes an input a pilot device of its own again.

For example, to make a two-channel emergency stop from In_EStopCh1 and In_EStopCh2:

  1. Right-click In_EStopCh2, choose Link with, and pick In_EStopCh1.
  2. Right-click either input and choose Emergency stop. Choosing a pilot device does not change a contact block, so both are still normally open.
  3. On each of the two inputs, choose Normally closed (NC).

The stop now starts pressed, because the Default Value of both inputs is 0 (see Where a pilot device starts):

What you doIn_EStopCh1In_EStopCh2
Nothing00
Click to release the stop11
Click to press it again00

Another example is a Hand/Off/Auto selector switch with three positions, In_Hand at the left and In_Auto at the right, both normally open:

PositionIn_HandIn_Auto
Left10
Centre00
Right01

A selector switch takes one contact block for each position. A push button, an emergency stop and a general switch take any number.

Where a pilot device starts

When you press Start, each pilot device goes to the position that matches the Default Value of its inputs. A general switch whose input has a default of 1 starts closed. A Hand/Off/Auto selector switch whose In_Auto default is 1 starts at Auto. A pilot device only starts in a position it can stay in, because nobody is holding it when the simulation starts. A push button therefore always starts at rest: a normally closed one starts at 1, whatever its default is. A selector switch that springs back from one side never starts on that side. When no position matches the defaults, the pilot device starts at rest.

While the simulation is stopped, you cannot change an input, because Start would put it back where it starts anyway. Point at an input and the panel says so. Press Start, or Step to start it paused, and then work the inputs. The menu of an input still works while the simulation is stopped, so you can choose its pilot device first. For an input that should start at another value, change its Default Value in the Tags tab. Its pilot device then starts in the position that matches it, if it can stay there, as described above.

An AOI unit test does not use the panel's pilot devices. It starts every input from its Default Value and sets the inputs it needs itself.

When your logic writes to an input

A pilot device is hardware. Your logic can write to an Input, but it cannot move the pilot device. Before every scan, the panel gives each Input its value again: what its pilot device reads, or the number you typed. So what your logic writes to an Input lasts until the end of that scan, and the next scan starts from the panel's value again. The panel always shows the value it gives. The ladder editor and the Trend show the value the tag holds after the scan, so there you see what your logic wrote.

For example, In_Start is a switch that is on, and the logic has the line In_Start := 0;:

MomentIn_Start
Start of a scan1
After the line In_Start := 00
Start of the next scan1

An AOI unit test does not set an Input again before every scan. It sets an Input only at a step that has in. So in a test, a value your logic writes to an Input stays until a later step sets that Input. In the example above, In_Start would stay 0.

Three ways to see the inputs

Three icons on the Inputs row switch how the BOOL Inputs are drawn. Studio starts with North American symbols. The choice is yours and is not saved with the AOI.

  • Switches: every input is an on/off switch that shows its value.
  • North American symbols: contact blocks as North American wiring diagrams draw a contact, with two terminals and the bar or blade that joins them.
  • IEC symbols: contact blocks as IEC wiring diagrams draw a contact, with a blade that closes a gap in the line.

While the simulation runs, an input that is 1 is green, the colour of a rung that has power: a switch that is on has a green track, and in the symbol views a closed contact block is green. While the simulation is paused, that green is amber. While the simulation is stopped, nothing has power, so every switch and every contact block is grey. The thumb of a switch and the shape of a contact block still show its value. A switch that is off and an open contact block are grey all the time. A selector switch shows its knob: click the knob to turn it one position.

With the keyboard

Every input is one Tab stop. The keys do what the mouse does.

KeyWhat it does
Space or EnterA click on that input. A push button is pressed while the key is down
Shift+SpaceKeeps a push button pressed. Space lets it go
Left and Right arrowsTurn a selector switch one position
Shift+arrowKeeps a selector switch on a side that springs back. The arrow back lets go
Shift+F10Opens the menu of that input

On a phone or tablet, hold a finger on the name of an input to open its menu. Holding a finger on the switch itself presses the pilot device.

Number inputs

A number Input (SINT, INT, DINT or REAL) starts as a fixed value: type a value and press Enter, and it stays there. That is fine for a preset or a count. But many number inputs are measurements, such as a tank level or a temperature, and a measurement does not jump from one value to another. It rises and falls, and it is never perfectly steady. To try your logic against that, right-click the input and make it a potentiometer or a ramp. On a real panel, a potentiometer is a knob that sets a value in a range.

ChoiceWhat it does
Fixed valueYou type the value, and it stays there
PotentiometerYou drag the value inside a range, and can still type it
RampA potentiometer that moves to where you put it at a speed, not all at once

The potentiometer

A potentiometer draws the field on a bar. The filled part shows where the value is in its range. Drag anywhere on the bar: the whole width is the whole range, so the value follows the pointer and stops at each end. A click without a move opens the field for typing.

A new potentiometer gets a range without any typing: 0 to 100, or 0 to 32767 for an INT and 0 to 127 for a SINT. To change it, choose the range in the menu. A small box opens under the row with the lowest and the highest value. Press Enter to keep them or Escape to give them up.

Dragging stays inside the range, but typing does not have to. This lets you try a faulty sensor. Type 150 into a potentiometer that runs from 0 to 100 and your logic gets 150, shown in amber so you can see it is outside the range.

The Set to part of the menu puts the value at its lowest, its default or its highest in one click.

The ramp

A ramp is a potentiometer with a speed. Choose how long the whole range takes: 3, 10 or 30 seconds. When you put the value somewhere, it moves there at that speed while the program runs. A thin line on the bar shows where it is going, and the filled part shows where it is now.

For example, a level from 0 to 100 with a speed of 10 seconds rises by 10 every second. Put it from 20 to 60 and it arrives 4 seconds later, so you can watch your high-level alarm come on as the level passes it.

A ramp moves on the simulation's own clock, so it waits while the simulation is paused.

Noise

A real measurement flickers. Tick Noise in the menu and the value your logic reads moves a little around where you put it: three times a second, by up to one hundredth of the range. On a range of 0 to 100 that is up to 1 either way. Use it to check that an alarm does not switch on and off when the value sits right at its limit.

Noise is only there while the program runs. A small sign in the row shows when a ramp or noise is on, so a value that moves by itself is never a surprise. A value that moves never overwrites a field you are typing in.

You can change the speed, the range and the noise while the program runs. The simulation carries on.

Number inputs with the keyboard

KeyWhat it does
TabGoes to the next input and selects its whole value
EnterKeeps what you typed
EscapeGives up what you typed
Up and Down arrowsStep the value
Shift+arrowSteps ten times as far
Shift+F10Opens the menu of that input

A step is 1 for a whole number. For a REAL potentiometer it is about one hundredth of the range, rounded to a round number: 1 for 0 to 100, 2 for -40 to 150, and 0.01 for 0 to 1. Stepping stays inside the range.

A tag shown in Hex, Binary or another style than a plain number stays a fixed value. A potentiometer needs a number line to drag along.

InOut tags

An InOut tag belongs to the caller, so it has no default value. Instead, what you type into an InOut while the simulation is stopped is its start value. Studio saves it with the AOI and puts it back every time you press Start.

Every InOut can have a start value, arrays included. For a structured InOut, such as a TIMER, you type it into the members, such as PRE.

Outputs and Local tags as lamps

Your logic sets the Output and Local tags, so the panel only shows them. A BOOL is a single bit: it is 0 or 1. On a real machine a bit that is 1 often lights a lamp, and the panel can show it that way.

Two buttons on the Outputs and Local headings choose how a bit looks. They are one setting for both groups:

  • 0101 shows each bit as its digit, 0 or 1.
  • The four small rectangles show each bit as a lamp: grey for 0, and green for 1, or amber while the simulation is paused. These are the same colours as a powered contact in a ladder rung. While the simulation is stopped, a lamp for 1 is a stronger grey than a lamp for 0, so you can still tell them apart.

One of the two is always on. With both on, each lamp has its digit on it.

A whole number shown in the Binary style gets a lamp for each of its bits. An INT that holds 5 reads 2#0000_0000_0000_0101, so its first and third lamps from the right are lit. The members of a timer or a counter that are bits, such as DN, are lamps too.

The buttons do not change Input and InOut tags, because those are yours to set. The choice is kept in your browser, not in the AOI.

What is saved

The pilot devices and the start values are saved in the .rungs file, so they come back when you open it again. An .L5X export leaves them out, because they describe the caller and not the instruction.

When you press Start, every pilot device goes back to where it starts: the position or the value that matches the tag's Default Value.

On this page