Skip to main content

Input

The Start each time block

The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:

Bild1.PNG

Is an abbreviation for the following construct:

Bild2.PNG

You can insert all conditions from this category into the inputs category in the Start each time block.

Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.

Button

image-1623679995498.03.59.png

The button is a digital sensor that differentiates “current flowing” from “no current flowing.” Whether current is flowing, therefore, depends both on the wiring and on whether the button is pushed. You can use the button in two ways:

image-1623592536466.48.54.png

As a “normally open contact”:
contacts 1 and 3 are connected.  

Button pressed: Current is flowing.                                                                                                             Button not pressed: No current is flowing

As a “normally closed contact”:

Contacts 1 and 2 are connected.         

Button pressed: No current is flowing.                                                                                                   Button not pressed: Current is flowing.                                                                                  

Call

You can use get mini button status to obtain more information on whether current is flowing through the button or not. If current is flowing, it will return 1, or 0 if no current is flowing. 

Query

To query whether the button is in a certain status, use the is button ... block. You can use the drop down menu (small triangle) to select which status to query. This block can be used as a condition.

Ultrasonic sensor

image-1623680004750.04.35.png

The ultrasonic sensor is used to measure distances.

Call

You can use get ultrasonic sensor distance to obtain information on how far the sensor is from the closest object. The distance is stated in cm.

Query

To query whether the sensor is a certain distance from the closest object, use the is ultrasonic sensor distance ... block. You can use the drop down menu (small triangle) to select how the measured distance should be compared to an entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the measured distance is less than 2 cm.

Bild6.PNG

Color sensor

image-1623680014794.04.56.png

The color sensor transmits red light, and measures how much of the light is reflected back. The color sensor returns values between 0 and 2000 depending on how strong the reflection is. It is well-suited for detecting previously calibrated colors. 

Call

You can use get color sensor value to obtain information on how strongly a surface reflects the light.

Query

To query whether the sensor is in front of a certain color, use the is color sensor value ... block. You can use the drop down menu (small triangle) to select how the measured color value should be compared to the entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the measured color value is less than 1000.

Bild8.PNG

IR track sensor

image-1623680023473.04.45.png

The infrared track sensor is a digital sensor used for detecting a black track on a white background, and works at a distance of 5 - 30 mm between the sensor and the background. 

Call

Get IR track sensor status will return 0 if the sensor does not detect a track. If the sensor detects a track, it will return 1

Query

To query whether the IR track sensor detects a track, compare the current track status with 0 or 1. To do so, use the block is IR track sensor status [] ... . You can use the drop down menu (small triangle) to select how the track status should be compared to the entered value (<, ≤, =, ≠, ≥, >) . The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the track status is 0

Bild10.PNG

Phototransistor

image-1623680417014.17.52.png

The phototransistor is a digital sensor that differentiates between light and dark. 

Call

Get phototransistor status will return 0 if the sensor does not detect any light. If the sensor detects sufficient light, it will return 1.

Query

To query whether the phototransistor detects light or dark, compare the brightness status with 0 or 1. To do so, use the block is phototransistor status []. You can use the drop down menu (small triangle) to select whether to query light or dark. 

image-1623844705358.57.11.pngOne possible use for a phototransistor is in a light barrier, as in this model.

Photoresistor

image-1623680434602.04.18.png

the resistance of the photoresistor drops when it is exposed to more brightness. The value output by the photoresistor, therefore, is a measurement of brightness.

Call

Get photoresistor value provides information on how bright it is. The smaller the output value, the brighter it is.

Query

To query whether the photoresistor measures a certain brightness value, use the block is photoresistor value [] ... You can use the drop down menu (small triangle) to select how the brightness value should be compared to the entered value (<, ≤, =, ≠, ≥, >). The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the brightness value is less than 3000.

Bild14.PNG

NTC resistor

image-1623680448576.05.31.png

The NTC resistor is a non-binary temperature sensor. Its electrical resistance drops when the temperature increases, and is therefore a measurement for the temperature. 

Call

Get NTC resistance [] delivers either a resistance value or the temperature calculated from it. You can select what should be delivered using the drop down menu (small triangle).

Query

To query whether the NTC resistor measures a certain value, use the block is NTC resistance [] [] ... You can use the drop down menu (small triangle) to select what should be compared, and with what comparative operator. The comparison value is entered in the number field at the end of the block. This block can be used as a condition. In the example, the motor is stopped when the temperature is less than 20.

Bild16.PNG