---
title: "Cloud"
canonical: "https://docs.cuesystem.com/space/CVCHELP/510591260/Cloud"
format: markdown
---
> Macro (toc)

---

> ℹ️ To make the cloud functions visible in the **Cue Visual Composer version 20.11 and earlier**, you need to have the "Show Experimental Functions" switch checked in the options dialog

![image](media://78b49e14-4e96-444e-8310-134e30b67fb0)

# _CloudCredentials 

```visualbasic
Global Structure _CloudCredentials  
  Var SiteId As Text[50]  
  Var UnitMagicName As Text[100]  
  Var Email As Text[150]  
  Var Password As Text[100]  
End Structure
```

SiteId 

The SiteId is a globally unique identifier of the site to communicate with. The SiteId must be specified on the admin web of the unit. 

UnitMagicName 

The UnitMagicName is the identification name of the unit. It is specified on the admin web too. It is used as login name of the unit for cloud commands. 

Email 

The e-mail. 

Password 

The Password is the login password of the unit used in cloud commands. 

# GetCloudCredentials 

This function returns credential values needed for other cloud commands. The command returns True on success or False if an error occurs.  

#### Syntax 

```visualbasic
Function GetCloudCredentials(ByRef cloudcredentials As _CloudCredentials) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

# **SendDataToCloud**

This function sends data to a cloud. Recommended format of data is JSON. The command returns True on success or False if an error occurs. 

#### Syntax 

```visualbasic
Function SendDataToCloud(cloudcredentials As _CloudCredentials, protocolname As Text, instancename As Text , dataname As Text, datavalue As Text, Optional archiveondelete As Boolean := False) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

protocolname 

The protocolname is a unique identifier that identifies the device driver. 

instancename 

The instancename identifies the name of the driver instance. 

dataname 

The dataname identifies the meaning (and format) of data. 

datavalue 

The data to save on the cloud. Can be any text. The data format recommended is JSON.  

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: [300](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#300), [301](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#301), [302](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#302), [303](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#303), [310](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#310), [311](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#311), [312](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#312), [313](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#313).

# ReceiveSingleDataFromCloud 

This function receives data from the cloud. The data are sent to a cloud by the command SendDataToCloud. The command returns True on success or False if an error occurs. 

#### Syntax 

```visualbasic
Function ReceiveSingleDataFromCloud(cloudcredentials As _CloudCredentials, protocolname As Text, instancename As Text, dataname As Text, sourceunitmagicname As Text, ByRef datavalue As Text) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

protocolname 

The protocolname is a unique identifier that identifies the source device driver. Must be the same as the one used by the command SendDataToCloud. 

instancename 

The instancename identifies the name of the driver instance. Must be the same as the one used by the command SendDataToCloud. 

dataname 

The dataname identifies the meaning (and format) of data. Must be the same as the one used by the command SendDataToCloud. 

datavalue 

The data received from the cloud. The data was previously sent by the command SendDataToCloud.  

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: [300](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#300), [301](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#301), [302](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#302), [303](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#303), [304](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#304), [310](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#310), [311](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#311), [312](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#312), [313](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#313).

# SendCommandViaCloud 

This function sends the command to the cloud. The command returns True on success or False if an error occurs. The command in opposite to data is valid only for some time and has some destination. 

#### Syntax 

```
Function SendCommandViaCloud(cloudcredentials As _CloudCredentials, protocolname As Text, commandname As Text, commandparameters As Text, destinationunitmagicname As Text, destinationinstancename As Text,  expiration As Time, ByRef answerhandle As Long) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

protocolname 

The protocolname is a unique identifier that identifies the source and destination device driver. 

commandname 

The identification name of the command. Can be any text. 

commandparameters 

The parameters of the command. Can be any text. The preferred format is JSON. 

destinationunitmagicname 

The magic name of the destination unit. 

destinationinstancename 

The instance name of the destination device driver instance. 

expiration 

The expiration interval defines the time period during which the command is valid. The command is valid only in the time window defined by that expiration time interval. 

answerhandle 

The answerhandle is the identification number of the command on the cloud. The ***answerhandle*** is then used by the command ReceiveAnswerFromCloud. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: [300](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#300), [301](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#301), [302](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#302), [303](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#303), [310](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#310), [311](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#311), [313](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#313). 

# ReceiveCommandViaCloud

This function is the pair to SendCommandViaCloud. The command returns True on success or False if an error occurs. 

#### Syntax 

```
Function ReceiveCommandViaCloud(cloudcredentials As _CloudCredentials, protocolname As Text, destinationinstancename As Text, ByRef commandname As Text, ByRef commandparameters As Text, ByRef answerhandle As Long) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

protocolname 

The protocolname is a unique identifier that identifies the source and destination device driver. 

destinationinstancename 

The instance name of the destination device driver instance. 

commandname 

The identification name of the received command. 

commandparameters 

The parameters of the received command.  

answerhandle 

The answerhandle is the identification number of the command on the cloud. The ***answerhandle*** is then used by the command SendAnswerViaCloud. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: [300](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#300), [301](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#301), [302](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#302), [303](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#303), [304](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#304), [310](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#310), [311](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#311), [312](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#312), [313](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#313).

# SendAnswerViaCloud 

This function sends the answer to a command received by the command SendCommandViaCloud. The command returns True on success or False if an error occurs. 

#### Syntax* *

```
Function SendAnswerViaCloud(cloudcredentials As _CloudCredentials, answerhandle As Long,  answervalue As Text) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

answerhandle 

The answerhandle is the identification number of the command on the cloud. See ReceiveCommandViaCloud. 

answervalue 

The data send as an answer to the command. The preferred format is JSON. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: [300](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#300), [301](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#301), [302](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#302), [303](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#303), [310](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#310), [311](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#311), [313](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#313).

# ReceiveAnswerViaCloud 

This function receives the answer to the command sent. The command returns True on success or False if an error occurs. 

#### Syntax 

```
Function ReceiveAnswerViaCloud(cloudcredentials As _CloudCredentials, answerhandle As Long, ByRef answervalue As Text) As Boolean
```

#### Parameters 

cloudcredentials 

The access data for cloud communication. 

answerhandle 

The answerhandle is the identification number of the command on the cloud. See SendCommandViaCloud. 

answervalue 

The data send as an answer to the command. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> This function returns True on success or False if an error occurs. 

The function <u>[GetLastError](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number that occurred while executing the command. The errors that can happen: [300](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#300), [301](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#301), [302](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#302), [303](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#303), [304](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#304), [310](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#310), [311](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#311), [312](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#312), [313](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#313).