Symbols
This page contains basic info about jBlocks commands in Ladder diagrams mode. More about jBlocks can be found on the Environment page.
Group Inputs
Digital input
The Digital input obtains its value from various sources - ports. Ports are selected using left input box. The right input box is used for selecting pin.
Port | Note | Truth condition | Pin |
---|---|---|---|
IN | Dgital input | High level on digital input | 01-06 |
SW | Button | Button pressed | 01-04 |
TMR | Timer state | High level on the timer's output | 01-… (available timers) |
INIT | Init flag | First iteration of the main loop | - |
$ | Variable | Based on variable value | Variable name |
There can be any of variables created by digital input in variable field.
A click into the center of the symbol makes it negative:
Analog input
Value of the Analog input is true if its analog value fits given condition (equality or non-equality). Basically it works as an analog comparator. Source of the analog value (port and pin) can be selected from two input fields in the first row. The condition for comparsion is selected in the second row.
Operator | Meaning |
---|---|
> | Greater than |
>= | Greather than or equal |
== | Equal |
⇐ | Less than or equal |
< | Less than |
Port | Note | Pin |
---|---|---|
AIN | Analog input | 01-06 |
COUNTER | Counter | 01-… (available timers) |
RTIME | Last PLC cycle delay | - |
IR_SA03 | Infrared rangefinder SA03 | 01-06 (analog inputs) |
IR_SA05 | Infrared rangefinder SA05 | 01-06 (analog inputs) |
IR_SA06 | Infrared rangefinder SA06 | 01-06 (analog inputs) |
PRESS_SA02 | Pressure meter SA02 | 01-06 (analog inputs) |
TEMP_SA04 | Thermometer SA04 | 01-06 (analog inputs) |
US_SI02 | Light sensor SI02 | - |
US_SI03 | Ultrasonic rangefinder SI03 | - |
ACC_SI01 | Accelerometer SI01 | By axis X, Y, Z |
GYRO_SI06 | Gyroskop SI06 | By axis X, Y, Z |
RGB_SI04 | RGB color sensor SI05 | By colors R, G, B or ALL for all colors |
LINE_SI05 | Line sensor SI05 | 01-05 |
Every analog input's value is accessible (i.e. for printing it into console) as a variable named analog[i] where i is the number given in symbol's title.
Group Outpus
Digital Output
Digital output is set high if the rung's value is true. In the other case the digital output is cleared. Source for the digital output is selected using port and pin:
Port | Note | Pin |
---|---|---|
OUT | Digital output | 01-08 |
LED | LED diode | GREEN1, GREEN2, ORANGE, RED |
$ | Variable | Variable name |
The variable name must not be empty and may contain only upperspace and lowerspace letters and numbers. The first character in variable name must not be a number.
A click into the center of the symbol makes it negative:
Console and LCD
These symbols are used to print messages into console or LCD display. Messages may be print on single line or on new line per message. Variables are printed using $ („dollar“) character. Example for variable named var:
„The value is: $var“
Every message may contain any number of variables. It is also possible to print value of the analog inputu or timer. These values are accessible using variables analog[i] and counter[i] where i is the identifier. Another printable variable is rtime which stores delay of the last PLC cycle in milliseconds.
Group Motors
Servo
Sets poosition of servo connected to a digital input (01-08) in interval 0-100%. Values 0% and 100% are limit values for shaft position. A counter (counter[i]) could be also used as value for servo position.
Motor
Sets speed of DC motor A or B in interval 0-100%, where 0% means stopped motor and 100% is full speed. If the rung value is false, motor is stopped (mode STOP - brake, motor terminals are shorted). There are two possible modes for each motor:
Mode | Note |
---|---|
CLOCKWISE | Clockwise rotation |
COUNTERCLOCKWISE | Counter-clockwise rotation |
An analog input (analog[i]) or counter (counter[i]), could be also used as value for motor speed.
Group Timer/Counter
Timer
Sends signal (rung value) into timer's input. The identifier of a timer could be set in timer's title. There are three timers which can be used:
- TON: Rising edge on input starts timer. The timer sets its output high after specified delay. Falling edge on input stops the timer.
- TOF: Rising edge on input sets timer's output high. Falling edge on input starts the timer. Timer's output is set low after specified delay,
- TOP: Rising edge on input starts timer. Timer's output is highg while the timer is running. This timer can not be reset during specified delay.
Timer's delay is set in milliseconds (1000 ms = 1 s)
Counter
If a rung value is true, the counter increments its value by 1. Counting direction can be set in the Count field (+ for incrementing and - for decrementing). The initial state is set in field Init. Counter's value is available (i.e. for analog_input as variable counter[i] where i is the counter's identifier. The identifier can be set in counter's title.
Reset timer
Sets specified counter to given value.