Product description

TPLC-12-1 Software manual

This document describes the operation of TPLC-12-1's bundled software. For information on TPLC-12-1's hardware and connections, check TPLC-12-1 programmable logic controller installation manual.

TPLC-12-1 programmable logic controller's bundled software consists of the following programs:

StrongLogic v2

StrongLogic schematic editor is the controller's developement tool - it provides the engineer or developer with all means necessary to create the logic rules that the controller should follow. It also provides an easy way to create a user-friendly, animated user interface for the end user.

Principle of operation

The PLC is constantly reading all inputs, evaluating a given logic schematic and setting all outputs to their calculated values. To allow user interaction and supervision, additional virtual I/Os, called User Inputs and User Outputs, are introduced. The schematic consists of graphically represented elements, connected to each other. For more information on the available elements, see Elements.

When the schematic is complete, the engineer or developer can create a suitable user interface that will appear in the Simple view of the NMon program. To do that, one should switch to from Design Layout to Preview Design Layout. This is found under View->Layout. There are different painting tools available in this view. The idea, though, is to import a proffesionally prepared image to use as background and then only add the animated and clickable items in the StrongLogic application. Every added item (line, circle, rectangle, etc.) can be activated when a certain I/O changes. When active, it may change color, blink or move. Also, every item can be made clickable, changing the state of a certain User Input when clicked. All these setting are available in StrongLogic with a doubleclick on the item.

The imported background image is stretched to cover the whole user area. Still, when importing a background image, one should use an image with a resolution close to that of the target display. Using a lower resolution image would lead to low quality and using an image that is too big would be a useless overshoot which will only make the generated files bigger or even affect system performance.

NMon

TPLC-12-1 Monitor program (NMon.exe) is an application that turns a windows PC into a terminal for the PLC. It also serves as a network server for the remote monitor application (RMon.exe). It provides a login system with access logs (for both local and network login).

NMon application requires no additional libraries to run and keeps its settings in windows registry, so it needs no installation. It is a single executable that can be run from any folder with write access (required for the logs). Still, some additional steps are necessary:

- By default NMon communicates with the PLC through COM2. If this is not the port the PLC is connected to, then the actual COM port name should be supplied as a parameter in the command line. This can be conveniently included in the application shortcut. For example, if the program is located at c:\tplc and the connected com port is COM3, then the command line in the shortcut file should be c:\tplc\nmon.exe COM3.
- NMon will search its local directory for a file named "flash.lgf". This is the flash file exported from StrongLogic v2 application and loaded into the PLC through the FlashLoader application. If this file does not exist or differs from the one in the PLC, NMon would not work and show an error message instead.

Modes of operation:

NMon operation modes are changed with a button in the top left corner of the window.

Simple mode:

In simple view mode the user interface designed in the StrongLogic v2 application is shown. The user can interract with it by clicking on certain items or executing complex commands.

Advanced mode:

In advanced view mode a table of all inputs, outputs, user inputs, pulse user inputs, pulse user inputs, accumulators, noop regs and all other broadcasted numeric elements are shown. The user can change any editable item's value by clicking on it. Complex commands are also available in this view.

Register Saving

Accumulators and Noop registers are automatically saved to non-volatile memory approximately every 8 minutes. This provides protection against power loss. Register saving can also be provoked manually from the Save Registers button before a planned system shutdown.

User system:

NMon's user system can be configured in two different modes - the default mode, in which commands can be sent to the PLC even if no user is logged, and protected mode, in which a command can be sent to the PLC only by a logged user. This mode, as well as user names and passwords, can be easilly changed by the admin user. The initial password for user "admin" is "changeme" and changing it is strongly recommended.

Simulation mode:

If a simulator is connected to the PC instead of a PLC, then NMon has some additional functions. First, in advanced mode, inputs are changeable in the same way user inputs are. This is so because a simulator has no real inputs, thus they are simulated by setting them through NMon. The whole input configuration can be saved in a file and loader later through buttons Save Ins and Load Ins. Also, there is a button which allows setting the analog input values. As well as manually set, analog input values can also be retrieved by a physical remote analog input unit if one is connected to the simulator.

RMon

TPLC-12-1 Remote Monitor program connects through the local network or the internet to a running NMon application to offer the same functionality as NMon, but limited to viewing only. Connection is made after clicking the Connect button and entering the required information - address, port, user and password. The user and password must exist in NMon's password system. NMon's listening port is 11341.

Flash Loader

Program upload:

TPLC-12-1 Flash Loader program uploads a flash file, exported fom StrongLogic v2 to the PLC. The PLC should be powered on and connected to the selected COM port. First a file is selected. Then, each time the Write button is pressed, the file is read, checked and uploaded to the PLC. Because the COM port is only used during uploading and released later and the flash file is reloaded before every uploading, the program does not need to be closed after each programming. It may remain running minimized or in the background, and when the flash file has been replaced by a new one, a single click on the Write button would be enough to upload the new file. Since NMon uses the same COM port, though, it needs to be closed before flashing. This is not a problem, since restarting NMon to read the new flash file would be necassary anyway.

Firmware update:

Firmware versions 4.0 and up come with integrated secure bootloader. To update the firmware one needs to first enter bootloader mode. This is achieved by shorting pins 63 and 64 on the CPU while powering on. If successfull, the board alive LED should blink twice as fast as is usually does. When this is achieved, a firmware (.aes) file is loaded into FlashLoader application and firmware update is started by clicking the Write button. Firmware update takes a few seconds to finish, after which the board automatically reboots in normal mode.


log_elements

Elements

Logic Elements

A logic element is an element which provides a logic output. Logic elements are:

Input:

Outputs the state of a physical input, set with a parameter.

Output:

Outputs the state its input to a physical output, set with a parameter.

User Input:

Outputs the state of a user input, set with a parameter.

Pulse User Input:

Outputs the state of a user input, set with a parameter. When set by the terminal PC, a pulse user input will only generate a pulse and then go back to 0 state.

User Output:

Outputs the state of its input to a virtual output, set with a parameter.

AND:

Outputs the logic AND of its inputs. Truth table:

in 1 | in 2 | out
0 | 0 | 0
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1

OR:

Outputs the logic OR of its inputs. Truth table:

in 1 | in 2 | out
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 1

NAND:

Outputs the logic NAND of its inputs. Truth table:

in 1 | in 2 | out
0 | 0 | 1
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0

NOR:

Outputs the logic NOR of its inputs. Truth table:

in 1 | in 2 | out
0 | 0 | 1
0 | 1 | 0
1 | 0 | 0
1 | 1 | 0

XOR:

Outputs the logic XOR of its inputs. Truth table:

in 1 | in 2 | out
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0

NXOR:

Outputs the logic NXOR of its inputs. Truth table:

in 1 | in 2 | out
0 | 0 | 1
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1

Delay:

Has one input, one output and one parameter t. The output has a value of 1 if and only if the input has had a value of 1 for the last t seconds.

Var Delay:

Has one output and two inputs - the first logic, the second numeric. The output has a value of 1 if and only if the logic input has had a value of 1 for the last t seconds, t being the value of the numeric input.

Pulse Delay:

Has one input, one output and one parameter t. After a 0 to 1 transition on the input, a t second timer is started. When the timer finishes, a single pulse is generated on the output. While the timer is running, all transitions on the input will be ignored. When t = 0, no timer is started, but a pulse is generated immediately after every 0 to 1 transition on the input.

Var Pulse Delay:

Has two inputs and one output. Acts the same as a pulse delay, but the length of the timer is provided by the second input.

NOT:

Outputs the inverted value of its input. Truth table:

input | output
0 | 1
1 | 0

Memory Trigger:

Has two inputs and one output. When input2 is 0, the output value remains unchanged. When input2 is 1, the value of input1 is copied to the output.

Switch Trigger:

Has two inputs and one output. When both inputs are 0, the output value remains unchanged. Truth table:

in 1 | in 2 | out
0 | 0 | -
0 | 1 | 0
1 | 0 | 1
1 | 1 | 0

Toggle Trigger:

Has 3 inputs and 1 output. The first two inputs behave the same way as with the Switch Trigger. A 0->1 transition on input3 toggles the state of the output.

Delayed Stop Switch Trigger:

Has 4 inputs and 1 output. The first two inputs make it behave exactly as a Switch Trigger would. Input3 provides a delayed stop function, changing the output to 0 after t seconds, t being the value of input4, which is numeric. When the output is 1 and input3 is 1, a t second timer is started that will change the output to 0 after completion. When the timer is already running, the value of input3 is not sampled. If a value of 1 on input1 or input2 is sampled, the timer will be stopped, canceling the delay stop process.

Comparator > :

Has 2 numeric inputs and one logic output which is 1 if and only if the value of input1 is larger than the value of input2.

Comparator = :

Has 2 numeric inputs and one logic output which is 1 if and only if the value of input1 is equal to the value of input2.

Clock Signal :

Has no inputs, one logic output and one parameter, which sets the desired output frequency.

Big AND :

Has no inputs and one logic output. Produces the logic AND of several consecutive I/Os, set by parameters. Also, all I/Os can be inverted before ANDed. For example, a Big AND can produce the AND or inputs 12-35, but it can also produce the AND of the inverted outputs 83-98.

Big OR :

Same as Big AND, but outputs the OR instead of AND function.

BigAlarm :

Has one logic input which stops the alarm. Just as the above operations, Big Alarm operates on a set of consecutive I/Os, but acts as a trigger. When a 0 to 1 transition on any of the I/Os occurs, the output is set to 1. The output is set back to 0 by a value of 1 on the logic input. Optionally, all I/Os can be inverted before being used.

CycleBreaker :

Has one input and one output. Used to assist automatic sorting when cycles exist that cannot be avoided. The user should choose a connection to be of higher latency when sorting such that no race conditions can occur.

Numeric Elementsc Elements

A numeric element is an element which provides a numeric output or is part of another numeric element.

Analog Input:

An analog input outputs the value aquired from a physical analog input.

Analog Output:

An analog output outputs the value of its input to a physical analog output.

Accumulator:

An accumulator stores an integer value and provides operations on it through the use of acc operations. The value of an accululator is stored in non-volatile memory.

Register:

Has two numeric inputs and one parameter. The parameter selects the operation that will be constantly applied to the two inputs, placing the result in the output.

Acc operation:

Has two inputs, one parameter and no outputs. An acc op is always linked to a certain accumulator and operates on its stored value. The parameter selects the operation that will be applied to the stored value and input1 when a 0 to 1 transition is detected on input2.

Constant:

Has no inputs, one parameter and one output. The parameter provides the value of the output.

Noop Reg:

Same as an accumulator, but no operations can be applied to it. Can be used for storing configuration values.

Replicators

A replicator is an element which provides a link to another element. Replicators are not "real" elements, as they to not translate to logic elements but to connections. They are used only for convenience.

Input replicator:

Creates a duplicate of the specified input, user input or pulse user input.

In Marker:

Has one logic input and no outputs. Combined with one or more out markers, creates a named link.

Out Marker:

Has one logic output and no inputs. Links to an in marker and outputs the value ot the in marker's input.

NL In Marker:

Same as an in marker but for numeric values.

NL Out Marker:

Same as an out marker but for numeric values.