Skip to documentation content

Documentation · Structure

Block diagram

Declare the input, the junctions, the blocks, the takeoff points and the output, then wire the signals. Every signal into a junction carries plus or minus.

Open Block diagram

When to use it

Draw a control system, a signal path or a signal-flow graph: blocks with their transfer functions, summing junctions and feedback loops.

Give every signal into a summing junction its sign. Write the forward path first; a loop back from a takeoff point is drawn under it.

Working example

Copy this complete example into the Source tab, then press Generate. Change its labels or values to make your first version.

Tingraph source
block "Closed-loop control" {
  input R "R(s)"
  sum E
  block C "Controller Gc(s)"
  block P "Plant Gp(s)"
  point T
  output Y "Y(s)"
  block H "Sensor H(s)"

  R -> E plus
  E -> C "E(s)"
  C -> P "U(s)"
  P -> T
  T -> Y
  T -> H
  H -> E minus "B(s)"
}

Syntax reference

The same reference used by the editor and AI briefing. Syntax is notation-specific; use the keywords listed here.

Diagram

SyntaxMeaning
block "Title" {open a block diagram, control loop or signal-flow graph

Elements

SyntaxMeaning
input R "R(s)"where a signal starts, drawn as its name
block G "G(s)"a block: a transfer function or a stage
sum Ssumming junction (a crossed circle)
point Ttakeoff point: one signal copied onto several lines
output Y "Y(s)"where a signal ends, drawn as its name
node X1 "x1"a signal-flow graph's variable, a small circle

Signals

SyntaxMeaning
A -> Ba signal from A to B
A -> B "U(s)"a signal with its name, or a branch gain
A -> S plusinto a summing junction, added
H -> S minus "B(s)"into a summing junction, subtracted, with a name
# commentline comment (also //)

Language rules

  • The file is one block "Title" { ... } block.
  • Declare every element before the signals: input, output, block, sum, point or node, then an ID, then a caption in quotes (a sum and a point need none).
  • A signal is A -> B; a caption in quotes after it names the signal or gives a branch's gain.
  • Every signal into a sum ends with plus or minus, and only those signals do. A summing junction takes two or more signals in and sends one out.
  • A point takes one signal in and sends it out on two or more lines. Nothing flows into an input or out of an output.
  • The forward path is drawn left to right; a feedback loop runs back under it to the junction it returns to.

Edit on the canvas

  • Move and rename blocks on the sheet; a signal re-routes from the side it leaves and enters.
  • Draw a new signal from the connector rail, and add blocks, junctions and points from the shape drawer.

Generate replaces the drawing from source. Save before generating again if you want to preserve manual finishing touches.

Read Saving & exporting

Write it with an assistant

Tingraph AI already knows this notation. For another assistant, copy the tutorial below, describe your diagram under MY DIAGRAM, then paste the returned source into the editor. This prompt includes every syntax row, rule and working example above.

Read the complete prompt
You are writing Tingraph source. Tingraph is a small text language that draws a block diagram (control system or signal flow). Answer with Tingraph source only.

SYNTAX
Diagram
  block "Title" {             open a block diagram, control loop or signal-flow graph

Elements
  input R "R(s)"              where a signal starts, drawn as its name
  block G "G(s)"              a block: a transfer function or a stage
  sum S                       summing junction (a crossed circle)
  point T                     takeoff point: one signal copied onto several lines
  output Y "Y(s)"             where a signal ends, drawn as its name
  node X1 "x1"                a signal-flow graph's variable, a small circle

Signals
  A -> B                      a signal from A to B
  A -> B "U(s)"               a signal with its name, or a branch gain
  A -> S plus                 into a summing junction, added
  H -> S minus "B(s)"         into a summing junction, subtracted, with a name
  # comment                   line comment (also //)

RULES
- The file is one `block "Title" { ... }` block.
- Declare every element before the signals: `input`, `output`, `block`, `sum`, `point` or `node`, then an ID, then a caption in quotes (a `sum` and a `point` need none).
- A signal is `A -> B`; a caption in quotes after it names the signal or gives a branch's gain.
- Every signal into a `sum` ends with `plus` or `minus`, and only those signals do. A summing junction takes two or more signals in and sends one out.
- A `point` takes one signal in and sends it out on two or more lines. Nothing flows into an `input` or out of an `output`.
- The forward path is drawn left to right; a feedback loop runs back under it to the junction it returns to.

WORKED EXAMPLE
block "Closed-loop control" {
  input R "R(s)"
  sum E
  block C "Controller Gc(s)"
  block P "Plant Gp(s)"
  point T
  output Y "Y(s)"
  block H "Sensor H(s)"

  R -> E plus
  E -> C "E(s)"
  C -> P "U(s)"
  P -> T
  T -> Y
  T -> H
  H -> E minus "B(s)"
}

OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `block "…" {` and ends with `}`.
- Do not invent keywords: use only the ones listed above.
- Keep labels short enough to read inside a box, and keep every ID unique.

MY DIAGRAM
Describe what you want here, then send this message.
How AI requests, attachments and privacy work

Something unclear? Contact support or read the Privacy Policy.