Skip to workspace
BAS Bridge
System explorer

Level 5 · Programming fundamentals

Write your first input-to-output assignment

18 minutes · Intermediate

Reading open · Practical open · Knowledge check open

What you’ll learn

  • Identify a binary input, a numeric value and a writable output in a scan trace.
  • Predict assignment results and distinguish software output from physical response.
Before you start · 2 related lessons0 of 2 prerequisites demonstrated. You can open this lesson at any time.

A program makes a repeatable decision

A controller program reads values, applies rules and requests outputs. A variable is a name holding a value. Occupied may hold the value true or false. ZoneTemperature may hold a number with units, such as 73°F. An input receives information. An output requests an action. Assigning a value stores the result in the destination variable.

Make one assignment

For the first virtual project, the request for exhaust follows room occupancy. In words, assign the current value of Occupied to Start. In the graph, wire the binary point input for EF-01.OCC to the value pin of the binary point output EF-01.EF-CMD. A connection passes a value. The virtual controller repeats the program at its configured interval, called a . Actual airflow follows the equipment state and its local enable.

Combine numeric and Boolean values

Subtract two temperatures to calculate an error. For example Room = 75°F and Target = 72°F gives Excess = 3°F. A comparison such as Excess greater than 2°F converts the number into true or false. At exactly 2°F the strict comparison is false. An AND operator needs both conditions true. OR needs at least one true, and NOT reverses a Boolean. A conditional chooses a value based on a true or false result.

Follow state across scans

A simple subtraction function returns its result from its current inputs. A timer function block also has a particular with memory, such as elapsed seconds. That state helps today’s scan use previous scans. Retaining a value across a program cycle does not establish that it will survive a power loss or a download. Check controller and project settings. During debugging, inspect the input, intermediate calculation, written output and equipment response in order.

One scan from physical input to verified output
  1. Input snapshot
  2. Assigned output
  3. Equipment response

Normal operation

Example training conditions

  • Occupancy changes to true at 09:00:02. In this training example the graph executes at 09:00:00, :05 and :10. The Start output first reads true at :05.
  • With the local enable present the exhaust fan then accelerates and air delivery rises. A running command and a positive airflow sample can occur at different times.

Worked service example

The operator reports that the new program ignored a brief occupied request.

Recorded field evidence · training example

  • Capture times for the 5-second task: 10:00:00, :05 and :10.
  • An independent event recorder shows the input true from :01 to :03, then false. The task sampled false at :00 and :05.
  • Program output stayed false during both recorded task scans.

The pulse occurred entirely between samples, so this scan record can explain the missing response. Confirm whether this signal is specified as a maintained level or an event. Choose an approved capture strategy if short events must be recognized. An output trace alone could not distinguish a missed sample from a logic fault.

Terms in this lesson
Assignment
Writing the calculated or copied value into a named destination.
Boolean
A value with two possible states, true and false.
Scan
One execution of the controller task.
Instance
One particular copy of a function block with its own state.

Hands-on exercise

Interpret a three-stop scan record before building the occupancy project in the virtual controller.

Predict before inspection

The graph assigns Start from Occupied every scan. If Occupied changes just after a scan and stays true, when can Start reflect it?

Knowledge check

Pass at 80%.

1. The program calculates Excess = Room minus Target. Room is 78°F and Target is 74°F. Find Excess.
2. Which block needs state from previous scans to implement an on-delay?
3. The condition is strictly greater than 4 and the current value is exactly 4. What is returned?
4. Which value is Boolean?
5. A copied program calculates the correct command. What establishes that the equipment delivers air?

Field takeaways

  • Write down the input snapshot, calculated result, output owner and physical consequence at their respective times.

References and further reading

Technician handbook