{"id":1439,"date":"2026-08-03T20:47:57","date_gmt":"2026-08-03T20:47:57","guid":{"rendered":"https:\/\/b9xelectronics.com\/?page_id=1439"},"modified":"2026-08-07T10:45:19","modified_gmt":"2026-08-07T10:45:19","slug":"b9x-ladder-editor","status":"publish","type":"page","link":"https:\/\/b9xelectronics.com\/?page_id=1439","title":{"rendered":"B9X Ladder Editor"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-cf347ce3-9fe0-479a-a076-01d03c3e22c4\" href=\"https:\/\/b9xelectronics.com\/wp-content\/uploads\/2026\/08\/setupB9XLE25.zip\">setupB9XLE25<\/a><a href=\"https:\/\/b9xelectronics.com\/wp-content\/uploads\/2026\/08\/setupB9XLE25.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-cf347ce3-9fe0-479a-a076-01d03c3e22c4\">Click To Download Free Rung Limited Version<\/a><\/div>\n\n\n\n<!-- Paste this entire block into a WordPress Custom HTML block. -->\n<style>\n.b9x-ladder-ref{--b9x-maroon:#68162f;--b9x-dark:#481020;--b9x-pale:#f6eef1;--b9x-ink:#262626;max-width:1080px;margin:0 auto;color:var(--b9x-ink);font-family:Arial,Helvetica,sans-serif;font-size:17px;line-height:1.62}\n.b9x-ladder-ref *{box-sizing:border-box}\n.b9x-ladder-ref h1{color:var(--b9x-dark);font-size:2.25rem;line-height:1.15;margin:.2em 0 .25em}\n.b9x-ladder-ref h2{color:var(--b9x-maroon);font-size:1.65rem;line-height:1.25;margin:1.7em 0 .45em;border-bottom:2px solid var(--b9x-pale);padding-bottom:.2em}\n.b9x-ladder-ref h3{color:var(--b9x-dark);font-size:1.28rem;line-height:1.3;margin:1.35em 0 .35em}\n.b9x-ladder-ref h4{color:var(--b9x-maroon);font-size:1.08rem;margin:1em 0 .25em}\n.b9x-ladder-ref p{margin:.25em 0 .9em}\n.b9x-ladder-ref a{color:var(--b9x-maroon)}\n.b9x-hero{border-left:7px solid var(--b9x-maroon);padding:1.2rem 1.4rem;background:linear-gradient(90deg,var(--b9x-pale),#fff);margin-bottom:1.5rem}\n.b9x-subtitle{color:#666;font-size:1.12rem;margin:0}\n.b9x-toc{background:#faf8f9;border:1px solid #eadce1;padding:1rem 1.25rem;margin:1.25rem 0 2rem}\n.b9x-toc ul{columns:2;column-gap:2rem;margin:.5em 0;padding-left:1.2em}\n.b9x-card{border:1px solid #dfd4d8;border-left:5px solid var(--b9x-maroon);padding:1rem 1.1rem;margin:1rem 0;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.04)}\n.b9x-example{background:var(--b9x-pale);border:1px solid #dfcbd2;padding:.8rem 1rem;margin:.65rem 0;font-family:Consolas,monospace;font-size:.94em}\n.b9x-note{background:#f4f4f4;border-left:4px solid #999;padding:.75rem 1rem;margin:.65rem 0}\n.b9x-table-wrap{overflow-x:auto;margin:1rem 0 1.5rem}\n.b9x-ladder-ref table{width:100%;border-collapse:collapse;font-size:.94em}\n.b9x-ladder-ref th{background:var(--b9x-maroon);color:#fff;text-align:left;padding:.65rem;border:1px solid var(--b9x-dark)}\n.b9x-ladder-ref td{vertical-align:top;padding:.65rem;border:1px solid #ddd}\n.b9x-ladder-ref tbody tr:nth-child(even){background:#fbf8f9}\n.b9x-ladder-ref code{background:#f4f4f4;padding:.12em .3em;border-radius:3px}\n.b9x-back{font-size:.86em;text-align:right}\n@media(max-width:700px){.b9x-ladder-ref{font-size:16px}.b9x-ladder-ref h1{font-size:1.8rem}.b9x-toc ul{columns:1}}\n<\/style>\n<article class=\"b9x-ladder-ref\" id=\"b9x-top\">\n<div class=\"b9x-hero\"><h1>B9X Ladder Editor Language Reference<\/h1><p class=\"b9x-subtitle\">Version 1.50 &#8211; B9X Basic and Arduino Exports<\/p><\/div>\n<p>B9X Ladder Editor is a graphical control-programming environment based on relay ladder logic. Use this reference to design, document, save, and export complete ladder programs.<\/p>\n<nav class=\"b9x-toc\"><strong>On this page<\/strong><ul>\n<li><a href=\"#overview\">Overview<\/a><\/li>\n<li><a href=\"#fundamentals\">Fundamentals<\/a><\/li>\n<li><a href=\"#fields\">Fields and types<\/a><\/li>\n<li><a href=\"#operators\">Operators and expressions<\/a><\/li>\n<li><a href=\"#elements\">Element reference<\/a><\/li>\n<li><a href=\"#commands\">Commands<\/a><\/li>\n<li><a href=\"#exports\">Exports<\/a><\/li>\n<li><a href=\"#examples\">Examples<\/a><\/li>\n<li><a href=\"#safety\">Design and safety<\/a><\/li>\n<li><a href=\"#troubleshooting\">Troubleshooting<\/a><\/li>\n<li><a href=\"#glossary\">Glossary<\/a><\/li>\n<\/ul><\/nav>\n<section id=\"overview\"><h2>Overview and Quick Start<\/h2>\n<h3>What B9X Ladder Editor is<\/h3><p>B9X Ladder Editor is a graphical control-programming environment based on relay ladder logic. A program is built from horizontal rungs. Contacts and comparison elements form a condition on the left; coils, timers, counters, assignments, calls, and other actions appear toward the right. The completed project can be saved, reopened, reviewed, and exported as B9X Basic or Arduino source.<\/p>\n<h3>How to use this reference<\/h3><p>Begin with the quick-start workflow, then use the element reference while building rungs. The operators and expressions chapter explains how series and parallel paths combine. The design and troubleshooting chapters cover reliable program structure. Examples are intentionally small so each rule is visible.<\/p>\n<h3>Language scope<\/h3><p>The ladder language is graphical. Terms such as operator, statement, clause, and expression describe the behavior of rungs and elements; users do not type a separate textual ladder syntax. Function calls and include elements connect ladder conditions to customer-supplied B9X Basic or Arduino routines.<\/p>\n<h3>Create a project<\/h3><p>Add a rung, place the required contacts from left to right, add an output or action, select each element, enter its Label, GPIO, Value, and Debounce settings as applicable, and choose Apply. Add a clear rung comment. Repeat for each operation.<\/p>\n<h3>Test the logic on paper<\/h3><p>Read every rung from left to right and the project from top to bottom. Verify what happens when every input is 0, when each input changes, when timers finish, and when resets occur. Confirm that mutually exclusive outputs cannot be true together.<\/p>\n<h3>Save and export<\/h3><p>Use Save App to preserve the editable ladder project. Use Load App to reopen it. Export B9X Basic .bas for B9X Basic or Export Arduino .ino for Arduino. A compressed Arduino option is available when a compact sketch is preferred. The configured rung limit is checked before export.<\/p>\n<\/section>\n<section id=\"fundamentals\"><h2>Ladder Language Fundamentals<\/h2>\n<h3>Program scan<\/h3><p>A ladder program is evaluated repeatedly from the first rung to the last. Within each rung, contact groups form the condition and actions operate from that condition. Rung order therefore affects behavior.<\/p>\n<h3>Rung anatomy<\/h3><ul><li>Contacts and comparisons form the condition.<\/li><li>Series groups produce AND logic.<\/li><li>Parallel branch contacts produce OR logic.<\/li><li>Coils and control blocks perform actions.<\/li><li>A rung comment records intent and assumptions.<\/li><\/ul>\n<div class=\"b9x-example\">(StartA OR StartB) AND StopHealthy AND NOT AlarmActive -&gt; Motor OUT<\/div><\/section>\n<section id=\"fields\"><h2>Fields and Data Types<\/h2><h3>Element fields<\/h3>\n<div class=\"b9x-table-wrap\"><table><thead><tr><th>Field<\/th><th>Meaning<\/th><th>Rules<\/th><\/tr><\/thead><tbody><tr><td>Label<\/td><td>Symbolic name, message, or function\/block name.<\/td><td>Use descriptive names. Cross-references must match exactly.<\/td><\/tr><tr><td>GPIO<\/td><td>Physical digital pin for an input or output.<\/td><td>Leave blank for internal elements. Do not use GPIO as a general value field.<\/td><\/tr><tr><td>Value \/ Comment<\/td><td>Shared field for presets, thresholds, assignments, paths, sequence steps, and rung comments.<\/td><td>Its meaning depends on the selected element.<\/td><\/tr><tr><td>Debounce<\/td><td>Input stabilization time from 0 to 5000 milliseconds.<\/td><td>Used for physical GPIO contacts and edge contacts; use 0 when not needed.<\/td><\/tr><tr><td>Coil mode<\/td><td>OUT, SET, or RST.<\/td><td>OUT follows the rung; SET latches on; RST clears.<\/td><\/tr><tr><td>Rung comment<\/td><td>Plain-language purpose and assumptions for the selected rung.<\/td><td>Comments are saved and carried into exports.<\/td><\/tr><\/tbody><\/table><\/div>\n<h3>Data types<\/h3><div class=\"b9x-table-wrap\"><table><thead><tr><th>Type<\/th><th>Representation<\/th><th>Typical uses<\/th><\/tr><\/thead><tbody><tr><td>Boolean\/state<\/td><td>0 or 1<\/td><td>Digital inputs, OUT\/SET\/RST coils, internal permissives, one-shot states.<\/td><\/tr><tr><td>Numeric<\/td><td>Numeric value<\/td><td>ADC and temperature readings, comparison values, SET DBL variables, timer\/counter support values.<\/td><\/tr><tr><td>String<\/td><td>Text<\/td><td>SET STR and PRINT. B9X Basic string names use a trailing $, such as message$.<\/td><\/tr><tr><td>Digital input<\/td><td>Physical logic level<\/td><td>NO, NC, rising-edge, and falling-edge contacts with a GPIO.<\/td><\/tr><tr><td>Digital output<\/td><td>Physical logic level<\/td><td>A coil with an assigned GPIO.<\/td><\/tr><tr><td>Timer state<\/td><td>Running, elapsed\/done concept<\/td><td>TON, TOF, TP, RTO and timer-done contacts.<\/td><\/tr><tr><td>Counter state<\/td><td>Count and done concept<\/td><td>CTU, CTD, counter-done contacts, and reset.<\/td><\/tr><tr><td>Sequencer state<\/td><td>Current step and done concept<\/td><td>SEQ, SEQ STEP, SEQ DONE, and SEQ RST.<\/td><\/tr><\/tbody><\/table><\/div>\n<h3>Naming rules<\/h3><ul><li>Begin names with a letter and use descriptive letters, digits, and underscores.<\/li><li>Use the same spelling and capitalization for every reference.<\/li><li>Use a trailing dollar sign for B9X Basic strings, such as message$.<\/li><li>Leave GPIO blank for internal states and non-I\/O elements.<\/li><\/ul><\/section>\n<section id=\"operators\"><h2>Operators, Statements, Clauses, and Expressions<\/h2>\n<div class=\"b9x-table-wrap\"><table><thead><tr><th>Graphical\/operator form<\/th><th>Meaning<\/th><th>Evaluation<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>Series connection<\/td><td>AND<\/td><td>Every series group must be true.<\/td><td>Start AND StopHealthy AND NoAlarm<\/td><\/tr><tr><td>Parallel branch group<\/td><td>OR<\/td><td>At least one contact in the group must be true.<\/td><td>StartA OR StartB<\/td><\/tr><tr><td>Normally-closed contact<\/td><td>NOT \/ inverse test<\/td><td>True when the tested state is 0.<\/td><td>NOT alarmActive<\/td><\/tr><tr><td>&gt;<\/td><td>Greater than<\/td><td>Left numeric tag is greater than Value.<\/td><td>temperature &gt; 80<\/td><\/tr><tr><td>&lt;<\/td><td>Less than<\/td><td>Left numeric tag is less than Value.<\/td><td>level &lt; 20<\/td><\/tr><tr><td>=<\/td><td>Equal<\/td><td>Numeric tag equals Value.<\/td><td>mode = 2<\/td><\/tr><tr><td>&gt;=<\/td><td>Greater than or equal<\/td><td>Numeric tag is at least Value.<\/td><td>pressure &gt;= 100<\/td><\/tr><tr><td>&lt;=<\/td><td>Less than or equal<\/td><td>Numeric tag is no greater than Value.<\/td><td>speed &lt;= 500<\/td><\/tr><tr><td>&lt;&gt;<\/td><td>Not equal<\/td><td>Numeric tag differs from Value.<\/td><td>errorCode &lt;&gt; 0<\/td><\/tr><tr><td>Rising edge<\/td><td>0 to 1 transition<\/td><td>True for one scan on an off-to-on change.<\/td><td>partSensor rises<\/td><\/tr><tr><td>Falling edge<\/td><td>1 to 0 transition<\/td><td>True for one scan on an on-to-off change.<\/td><td>doorSwitch falls<\/td><\/tr><\/tbody><\/table><\/div>\n<h3>Statements<\/h3><p>A statement is an action controlled by a rung expression: a coil, timer, counter, reset, sequencer, assignment, print, call, or include action.<\/p>\n<h3>Clauses<\/h3><p>A rung is equivalent to a conditional clause: when the combined contact expression is true, perform the action. Inverse behavior is formed with NC contacts or complementary comparisons.<\/p>\n<h3>Expressions<\/h3><ul><li>Boolean series\/parallel expressions<\/li><li>Numeric comparisons<\/li><li>Rising and falling edge expressions<\/li><li>Timer\/counter\/sequencer done expressions<\/li><li>Coil and internal-state expressions<\/li><\/ul><\/section>\n<section id=\"elements\"><h2>Complete Element Reference<\/h2><p>Each example appears before the resulting value or state.<\/p>\n<h3>Contacts<\/h3>\n<div class=\"b9x-card\"><h4>NO &#8211; Normally-open contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests a digital input or Boolean tag for an ON state.<\/p><p><strong>Fields.<\/strong> Label: tag name. GPIO: physical input pin or blank for an internal tag. Debounce: 0 to 5000 ms.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true when its tag value is 1. In series it participates in AND logic; in a branch group it participates in OR logic.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Use NO startButton on GPIO 13 ahead of an OUT coil named motorRelay.<\/div>\n<p><strong>Resulting value or state.<\/strong> The rung path through this contact is true while startButton is 1.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> A blank GPIO makes the contact an internal condition. Use Coil NO for a clearer internal output-state contact.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>NC &#8211; Normally-closed contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests a digital input or Boolean tag for an OFF state.<\/p><p><strong>Fields.<\/strong> Label: tag name. GPIO: physical input pin or blank. Debounce: 0 to 5000 ms.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true when its tag value is 0. It is the logical inverse of a normally-open test.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Use NC stopButton on GPIO 14 in series with the motor start path.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path remains true while stopButton is 0 and becomes false when it is 1.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> NO and NC describe the logical test. Confirm the actual field wiring and active level separately.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>\u2191 &#8211; Rising-edge contact<\/h4>\n<p><strong>Purpose.<\/strong> Creates a one-scan condition when an input changes from OFF to ON.<\/p><p><strong>Fields.<\/strong> Label: tag name. GPIO: physical input pin. Debounce: 0 to 5000 ms.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true only during the scan that detects a 0-to-1 transition.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Place \u2191 partSensor on GPIO 12 ahead of a CTU counter.<\/div>\n<p><strong>Resulting value or state.<\/strong> One count request is produced for each detected rising transition.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Use this element for events. Use NO when the condition must remain true while the input stays on.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>\u2193 &#8211; Falling-edge contact<\/h4>\n<p><strong>Purpose.<\/strong> Creates a one-scan condition when an input changes from ON to OFF.<\/p><p><strong>Fields.<\/strong> Label: tag name. GPIO: physical input pin. Debounce: 0 to 5000 ms.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true only during the scan that detects a 1-to-0 transition.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Place \u2193 doorSwitch ahead of a SET coil named doorWasClosed.<\/div>\n<p><strong>Resulting value or state.<\/strong> doorWasClosed is set once when doorSwitch changes from 1 to 0.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> The input must first be observed on before a falling transition can occur.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>Coil NO &#8211; Coil-state normally-open contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests the state of a coil or internal Boolean tag.<\/p><p><strong>Fields.<\/strong> Label: the exact coil or internal state name. GPIO is not used.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true while the named state equals 1.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Use Coil NO motorRelay in parallel with the Start contact to make a seal-in path.<\/div>\n<p><strong>Resulting value or state.<\/strong> The parallel path remains true after Start is released while motorRelay remains on.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> The label must exactly match the state being referenced.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>Coil NC &#8211; Coil-state normally-closed contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests the inverse state of a coil or internal Boolean tag.<\/p><p><strong>Fields.<\/strong> Label: the exact coil or internal state name. GPIO is not used.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true while the named state equals 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Use Coil NC alarmActive in series with a normal-operation output.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is enabled only while alarmActive is off.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Useful for interlocks, mutual exclusion, and permissive logic.<\/div>\n<\/div>\n<h3>Branches<\/h3>\n<div class=\"b9x-card\"><h4>Branch NO &#8211; Parallel normally-open contact<\/h4>\n<p><strong>Purpose.<\/strong> Adds a normally-open alternative path at the selected series position.<\/p><p><strong>Fields.<\/strong> Select an existing contact first; then assign Label, GPIO, and Debounce as needed.<\/p>\n<p><strong>Behavior.<\/strong> All contacts in the same branch group are ORed.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Place Start A and Start B in the same branch group ahead of one motor coil.<\/div>\n<p><strong>Resulting value or state.<\/strong> The group is true when Start A OR Start B is true.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Branch NC, B Coil NO, B Coil NC, Branch \u2191, and Branch \u2193 follow the same OR grouping rule.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>Branch NC &#8211; Parallel normally-closed contact<\/h4>\n<p><strong>Purpose.<\/strong> Adds a normally-closed alternative path at the selected series position.<\/p><p><strong>Fields.<\/strong> Select a contact, choose Branch NC, then set its label, GPIO, and debounce.<\/p>\n<p><strong>Behavior.<\/strong> The branch is true when the new contact value is 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Branch NC manualMode in parallel with NO automaticPermit.<\/div>\n<p><strong>Resulting value or state.<\/strong> The group is true when manualMode is 0 OR automaticPermit is 1.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>B Coil NO \/ B Coil NC &#8211; Parallel coil-state contact<\/h4>\n<p><strong>Purpose.<\/strong> Adds an internal-state alternative path without assigning a GPIO.<\/p><p><strong>Fields.<\/strong> Label: exact coil or state name.<\/p>\n<p><strong>Behavior.<\/strong> B Coil NO is true for state 1; B Coil NC is true for state 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Add B Coil NO motorRelay beside NO startButton.<\/div>\n<p><strong>Resulting value or state.<\/strong> The branch group stays true through motorRelay after the Start button is released.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>Branch \u2191 \/ Branch \u2193 &#8211; Parallel edge contact<\/h4>\n<p><strong>Purpose.<\/strong> Adds a transition-sensitive alternative path.<\/p><p><strong>Fields.<\/strong> Label, GPIO, and debounce identify the physical event input.<\/p>\n<p><strong>Behavior.<\/strong> The branch contributes a one-scan true state on the selected transition.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Place rising events from sensorA and sensorB in one branch group.<\/div>\n<p><strong>Resulting value or state.<\/strong> The group pulses when either sensor produces the selected edge.<\/p>\n<\/div>\n<h3>Outputs<\/h3>\n<div class=\"b9x-card\"><h4>OUT &#8211; Output coil<\/h4>\n<p><strong>Purpose.<\/strong> Makes an output or Boolean state follow the complete rung condition.<\/p><p><strong>Fields.<\/strong> Label: output\/state name. GPIO: physical output pin or blank for an internal state. Mode: OUT.<\/p>\n<p><strong>Behavior.<\/strong> The output is set to 1 when the rung is true and 0 when the rung is false.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO enableSwitch followed by OUT fanRelay on GPIO 18.<\/div>\n<p><strong>Resulting value or state.<\/strong> fanRelay and GPIO 18 follow enableSwitch.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Avoid driving the same OUT label from multiple rungs; combine the conditions instead.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>SET &#8211; Set coil<\/h4>\n<p><strong>Purpose.<\/strong> Latches an output or internal state on.<\/p><p><strong>Fields.<\/strong> Label: output\/state name. GPIO: output pin or blank. Mode: SET.<\/p>\n<p><strong>Behavior.<\/strong> When the rung becomes true, the state is assigned 1 and remains 1 after the rung becomes false.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>Rising-edge faultSensor followed by SET alarmLatched.<\/div>\n<p><strong>Resulting value or state.<\/strong> alarmLatched remains 1 until a RESET coil clears it.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Every latched state should have a deliberate and reachable reset path.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>RST &#8211; Reset coil<\/h4>\n<p><strong>Purpose.<\/strong> Clears a latched output or internal state.<\/p><p><strong>Fields.<\/strong> Label and GPIO must identify the same state used by SET. Mode: RESET.<\/p>\n<p><strong>Behavior.<\/strong> When the rung is true, the state is assigned 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO resetButton followed by RST alarmLatched.<\/div>\n<p><strong>Resulting value or state.<\/strong> alarmLatched becomes 0 while the reset condition is true.<\/p>\n<\/div>\n<h3>Timers<\/h3>\n<div class=\"b9x-card\"><h4>TON &#8211; On-delay timer<\/h4>\n<p><strong>Purpose.<\/strong> Delays the timer-done state after the rung condition turns on.<\/p><p><strong>Fields.<\/strong> Label: timer name. Value: preset time in milliseconds.<\/p>\n<p><strong>Behavior.<\/strong> Timing begins when the rung becomes true. Done becomes true after the condition stays true for the preset. A false rung clears normal TON timing.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO startRequest followed by TON startDelay with Value 5000.<\/div>\n<p><strong>Resulting value or state.<\/strong> startDelay done becomes 1 after startRequest remains true for 5 seconds.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Use T DN NO or T DN NC with the same label in another rung.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>TOF &#8211; Off-delay timer<\/h4>\n<p><strong>Purpose.<\/strong> Delays the timer-done state from turning off after the rung condition turns off.<\/p><p><strong>Fields.<\/strong> Label: timer name. Value: off-delay in milliseconds.<\/p>\n<p><strong>Behavior.<\/strong> Done is true while the rung is true and remains true for the preset interval after the rung becomes false.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO occupancy followed by TOF lightDelay with Value 30000.<\/div>\n<p><strong>Resulting value or state.<\/strong> lightDelay done remains true for 30 seconds after occupancy turns off.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>TP &#8211; Pulse timer<\/h4>\n<p><strong>Purpose.<\/strong> Produces a timed pulse from a triggering condition.<\/p><p><strong>Fields.<\/strong> Label: timer name. Value: pulse width in milliseconds.<\/p>\n<p><strong>Behavior.<\/strong> A trigger starts a pulse whose done state remains true for the preset duration.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>\u2191 triggerButton followed by TP hornPulse with Value 1000.<\/div>\n<p><strong>Resulting value or state.<\/strong> hornPulse done stays true for approximately 1 second per accepted trigger.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Use a transition contact when exactly one pulse is required per press.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>RTO &#8211; Retentive on-delay timer<\/h4>\n<p><strong>Purpose.<\/strong> Accumulates enabled time across interruptions.<\/p><p><strong>Fields.<\/strong> Label: timer name. Value: accumulated-time preset in milliseconds.<\/p>\n<p><strong>Behavior.<\/strong> Elapsed enabled time is retained when the rung becomes false. Done becomes true when accumulated time reaches the preset.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO pumpRunning followed by RTO serviceTimer with Value 3600000.<\/div>\n<p><strong>Resulting value or state.<\/strong> serviceTimer done becomes true after one accumulated hour of pump operation.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Use T RST with the same timer name to clear accumulated time and done state.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>T DN NO &#8211; Timer-done normally-open contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a named timer is done.<\/p><p><strong>Fields.<\/strong> Label: exact TON, TOF, TP, or RTO name. GPIO is not used.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true when the timer done state equals 1.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>T DN NO startDelay followed by OUT motorRelay.<\/div>\n<p><strong>Resulting value or state.<\/strong> motorRelay turns on after startDelay becomes done.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>T DN NC &#8211; Timer-done normally-closed contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a named timer is not done.<\/p><p><strong>Fields.<\/strong> Label: exact timer name. GPIO is not used.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true while the timer done state equals 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>T DN NC warmup followed by OUT warmingLamp.<\/div>\n<p><strong>Resulting value or state.<\/strong> warmingLamp remains on until warmup is done.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>T RST &#8211; Timer restart\/reset<\/h4>\n<p><strong>Purpose.<\/strong> Restarts or clears the named timer state.<\/p><p><strong>Fields.<\/strong> Label: exact timer name.<\/p>\n<p><strong>Behavior.<\/strong> When its rung condition is true, the timer is returned to its restart state.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO resetButton followed by T RST serviceTimer.<\/div>\n<p><strong>Resulting value or state.<\/strong> serviceTimer timing and done state are cleared\/restarted.<\/p>\n<\/div>\n<h3>Counters<\/h3>\n<div class=\"b9x-card\"><h4>CTU &#8211; Count-up counter<\/h4>\n<p><strong>Purpose.<\/strong> Counts false-to-true transitions of its rung condition.<\/p><p><strong>Fields.<\/strong> Label: counter name. Value: positive preset count.<\/p>\n<p><strong>Behavior.<\/strong> The count increases once per condition transition. Done becomes true when count reaches the preset.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>\u2191 partSensor followed by CTU batchCount with Value 10.<\/div>\n<p><strong>Resulting value or state.<\/strong> batchCount done becomes 1 when ten accepted part events have occurred.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Do not feed a continuously true condition when distinct events are intended.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>CTD &#8211; Count-down counter<\/h4>\n<p><strong>Purpose.<\/strong> Counts downward from a preset on condition transitions.<\/p><p><strong>Fields.<\/strong> Label: counter name. Value: starting count.<\/p>\n<p><strong>Behavior.<\/strong> Each accepted transition decreases the count. Done becomes true when the count reaches zero.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>\u2191 dispenseEvent followed by CTD itemsRemaining with Value 25.<\/div>\n<p><strong>Resulting value or state.<\/strong> itemsRemaining done becomes 1 after 25 accepted events.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>C DN NO &#8211; Counter-done normally-open contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a named counter is done.<\/p><p><strong>Fields.<\/strong> Label: exact CTU or CTD name.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true when the counter done state equals 1.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>C DN NO batchCount followed by SET batchComplete.<\/div>\n<p><strong>Resulting value or state.<\/strong> batchComplete is latched when the counter reaches its preset.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>C DN NC &#8211; Counter-done normally-closed contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a named counter is not done.<\/p><p><strong>Fields.<\/strong> Label: exact CTU or CTD name.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true while the counter done state equals 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>C DN NC batchCount followed by OUT conveyorEnable.<\/div>\n<p><strong>Resulting value or state.<\/strong> conveyorEnable remains on until the batch count is complete.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>C RST &#8211; Counter reset<\/h4>\n<p><strong>Purpose.<\/strong> Clears the named counter.<\/p><p><strong>Fields.<\/strong> Label: exact counter name.<\/p>\n<p><strong>Behavior.<\/strong> When the rung is true, count, done, and event-history state are reset.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO newBatchButton followed by C RST batchCount.<\/div>\n<p><strong>Resulting value or state.<\/strong> batchCount returns to its reset state for a new batch.<\/p>\n<\/div>\n<h3>Analog and temperature<\/h3>\n<div class=\"b9x-card\"><h4>ADC &#8211; Analog input<\/h4>\n<p><strong>Purpose.<\/strong> Reads a calibrated analog channel into a numeric tag.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value\/ADC channel: 0, 1, 2, or 3.<\/p>\n<p><strong>Behavior.<\/strong> The tag is refreshed during program scanning and can be tested by comparison contacts.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>ADC tankLevel using channel 0, followed elsewhere by &gt; tankLevel with Value 2500.<\/div>\n<p><strong>Resulting value or state.<\/strong> tankLevel contains the current calibrated reading; the comparison is true above 2500.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> An ADC channel is not an arbitrary digital GPIO number.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>TEMP &#8211; Temperature input<\/h4>\n<p><strong>Purpose.<\/strong> Reads a supported temperature sensor into a numeric tag.<\/p><p><strong>Fields.<\/strong> Label: temperature tag. Value: sensor data GPIO required by the target hardware configuration.<\/p>\n<p><strong>Behavior.<\/strong> The numeric reading is refreshed and can be used by comparison contacts.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>TEMP roomTemperature with Value 4, then &lt; roomTemperature with Value 68.<\/div>\n<p><strong>Resulting value or state.<\/strong> The comparison becomes true when roomTemperature is below 68.<\/p>\n<\/div>\n<h3>Comparisons<\/h3>\n<div class=\"b9x-card\"><h4>&gt; &#8211; Greater-than comparison<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a numeric tag is greater than a value.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value: threshold or valid numeric expression.<\/p>\n<p><strong>Behavior.<\/strong> Acts as a contact and may be placed in series or parallel.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>&gt; tankLevel with Value 2500 followed by OUT highLevelAlarm.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is true when tankLevel &gt; 2500.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>&lt; &#8211; Less-than comparison<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a numeric tag is less than a value.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value: threshold.<\/p>\n<p><strong>Behavior.<\/strong> Acts as a contact.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>&lt; roomTemperature with Value 68 followed by OUT heater.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is true when roomTemperature &lt; 68.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>= &#8211; Equal comparison<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a numeric tag equals a value.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value: comparison value.<\/p>\n<p><strong>Behavior.<\/strong> Acts as a contact using numeric equality.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>= operatingMode with Value 2 followed by OUT automaticModeLamp.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is true when operatingMode equals 2.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>&gt;= &#8211; Greater-than-or-equal comparison<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a numeric tag is at least a value.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value: threshold.<\/p>\n<p><strong>Behavior.<\/strong> Acts as a contact.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>&gt;= pressure with Value 100 followed by SET pressureAlarm.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is true when pressure is 100 or greater.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>&lt;= &#8211; Less-than-or-equal comparison<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a numeric tag is no greater than a value.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value: threshold.<\/p>\n<p><strong>Behavior.<\/strong> Acts as a contact.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>&lt;= speed with Value 500 followed by OUT lowSpeedPermit.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is true when speed is 500 or less.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>&lt;&gt; &#8211; Not-equal comparison<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a numeric tag differs from a value.<\/p><p><strong>Fields.<\/strong> Label: numeric tag. Value: comparison value.<\/p>\n<p><strong>Behavior.<\/strong> Acts as a contact.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>&lt;&gt; errorCode with Value 0 followed by SET alarmActive.<\/div>\n<p><strong>Resulting value or state.<\/strong> The path is true whenever errorCode is not zero.<\/p>\n<\/div>\n<h3>Control<\/h3>\n<div class=\"b9x-card\"><h4>ONE SHOT &#8211; One-shot output<\/h4>\n<p><strong>Purpose.<\/strong> Creates an internal pulse that is true for one scan on a false-to-true rung transition.<\/p><p><strong>Fields.<\/strong> Label: pulse tag. GPIO is not used.<\/p>\n<p><strong>Behavior.<\/strong> The pulse tag is set for one scan, then automatically returns to 0.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO cycleStart followed by ONE SHOT startPulse; use Coil NO startPulse in another rung.<\/div>\n<p><strong>Resulting value or state.<\/strong> startPulse is 1 for one scan per new cycleStart activation.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>SEQ &#8211; Sequencer<\/h4>\n<p><strong>Purpose.<\/strong> Maintains an integer step and advances it on accepted rung transitions.<\/p><p><strong>Fields.<\/strong> Label: sequencer name. Value: number of steps supported by the selected export target.<\/p>\n<p><strong>Behavior.<\/strong> A new triggering transition advances the current step. Step and done contacts coordinate staged operation.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>TP cyclePulse followed by SEQ trafficSequence with Value 4.<\/div>\n<p><strong>Resulting value or state.<\/strong> trafficSequence advances through its configured step states.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> For B9X Basic projects, design and test the complete step wrap\/reset behavior before connecting outputs.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>SEQ STEP &#8211; Sequencer step contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests whether a sequencer is at a specified step.<\/p><p><strong>Fields.<\/strong> Label: exact sequencer name. Value: requested step number. GPIO is not used.<\/p>\n<p><strong>Behavior.<\/strong> The contact is true only while the current step equals the selected value.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>SEQ STEP trafficSequence with Value 1 followed by OUT yellowLight.<\/div>\n<p><strong>Resulting value or state.<\/strong> yellowLight is enabled while trafficSequence is at step 1.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>SEQ DONE &#8211; Sequencer done contact<\/h4>\n<p><strong>Purpose.<\/strong> Tests the completion state of a sequencer.<\/p><p><strong>Fields.<\/strong> Label: exact sequencer name.<\/p>\n<p><strong>Behavior.<\/strong> The contact becomes true at the sequencer completion state.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>SEQ DONE washCycle followed by SET cycleComplete.<\/div>\n<p><strong>Resulting value or state.<\/strong> cycleComplete is latched when washCycle reports done.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>SEQ RST &#8211; Sequencer reset<\/h4>\n<p><strong>Purpose.<\/strong> Returns a sequencer to its initial step.<\/p><p><strong>Fields.<\/strong> Label: exact sequencer name.<\/p>\n<p><strong>Behavior.<\/strong> When the rung is true, step, done, and edge-history state are reset.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO resetButton followed by SEQ RST washCycle.<\/div>\n<p><strong>Resulting value or state.<\/strong> washCycle returns to its initial state.<\/p>\n<\/div>\n<h3>Functions and inclusion<\/h3>\n<div class=\"b9x-card\"><h4>CALL &#8211; Conditional function call<\/h4>\n<p><strong>Purpose.<\/strong> Calls a named B9X Basic or Arduino function when the rung is true.<\/p><p><strong>Fields.<\/strong> Label: function name. The function must exist in the destination project.<\/p>\n<p><strong>Behavior.<\/strong> The function is invoked during each scan in which the rung condition is true.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>C DN NO batchCount followed by CALL reportBatchComplete.<\/div>\n<p><strong>Resulting value or state.<\/strong> Control returns to the ladder scan after reportBatchComplete finishes.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Use an edge or one-shot condition if the function should run only once per event.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>CALL INITIALIZATION &#8211; Initialization function call<\/h4>\n<p><strong>Purpose.<\/strong> Calls a named function once during startup before repeated ladder scanning begins.<\/p><p><strong>Fields.<\/strong> Label: function name. Put this element on its own rung.<\/p>\n<p><strong>Behavior.<\/strong> The function is placed in the initialization portion of the export.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>CALL INITIALIZATION initializeDisplay on a dedicated rung.<\/div>\n<p><strong>Resulting value or state.<\/strong> Control returns after initializeDisplay finishes, then normal scanning begins.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>INCLUDE FILE &#8211; Conditional include file<\/h4>\n<p><strong>Purpose.<\/strong> Includes the contents of a customer-supplied text\/source file under a rung condition.<\/p><p><strong>Fields.<\/strong> Label: descriptive block name. Value: exact existing file path selected through the editor.<\/p>\n<p><strong>Behavior.<\/strong> The included text is exported verbatim at the conditional location.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO alarmActive followed by INCLUDE FILE named customAlarm using an existing alarm source file.<\/div>\n<p><strong>Resulting value or state.<\/strong> The supplied file contents execute under the alarmActive condition.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> The project depends on the selected external file. Preserve it when moving the project.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>INCLUDE INIT &#8211; Initialization include file<\/h4>\n<p><strong>Purpose.<\/strong> Includes customer-supplied text\/source verbatim in the startup area.<\/p><p><strong>Fields.<\/strong> Label: descriptive block name. Value: exact existing file path.<\/p>\n<p><strong>Behavior.<\/strong> The contents are placed before repeated ladder scanning.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>INCLUDE INIT named startupDefinitions using an existing initialization file.<\/div>\n<p><strong>Resulting value or state.<\/strong> The supplied initialization content is included once in the exported program.<\/p>\n<\/div>\n<h3>Data and diagnostics<\/h3>\n<div class=\"b9x-card\"><h4>PRINT &#8211; Print text or string<\/h4>\n<p><strong>Purpose.<\/strong> Prints quoted text or a string variable when the rung is true.<\/p><p><strong>Fields.<\/strong> Label: quoted text such as &quot;Ready&quot; or a B9X Basic string variable such as message$.<\/p>\n<p><strong>Behavior.<\/strong> Printing occurs during every scan for which the rung remains true.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>\u2191 startButton followed by PRINT with Label &quot;Cycle started&quot;.<\/div>\n<p><strong>Resulting value or state.<\/strong> The message is printed once for the rising-edge event.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> Use an edge or one-shot to prevent repeated lines from a continuously true rung.<\/div>\n<\/div>\n<div class=\"b9x-card\"><h4>PRINT DBL &#8211; Print numeric value<\/h4>\n<p><strong>Purpose.<\/strong> Prints a numeric variable when the rung is true.<\/p><p><strong>Fields.<\/strong> Label: numeric variable name.<\/p>\n<p><strong>Behavior.<\/strong> The current numeric value is printed each time the action executes.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>\u2191 sampleButton followed by PRINT DBL temperature.<\/div>\n<p><strong>Resulting value or state.<\/strong> The current value of temperature is printed once per button transition.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>SET DBL &#8211; Set numeric variable<\/h4>\n<p><strong>Purpose.<\/strong> Assigns a numeric value or expression to a numeric variable.<\/p><p><strong>Fields.<\/strong> Label: numeric variable name. Value: number or supported numeric expression.<\/p>\n<p><strong>Behavior.<\/strong> The assignment is performed whenever the rung condition is true.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>NO recipe2Selected followed by SET DBL targetTemperature with Value 72.5.<\/div>\n<p><strong>Resulting value or state.<\/strong> targetTemperature becomes 72.5.<\/p>\n<\/div>\n<div class=\"b9x-card\"><h4>SET STR &#8211; Set string variable<\/h4>\n<p><strong>Purpose.<\/strong> Assigns text to a string variable.<\/p><p><strong>Fields.<\/strong> Label: string variable. For B9X Basic use a trailing dollar sign, for example message$. Value: text to assign.<\/p>\n<p><strong>Behavior.<\/strong> The string assignment occurs whenever the rung is true.<\/p><div class=\"b9x-example\"><strong>Example<\/strong><br>C DN NO batchCount followed by SET STR message$ with Value Batch complete.<\/div>\n<p><strong>Resulting value or state.<\/strong> message$ contains &quot;Batch complete&quot;.<\/p>\n<div class=\"b9x-note\"><strong>Note.<\/strong> For Arduino export, the editor adapts the string name to the target naming rules.<\/div>\n<\/div>\n<\/section>\n<section id=\"commands\"><h2>Editor and Project Commands<\/h2><div class=\"b9x-table-wrap\"><table><thead><tr><th>Command<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td>Apply<\/td><td>Stores edits made to the selected element.<\/td><\/tr><tr><td>Delete<\/td><td>Removes the selected element.<\/td><\/tr><tr><td>Clear<\/td><td>Clears the current editable rung.<\/td><\/tr><tr><td>Add Rung<\/td><td>Adds a new rung to the project.<\/td><\/tr><tr><td>Delete Rung<\/td><td>Removes the selected rung.<\/td><\/tr><tr><td>Move Up \/ Move Down<\/td><td>Moves the selected rung by one position.<\/td><\/tr><tr><td>Move To Top \/ Move To Bottom<\/td><td>Moves the selected rung to the first or last position.<\/td><\/tr><tr><td>Delete Branch<\/td><td>Removes the selected branch contact from its parallel group.<\/td><\/tr><tr><td>Apply Rung Comment<\/td><td>Stores the text in the rung comment field.<\/td><\/tr><tr><td>Variables<\/td><td>Shows the variables and state names used by the current project.<\/td><\/tr><tr><td>Rungs Preview<\/td><td>Shows a read-only overview of all rungs.<\/td><\/tr><tr><td>Save App<\/td><td>Saves the editable ladder project.<\/td><\/tr><tr><td>Load App<\/td><td>Loads a previously saved ladder project.<\/td><\/tr><tr><td>Export B9X Basic .bas<\/td><td>Creates B9X Basic source from the ladder project.<\/td><\/tr><tr><td>Export Arduino .ino<\/td><td>Creates a readable Arduino sketch.<\/td><\/tr><tr><td>Export Compressed Arduino .ino<\/td><td>Creates a compact Arduino sketch.<\/td><\/tr><\/tbody><\/table><\/div><\/section>\n<section id=\"exports\"><h2>Export Reference<\/h2><h3>B9X Basic<\/h3><p>Export B9X Basic .bas creates a B9X Basic program. String names use a trailing dollar sign. PRINT accepts quoted text or a string variable; PRINT DBL prints a numeric variable.<\/p><h3>Arduino<\/h3><p>Export Arduino .ino creates a readable sketch. Export Compressed Arduino .ino creates a compact sketch. Include content must be valid for the selected target.<\/p><h3>Rung limit<\/h3><p>Export is cancelled if the project exceeds the configured rung limit.<\/p><\/section>\n<section id=\"examples\"><h2>Programming Patterns and Examples<\/h2>\n<h3>Start\/stop seal-in motor<\/h3><ol><li>Rung 1: Branch NO startButton and B Coil NO motorRelay in the same parallel group; place the StopHealthy condition in series; finish with OUT motorRelay.<\/li><li>Operation: pressing Start turns on motorRelay. Its state contact holds the path after Start is released. Removing StopHealthy breaks the series path and turns the motor off.<\/li><li>Review: confirm the actual stop circuit produces the intended logical level and use suitable hardware for safety functions.<\/li><\/ol>\n<h3>Five-second delayed output<\/h3><ol><li>Rung 1: NO enableSwitch followed by TON readyDelay, Value 5000.<\/li><li>Rung 2: T DN NO readyDelay followed by OUT readyLamp.<\/li><li>Operation: readyLamp turns on after enableSwitch remains true for five seconds and turns off when normal TON timing is cleared.<\/li><\/ol>\n<h3>Ten-part batch counter<\/h3><ol><li>Rung 1: \u2191 partSensor followed by CTU partCount, Value 10.<\/li><li>Rung 2: C DN NO partCount followed by SET batchComplete.<\/li><li>Rung 3: NO resetButton followed by C RST partCount.<\/li><li>Rung 4: NO resetButton followed by RST batchComplete.<\/li><li>Operation: each accepted part edge counts once. The completion state latches at ten and the reset button clears both counter and latch.<\/li><\/ol>\n<h3>Temperature-controlled heater with hysteresis<\/h3><ol><li>Rung 1: TEMP roomTemperature; use &lt; roomTemperature with Value 68 followed by SET heaterDemand.<\/li><li>Rung 2: &gt; roomTemperature with Value 72 followed by RST heaterDemand.<\/li><li>Rung 3: Coil NO heaterDemand followed by OUT heaterRelay.<\/li><li>Operation: the heater turns on below 68 and stays on until temperature rises above 72. The four-degree separation prevents rapid switching near one threshold.<\/li><\/ol>\n<h3>Mutually exclusive outputs<\/h3><ol><li>Use separate step\/state conditions for each OUT coil.<\/li><li>Add Coil NC contacts for every conflicting output when an additional interlock is needed.<\/li><li>Verify each possible state, including startup and reset, and confirm that no two output conditions can be true during the same scan.<\/li><\/ol>\n<\/section>\n<section id=\"safety\"><h2>Design Rules and Safety<\/h2><ul><li>Write a clear comment for every rung.<\/li><li>Use GPIO only for actual physical I\/O.<\/li><li>Use edges or ONE SHOT for actions that must occur once.<\/li><li>Avoid duplicate OUT writers.<\/li><li>Give every SET state a reset path.<\/li><li>Use hysteresis for analog switching.<\/li><li>Define startup and reset behavior.<\/li><li>Review rung order and mutually exclusive outputs.<\/li><li>Use appropriate electrical drivers and protection.<\/li><li>Do not use ordinary software logic as the only personnel-safety system.<\/li><\/ul><\/section>\n<section id=\"troubleshooting\"><h2>Troubleshooting<\/h2><div class=\"b9x-table-wrap\"><table><thead><tr><th>Symptom<\/th><th>Checks<\/th><\/tr><\/thead><tbody><tr><td>Output never turns on<\/td><td>Trace every series group; verify active levels, labels, thresholds, GPIO, and duplicate writers.<\/td><\/tr><tr><td>Output stays on<\/td><td>Check for SET without RST, a seal-in branch, TOF delay, or an unconditional rung.<\/td><\/tr><tr><td>Counter counts too quickly<\/td><td>Use a rising edge or ONE SHOT and appropriate debounce.<\/td><\/tr><tr><td>Print repeats<\/td><td>Trigger PRINT with an edge or ONE SHOT.<\/td><\/tr><tr><td>Timer does not complete<\/td><td>Verify the condition remains true, the preset is milliseconds, and reset is not continuously active.<\/td><\/tr><tr><td>Wrong branch behavior<\/td><td>Same-group contacts are ORed; separate groups are ANDed.<\/td><\/tr><tr><td>Export is blocked<\/td><td>Reduce rung count or use a configuration that permits the project size.<\/td><\/tr><\/tbody><\/table><\/div><\/section>\n<section id=\"glossary\"><h2>Glossary<\/h2><div class=\"b9x-table-wrap\"><table><thead><tr><th>Term<\/th><th>Definition<\/th><\/tr><\/thead><tbody><tr><td>Action<\/td><td>An element that changes or uses program state.<\/td><\/tr><tr><td>Branch<\/td><td>A parallel OR path.<\/td><\/tr><tr><td>Coil<\/td><td>An output or internal Boolean state.<\/td><\/tr><tr><td>Contact<\/td><td>A true\/false condition.<\/td><\/tr><tr><td>Debounce<\/td><td>A time filter for an input transition.<\/td><\/tr><tr><td>Done<\/td><td>A completion state.<\/td><\/tr><tr><td>GPIO<\/td><td>A physical input\/output pin.<\/td><\/tr><tr><td>Preset<\/td><td>A configured duration, count, threshold, or size.<\/td><\/tr><tr><td>Rung<\/td><td>One horizontal ladder condition and action.<\/td><\/tr><tr><td>Scan<\/td><td>One top-to-bottom program evaluation.<\/td><\/tr><tr><td>Tag<\/td><td>A symbolic program name.<\/td><\/tr><\/tbody><\/table><\/div><\/section>\n<p class=\"b9x-back\"><a href=\"#b9x-top\">Back to top<\/a><\/p><\/article>\n","protected":false},"excerpt":{"rendered":"<p>B9X Ladder Editor Language Reference Version 1.50 &#8211; B9X Basic and Arduino Exports B9X Ladder Editor is a graphical control-programming environment based on relay ladder logic. Use this reference to design, document, save, and export complete ladder programs. On this page Overview Fundamentals Fields and types Operators and expressions Element reference Commands Exports Examples Design [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1439","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=\/wp\/v2\/pages\/1439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1439"}],"version-history":[{"count":5,"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=\/wp\/v2\/pages\/1439\/revisions"}],"predecessor-version":[{"id":1464,"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=\/wp\/v2\/pages\/1439\/revisions\/1464"}],"wp:attachment":[{"href":"https:\/\/b9xelectronics.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}