Wires, Buses, etc.

Disclaimer
Bundles
Wires and EPICS Record Links
Wire Types
Drawing Wires
Editing Wires
Wire Consistency
Bus Names and Bus-Wire Names

Disclaimer


In Capfast compatibility mode, tdct attempts to be "fully compatible" with Capfast™.
Fully compatible means, that a one can work on a schematics or a symbol with both Capfastand tdct without any problems.
This does, however, not mean, that a schematic saved by Capfast, then read and saved by tdct are identical.
Tdct implements some changes in how wire-numbers and wire-IDs are treated.

Bundles


Tdct does not support Capfastbundles, which were a drawing convenience. When reading a Capfastschematic containing bundles, tdct replaces the wires drawn into and from the bundle with single wire-networks.


Wires are used to ultimately establish links between EPICS record fields. Each record link originates at a record link field and ends at a non-link field at the other end of the wire. The non-link field must be uniquely identifiable, i.e. there must be only one link from a given link field to a given non-link field. Note that multiple links may end at the same non-link field.
A record link is drawn as a set of connected wires which makes a connection between one port each on two different EPICS record symbols. In the simplest case the set consists of just one wire. The ports on the EPICS record symbol have the same name as the corresponding record field.

As part of the tdct hierarchy support, two wires of a connected set can be located on different schematics. They connect "up" through a hierachical connector or "down" through a symbol port of a user-defined symbol.
For drawing convenience, two wires of a connected set can be connected on the same schematic with junctions or through an intermediary "bus". Note that the bus can traverse different levels of hierarchy.

NOTE: EPICS records symbols use by convention a port named SLNK as the end of a forward link. This is documented in the IOC Application Developer's guide of EPICS releases 3.13 and before.
 

Wire Types


Tdct allows the drawing of three wire types:

Wire Type Menu short-cut key
1 plain wire Symbol >> New Wire W
2 bus Symbol >> New Bus B
3 bus-wire Symbol >> New Bus Wire U


Drawing Wires

Tdct forces wires to be drawn as a sequence of orthogonal segments.
In order to draw any wire
  1. enter wire-draw mode from the menu or via a short-cut key.
  2. move the mouse to the desired wire start location and left-click to position the first point
  3. move the mouse to the next position   (don't drag, i.e. don't hold down any key)
  4. left-click to position the next point
  5. right-click to finish the wire (at least two points must be positioned for a valid wire).
If  the present mouse position would allow a wire to connect with a symbol port or another wire, the default (arrow) mouse pointer changes to a pointing hand.
If an end of a finished wire is unconnected, a red circle is drawn around the end (only for wires, not for buses).

top

Plain Wires Buses

 Once a bus is finished, Tdct prompts for a bus name. A valid bus name has the format

<name>[<range>]

where
    <name>   can be any combination of letters, digits, and underscores.
    <range>  consists of two integer  numbers separated by a dash or colon.
    No white space is allowed int the bus name.
    Note that the square brackets are part of the syntax.

Example:  myBus[0-5]

Bus Wires

Bus wires are drawn from a symbol port to a point on a vertical bus segment.
Tdct automatically attaches the bus wire to the bus with a bustap symbol.
Once a bus wire is finished, Tdct prompts for a bus wire name. A valid bus wire name has the format

<name>[<wire index>]

where
    <name>    is the name of the bus the bus wire connects to.
    <wire index>   is an integer  number which must fall within the bus range
    No white space is allowed int the bus wire name.
    Note that the square brackets are part of the syntax.

Tdct suggests to use the same bus-wire name as the bus name, but the user can override it.
When building EPICS databases, tdct uses only the wire index when connecting wires through a bus.

Example:  WIRE[3]

top

Editing Wires

Once a wire is selected, wire-edit mode is toggled on/off by right-clicking.

Re-routing a Wire
  1. select a wire by left-clicking
  2. right-click to enter edit mode. Green drag-boxes will appear around each wire segment endpoint
  3. position the mouse pointer inside one of the drag-boxes and left-press. If the mouse was positioned inside a drag-box, the box will change colour to red.
  4. drag the wire point to the desired location. If the point is a wire end-point and the point location allows connecting of the wire to a symbol port or to another wire, the default (arrow) mouse pointer changes to a pointing hand.
  5. release the mouse button.
Adding Segments to a Wire

In wire-edit mode, a wire can be extended with an orthogonal segment
If a wire is connected to a port or another wire, the connected end cannot be extended.


Removing Segments from a Wire

In wire-edit mode, a wire-segment can be removed 
If a wire is connected to a port or another wire, the connected end cannot be removed.


Re-naming a Wire
This function is available for buses and bus-wires only.
  1. select a wire by left-clicking
  2. use the R short-cut key to open the rename dialog
Renaming is possible both with wire-edit mode on or off.

top




Wire Consistency

For wires in a schematic, tdct and Capfastkeep track of wire connections with a connection string for each of the two wire ends. If a wire end connects to a symbol port, the connection string contains the symbol type, the name of the symbol and the symbol port it is connected to.
If the symbol is modified after the schematic has been drawn inconsistencies can creep in if the port connected to the wire is renamed, deleted or moved.

This situation is recognized by tdct, when a schematic is loaded. The user is warned, receives a list of wires with problems and has two choices:
  1. to redraw the inconsistent wires
  2. let tdct auto-fix the inconsistencies.
If wire inconsistencies are detected during batch-building of databases, a warning message is printed.


Auto-fix Dangers
Auto-fix checks for each wire on the schematic , which connects to a symbol port, if the port at the location of the wire end matches with the connection string attached to the wire. If not, the connection string is updated based on what is found at the end-point location.
In certain circumstances, auto-fix  will create potentially undesired effects:
Auto-fix presents you with a list of all the wire end changes it made and asks you to review them.

 top

Bus Names and Bus-Wire Names

When following bus-wires, tdct tries to cope with the fact that different versions of Capfast and different versions of the EPICS database generator e2db exhibit different behaviour.

Older schematics obtained from Keck ("old-style") have bus-wires connect to one end of a bus-tap, but the other end of the bus-tap is not connected to anything, it is just located on top of the bus.
Newer schematics ("new-style") have bus-wires connect to one end of a bus-tap and the other end of the bus-tap is connected to a bus-segment.

When drawing bus-wires, tdct implements the new-style behaviour with zero- length bus segments.

When a bus ascends from a schematic to a higher hierarchy level (i.e. the bus connects to a hierarchy connector ) or descends from a schematic to a lower hierarchy level (i.e. connects to a symbol port) the bus name can be different on different hierarchy levels.

When tdct follows a bus-wire from an EPICS record link field, it first tries to find a matching bus wire on the same schematic. Matching is done in two steps:

  1. any bus-wire with the same wire id is a match.
    This works on both old-style and new-style schematics.
  2. from the bus-tap connecting the bus-wire to a bus-segment, the bus-name is obtained and any bus-wire with the same name and index as the followed bus-wire connected to the same bus is a match.
    This works only on new-style schematics.
In other words:
On old-style schematics, bus-wires must have the same name as the bus.
On new-style schematics, bus-wires may have different names from the bus.