Files and File Formats Used by SimPLC

Note that all file formats feature some form of the version string in their first line. SimPLC will reject any file that doesn't contain the correct version string. file
The file maintains configuration information used every timethe simulation is started. Primarily, it keeps track of the prior positions and sizes of windows used in the simulation. Lines of the form:
and so forth simply store this window placement information. Also saved in this file is the last directory path where a load or save was performed - this is given on a line similar to:
The file also holds several parameters governing simulation that may need to be modified on some computers. There are three such parameters:
SimRedrawDelay is the argument passed to the repaint method of the main window. Higher values will cause the main window to be repainted less frequently, possibly causing the highlighting of powered components within networks to lag slightly behind the actual simulation, but greatly reducing the graphics workload and improving the responsiveness of the GUI.

SimMinDelay and SimEvalDelay govern the amount of time that the continuous evaluation thread sleeps in between each network evaluation. The governing formula is:

sleep time (in ms) between network evaluations =
  (SimEvalDelay/<number of networks>) + SimMinDelay

components.cfg file
The file components.cfg describes what circuit components should be included at runtime. It specifies which components will appear in the component bin, and what their layout should be. Currently, the component bin is hard coded to only use two columns of components, with optional heading labels on groups of related components. The default components.cfg looks like this:
#Ladder Logic Simulator 1.0b
#  When new implementations of CircuitComponent are created,
#  they must be added to this file.
#LABEL Switches
#LABEL Outputs
Lines beginning with #LABEL place a label in the component bin at the corresponding location, and all other lines not prefixed by a # are expected to denote names of classes implementing the CircuitComponent interface.

plugins.cfg file
The file plugins.cfg describes what plugin simulation front-ends should be included at runtime. The file format is similar to that used in components.cfg, but with no support for labels. The default components.cfg looks like this:
#Ladder Logic Simulator 1.0b
#  When new Simulator plugins are created, they must be added here.
The SimulatorPlugin entries in the file will simply be appended to the simulation menu's list of available plugins.

.net file format
All .net files begin with the version string, followed by a series of networks, each represented as follows:
NETWORK       <- Header marking the start of a network.
HShort         \
HShort          \
NO 1024 0       |   88 Entries; the strings returned
HShort          |   by the getSaveData methods of each
OP 1026 0        \  of the components in a network,
    .            /  listed in column major order.
    .           |
    .           |
HShort          /
HShort         /
0000000000     \
0000000000      \   7x10 Array of 0's and 1's representing 
0000000000      |   whether vertical shorts are present in
0000000000       }  each location. Note that this is
0000000000      |   represented in row-major order.
0000000000      /
0000000000     /
               <-  Any comment text goes here.
~ENDCOMMENT    <-  Trailer marking the end of comment text.

-Mike Cammarano