---
title: "Tecomat PLC variable devices"
canonical: "https://docs.cuesystem.com/space/CVCDD/447938587/Tecomat%20PLC%20variable%20devices"
format: markdown
---
# Overview

These devices are communication resources for Tecomat PLC variables. They are connected to a *TecoVar *connector of the Tecomat_PLC_EPSNET device.

# Variable group of properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Name | ByteString[200] | Any | Empty | Variable name of Tecomat PLC variable |
| ScanEnabled | Boolean | True, False | False | Enables scanning value on background |

Properties are common for all types of variable devices.

# Common global functions

All Variables devices have the same functions, which differ only by data types with which they work. In following description *VariableDataType *is used instead of specific data type.

## GetScanEnabled

This functions returns value of *ScanEnabled *property.

#### Syntax

```visualbasic
GetScanEnabled () As Boolean
```

## SetScanEnabled

This functions sets value of *ScanEnabled *property. 

#### Syntax

```visualbasic
SetScanEnabled (newscanenabled As Boolean)
```

## ScanValue

This function causes reading of value from Tecomat PLC. After calling this function new value from PLC is stored in driver memory. Use *GetValue *function to read value of variable then or write code into *OnValueChange *event. This function returns *True *if function success, else it returns *False*.

#### Syntax

```visualbasic
ScanValue() As Boolean
```

## SetValue

This function sets new value for variable. This functions writes new value to PLC. This function returns *True*

if function success, else it returns *False*.

#### Syntax

```visualbasic
SetValue (newvalue As VariableDataType) As Boolean
```

## GetValue

This function read value of variable from driver memory and sets it in the *newvalue *parameter. This function don't reads value directly from the Tecomat PLC. This function returns *True *if function success, else it returns *False*.

#### Syntax

```visualbasic
GetValue (ByRef newvalue As VariableDataType) As Boolean
```

# Common global events

## OnValueChange

This event is generated when variable's value changes. It is generated by *ScanValue() *function, which is called manually, or automaticaly, while *ScanEnabled *property is True.

#### Syntax

```visualbasic
OnValueChange As Process (newvalue As VariableDataType)
```

# Data types used in variable devices

|  |  |
| --- | --- |
| Tecomat PLC Variable device (Mosaic environment) | Variable Data Type (Cue Visual Composer) |
| Tecomat_BOOL | Boolean |
| Tecomat_SINT | Long |
| Tecomat_INT | Long |
| Tecomat_DINT | Long |
| Tecomat_USINT | Byte |
| Tecomat_UINT | Long |
| Tecomat_UDINT | Double |
| Tecomat_REAL | Double |
| Tecomat_LREAL | Double |
| Tecomat_TIME | Time |
| Tecomat_DATE | Time |
| Tecomat_TIME_OF_DAY | Time |
| Tecomat_DATE_AND_TIME | Time |
| Tecomat_STRING | ByteString |
| Tecomat_BYTE | Byte |
| Tecomat_WORD | Long |
| Tecomat_DWORD | Double |