Skip to content
MB Datasuite
  • Features
  • Applications
  • Energy
  • Visualization
  • Prices
  • Free Trial
  • Deutsch
MB Datasuite
  • Features
  • Applications
  • Energy
  • Visualization
  • Prices
  • Free Trial
  • Deutsch

System requirements and compatibility

7
  • System requirements for DataSuite
  • Supported operating systems
  • Operate as a windows service
  • Database connections 
  • PLC support  
  • Notes on safe operation  
  • White Label

Quick start

9
  • Installation  
  • Set up PLC connection  
  • Create trigger  
  • Select trigger variable in the handshake  
  • Execute trigger  
  • Create Excel file  
  • Write header data to the file  
  • Write record  
  • Connect to a Database

Tutorials, HowTos and instructions

1
  • Alarm emails with OPC-UA: Monitoring excess temperature with an S7 1500 PLC

User Manual

96
  • General information on the user manual
  • Licensing
    • Determining the required licence  
    • Activate your licence  
  • Settings
    • General information
    • Export  
    • Import  
    • Password protection  
    • Change language  
    • Factory settings  
  • Trigger
    • General information about the trigger
    • Create trigger  
    • Trigger structure  
    • Use variables  
    • Additional trigger editing functions
      • Calculations and Formatting of SPS Data
      • Invert Excel Actions 
      • Changing data blocks for all variables in the trigger 
    • Trigger Actions
      • General information
      • Write variable 
      • Excel – Writing  
      • Excel – Read  
      • Convert Excel file to PDF  
      • Print Excel file  
      • Convert Excel file to HTML file  
      • Database: Execute Query 
      • Database: Write record (Insert) 
      • Database: Write several data records (insert) 
      • Database: Read data record (Select) 
      • Database: Read multiple records (Select) 
      • File options (copy, move, rename, delete)  
      • Read out file names in folder  
      • Execute REST Request 
      • FTP Upload
      • Send e-mail  
      • Send SMS  
      • Send message using Telegram 
      • Send message using Threema  
      • Start external applications  
      • Exporting and importing data blocks (DB)
      • Update Data Block
      • Set PLC time 
    • Trigger trigger conditions and handshake
      • General information on Trigger conditions and handshake  
      • Standard handshake  
      • Individual handshake  
    • Error handling and log
      • Error handling and log  
  • Accounts
    • Telegram account
      • Telegram time limit
      • Configure Telegram account 
      • Set up Telegram
    • Threema account
      • Threema Time limit  
      • Configure Threema account 
      • Set up a Threema account
    • E-Mail account
      • Email time limit
      • Configure email account  
      • General info about e-mail account
    • SMS-account
      • Configuring a SMS / Seven Account
      • SMS time limit
      • SMS Sandbox
  • Error Codes
    • General   (0 – 99)
    • PLC (200 – 299)
    • E-mail (300 – 399)
    • SMS (400 – 499)
    • Excel (500 – 599)
    • OPC UA (700 – 799)
    • Databases (800 – 899)
    • Print (1000 – 1099)
    • PDF (1100 – 1199)
    • HTML (1200 – 1299)
    • Start external applications  (1300 – 1399)
    • Rest (1400 – 1499)
    • Time Master (1900 – 1999)
    • Telegram (2000 – 2099)
    • Threema (2100 – 2199)
  • Devices (Shelly)
    • General information about Shelly
    • Add devices 
    • Using Shelly variables 
  • Excel, CSV, PDF files
    • CSV files: Formats, special characters, encodings
    • General information on Excel files
    • File selection 
    • File formats  
    • Read Access 
    • Write Access 
  • Control systems (PLC connections)
    • General information on PLC connections
    • Create PLC connection  
    • Variables  
    • Configure PLC connection  
  • Databases
    • General information on databases
    • Database: Write record (Insert) 
    • Database: Write several data records (insert) 
    • Database: Read data record (Select) 
    • Database: Read multiple records (Select) 
    • Database: Execute Query 
  • Webserver / REST API
    • General information web server/rest API
    • Settings and security 
    • Calling up web pages 
    • Use Rest-API 
  • Support
    • Create Support Packages  
    • Support contact details

Upgrade from version 2 to version 3

1
  • Change from version 2 to version 3  
  • Home
  • Docs
  • User Manual
  • Webserver / REST API
View Categories

Use Rest-API 

Lesedauer: 6 min

The Rest API is always available at the following address: 

https://localhost:22722/api/{Ressource}

Depending on the selected authentication, you still need to pass username and password in the header (Basic) in each request. How exactly you set the Basic authentication depends on your client. 

All information is always transferred in JSON format. 

Evaluate error codes  #

The following HTTP status codes are returned. If the request ended with an error, an error object containing an error message is returned for the error code. 

HTTP Code Description 
200 Request successfully executed. 
400 Bad Request: Request could not be executed. Parameters are invalid. 
401 Unauthorized: Authentication (username/password) is invalid. 
403 Forbidden: Access to the resource is set to “No access” in the web server/rest API settings. 
404 Not Found: The address was not found. 

Object: Error 

Parameter Type Description Type Description 
code string HTTP Status Code string HTTP Status Code 
message string error message string error message 

PLC – end points  #

Query all controls (Get)  #

The api/plcs endpoint provides you with a list of all enabled controllers. 

GET  
https://localhost:22722/api/plcs 

Parameter: None 

Response: Collection of PLC objects (JSON). 

Object: PLC 

Parameter Type Description 
name string Name of the PLC 
ip string IP address of the PLC. For the simulator it is [MB] Simulator 
plcType string PLC type Simulator, S7-300, S7-1200, S7-… 
connectionType string Connection type: [MB] Simulator S7 OPC UA 
connectionState int Connection status: 0 = Disconnected 1 = Connection is established 2 = Connected 
dataBlocks String listing All imported data blocks 

Querying variables of a data block (Get)  #

Via the endpoint api/plcs/{PLC-name}/datablocks/{DB-name}/variables you get a list of all PLC variables in this data block. 

GET  
https://localhost:22722/api/plcs/{ PLC -Name}/datablocks/{DB-Name}/variables 
https://localhost:22722/api/plcs/PLC/datablocks/Data/variables 

Parameter: The parameters PLC-Name and DB-Name are required. 

Parameter Type Description 
PLC-Name string Name of the PLC 
DB-Name string Name of the data block 

Response: Listing of the variables of the data block as variable object (JSON). 

Object: Variable 

Parameter Type Description 
name string Name of the PLC 
fullName string Full name of the variable. If the variable is e.g. inside a struct: StructName.VariableName 
dataType String S7 Data type 
variables Variable type listing Contains all nested variables, e.g. for structs or arrays. 

Query variable values (Get)  #

You can query variable values via the api/plcs/{PLC-name}/datablocks/{DB-name}/values?variables=… endpoint.  

GET  
https://localhost:22722/api/plcs/{PLC-Name}/datablocks/{DB-Name}/values 
?variables={Variable-Name},{Variable-Name} 
https://localhost:22722/api/plcs/PLC/datablocks/Data/values 
?variables=Order,Product 

You can either query a single variable or several variables at once. If you want to read multiple variables, simply specify the names of the variables separated by a comma. All variables must be in the same data block. 

Parameter: The parameters PLC-Name, DB-Name and Variable-Name are required. 

Parameter Type Description 
PLC-Name string Name of the PLC 
DB-Name string Name of the data block 
Variable-Name string Name of one or more variables. Multiple variables are separated by a comma. 
mode (optional) string If Mode is set to raw, no information about the variables is returned, only the value. 

Response: Listing of the variables of the data block as variable object (JSON). 

Object: Variable 

Parameter Type Description 
name string Variable name 
dataType string S7 Data type 
value Depending on the type of the variable Depends on the type of the variable. Will be explained in the following paragraph. 

The value of a variable depends on the data type of the variable. A distinction is made between the four possibilities: 

1. Simple value data type 

For simple data types, such as Byte, Int, String, the simple value is returned as Value. 

2. Struct data type 

For a Struct, Value contains a list of the object type Variable.  

3. Array data type 

For an array, Value contains a listing of the object type variable. Each element of the array is specified as a complete variable. 

4. Struct array data type 

In a Struct array, Value contains a list of the object type Variable (Struct). Each element in the list is a Struct, which in turn contains a list of the object Variable in Value. 

Writing variable values (post)  #

You can write variable values to the PLC via the api/plcs/{PLC-name}/datablocks/{DB-name}/values endpoint. There are two ways to write variables. 

Transferring variable values directly as parameters  #

Variable values are passed directly as parameters: {name}={value}. If you want to write multiple variables, you can separate them with a comma.  

This method is suitable for writing simple variable values in an uncomplicated way. With this method, the body of the request is left empty. 

POST  
https://localhost:22722/api/plcs/{PLC-Name}/datablocks/{DB-Name}/values 
?variables={Variable-Name}={Variable-Value} 
https://localhost:22722/api/plcs/PLC/datablocks/Data/values 
?variables=Order=123,Product=abc 

Parameter: The parameters PLC-Name, DB-Name, Variable-Name and Variable-Value are required. 

Parameter Type Description 
PLC -Name string Name of the PLC 
DB-Name string Name of the data block 
variables Variable-Name = Variable-Value string Name of one or more variables with the assignment of the value. Multiple assignments are separated by a comma. 

Response: Status code 200 (OK). No body is returned. 

Passing variable values as JSON body  #

If you want to write many variables in one operation, transferring the variable values as JSON body is suitable. 

POST  
https://localhost:22722/api/plcs/{PLC-Name}/datablocks/{DB-Name}/values 
https://localhost:22722/api/plcs/PLC/datablocks/Data/values 

Parameter: The parameters PLC-Name, DB-Name, Variable-Name and Variable-Value are required. 

Parameter Type Description 
PLC-Name string Name of the PLC 
DB-Name string Name of the data block 

The variable values to be written are transferred in the body of the request. These are transferred as a listing of the variable value object. If you want to write only one value, you can also send only the individual object instead of the listing. 

Object Variable value 

Parameter Type Description 
fullName string Full name of the variable.  For example, if the variable is inside a struct: StructName.VariableName. For array variables: Array[10].ID The name is obtained by querying the available variables of the data block 
value object New variable value 

Transfer of a variable value object 

Transferring a collection of variable value objects 

Response: Status code 200 (OK). No body is returned. 

Trigger – end points  #

You can use the api/trigger endpoint to get a listing of all triggers available via the Rest API. 

Get  
https://localhost:22722/api/trigger 

 
Parameter: None 

Response: Listing of triggers (JSON). 

Object: Trigger 

Parameter Type Description 
name string Name of the trigger 
group string Trigger group 
isEnabled Bool Indicates whether the trigger is activated. False = Trigger is deactivated, is not monitored, cannot be started. True = Trigger is activated, is monitored, can be started. 
actions String type listing Description of all actions defined in the trigger 

Start trigger (post)  #

You can start a trigger via the api/trigger/{trigger-name}/start endpoint. 

Post  
https://localhost:22722/api/trigger/{Trigger-Name}/start 

 
Parameter: The Trigger name parameter is required. 

Parameter Type Description 
Trigger-Name string Trigger name 

Response: Status code 200 (OK). No body is returned. 

Wie findest du den Beitrag?
Immer noch Fragen? Wie können wir helfen?

Wie können wir helfen?

Calling up web pages 
Inhalt
  • Evaluate error codes 
  • PLC - end points 
  • Query all controls (Get) 
  • Querying variables of a data block (Get) 
  • Query variable values (Get) 
  • Writing variable values (post) 
  • Transferring variable values directly as parameters 
  • Passing variable values as JSON body 
  • Trigger – end points 
  • Start trigger (post) 

MB DataSuite

  • Home
  • Features
  • Applications
  • Prices

Info portal

  • Knowledge Base
  • Newsletter
  • Change Log
  • FAQ & Support

Company

  • About us
  • Imprint
  • Linkedin
  • YouTube
  • Facebook

Legal

  • Privacy
  • EULA
  • Cookie Settings

Help and support

  • Tel +49 2742 72927 80
  • Live Presentation
  • Contact
  • Deutsch
    • About us
    • Support & FAQ
    • Contact
    • Imprint
    • TOS and EULA
    • Privacy policy
    • Linkedin
    • Facebook
    • Youtube
    [MB] Software und Systeme GmbH