HOANLK
  • Login
  • Register
Cart / 0$

No products in the cart.

No Result
View All Result
  • Home
  • Automation
    • SIEMENS
    • PANASONIC
    • SERVO
    • EPLAN
    • MITSUBISHI
  • Technology
    • .NET
    • PYTHON
    • IOT
  • LIBRARY
  • Project
    • Project 2019-2023
  • Shop
  • Contact
  • English
    • Tiếng Việt
    • English
    • Русский
HOANLK
No Result
View All Result
screenshot 1731311529

Get TagPrefix WINCC PRO V13-V19

by hoanlk
22/03/2025
in SIEMENS

GetServerTagPrefix

Description TagPrefix

In order for a WinCC client in a distributed system to access tags of the associated server, the tag names must be expanded to include the server prefix.

A pointer of type “char” to server prefix, tag prefix, and window prefix is returned in each case.

The user is not permitted to change the memory (including no strcat) or release it.

Can only be used in C scripting.

TagPrefix

Syntax

void GetServerTagPrefix (char** ppszServerPrefix, char** ppszTagPrefix, char** ppszWindowPrefix);

Return value

ppszServerPrefix

Pointer to a pointer that references the server prefix

ppszTagPrefix

Pointer to a pointer that references the tag prefix

ppszWindowPrefix

Pointer to a pointer that references the window prefix

Example

The following program code retrieves the server prefix, tag prefix and window prefix checks their validity. If an error occurs, a text is output and the function is exited. If the check is successful a tag name is created and returned. Processing is executed as follows:

  1. Declaration of pointer pszServerPrefix, pszTagPrefix and pszWindowPrefix for the three prefixes
  2. Initialization of the nServerPrefixLen, nTagPrefixLen and nTagLen tagsThey serve as a buffer for the string length of the prefixes to be read out.
  3. Initialization of the myTagName tag
  4. Reading out of server prefix, tag prefix and window prefix
  5. Case distinction: Server prefix
    • – No server prefix returned: a text is output and the function is exited.
    • – Server prefix returned: Its length is determined and saved in the nServerPrefixLen tag.
  6. If a tag prefix is returned, its length is determined and saved in the nTagPrefixLen tag.
  7. Determines the length of the tag name and saves it in the nTagLen tag.
  8. Case distinction: Permissible length for tag name
    • – Permissible length exceeded: a text is output and the function is exited.
    • – Permissible length not exceeded: The tag name required for a client environment is compiled.
 
{
char* pszServerPrefix;
char* pszTagPrefix;
char* pszWindowPrefix;
int nServerPrefixLen = 0;
int nTagPrefixLen = 0;
int nTagLen = 0;
char myTagName[MAX_DM_VAR_NAME+1];
//Initialize the return valuememset(myTagName,0,MAX_DM_VAR_NAME + 1);
//Get the serverprefix the tagprefix and the windowprefixGetServerTagPrefix(&pszServerPrefix, &pszTagPrefix, &pszWindowPrefix);
//If a serverprefix exists
if (pszServerPrefix)
{  //Get the length of the string  nServerPrefixLen = strlen(pszServerPrefix);}
Else{  printf(“No server prefix was returned.”); 
return;}
//If a tagprefix existsif (pszTagPrefix)
{  //Get the length of the string  nTagPrefixLen = strlen(pszTagPrefix);}
//Get the length of the tagnTagLen = strlen(“TagName”);
//Check if the lenght of the
//ServerPrefix+TagPrefix+VarName + the double points < MAX_DM_VAR_NAME)
if (nServerPrefixLen + nTagPrefixLen + nTagLen+2 < MAX_DM_VAR_NAME)
{  sprintf(myTagName,”%s::%s%s”,pszServerPrefix,pszTagPrefix,”TagName”);
  //User defined code where the  //user can do something with the returnvalue  …}
Else{  printf(“The resulting string is too long.”);
  return;}}

Home

Youtube

Share this…
  • Facebook
  • Twitter
  • Linkedin
  • Whatsapp
  • Pinterest
Tags: SIEMENS
hoanlk

hoanlk

Related Posts

SIEMENS Sim EKB Install TIA PORTAL V20
SIEMENS

SIEMENS Sim EKB Install TIA PORTAL V20

22/03/2025

SIEMENS Sim EKB Install TIA PORTAL V20 Below is the EKB application for Tia Portal V20 Link Tia Portal V20...

Summary of errors in SIEMENS WINCC V7
SIEMENS

Summary of errors in SIEMENS WINCC V7

25/08/2024

I. Server not available, Cannot connect to server 1: Check whether SQL status is running or not in SQLServermanager 2:Check...

PROFIBUS OLM và Cấu Hình PROFIBUS OLM Siemens
SIEMENS

PROFIBUS OLM and PROFIBUS OLM Configuration Siemens

24/04/2024

What is PROFIBUS OLM? PROFIBUS OLM is designed for use in optical PROFIBUS fieldbus networks. They allow conversion between electrical...

Hướng dẫn sửa lỗi SwacLogin error wincc unified
SIEMENS

How to do fix SwacLogin Error WinCC Unified V16-V18

08/09/2023

Swaclogin error message is displayed when an identity supplier cannot be accessed. Communication between WinCC's unified equipment is exclusively encrypted...

Kết Nối Ngành Tự Động Hóa Với HTTP REST API: Tiềm Năng Và Ước Mơ Của Tương Lai Công Nghệ
IOT

Connecting Automation Industry With HTTP REST API: Potential And Dream Of The Future Of Technology

15/08/2023

Nowadays, automation is becoming an integral part of every sphere of life and industry. From manufacturing, to resource management, to...

Profinet Siemens:Technology solutions for industrial automation – 1990
SIEMENS

Profinet Siemens:Technology solutions for industrial automation – 1990

12/08/2023

Profinet Siemens is one of the leading industry communication standards developed by Siemens, one of the world's largest and most...

Next Post
SIEMENS Sim EKB Install TIA PORTAL V20

SIEMENS Sim EKB Install TIA PORTAL V20

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Home
  • Shop
  • Return policy
  • Contact
  • Account

© 2023 HOANLK - Premium theme by HOANLK.

No Result
View All Result
  • Home
  • Automation
    • SIEMENS
    • PANASONIC
    • SERVO
    • EPLAN
    • MITSUBISHI
  • Technology
    • .NET
    • PYTHON
    • IOT
  • LIBRARY
  • Project
    • Project 2019-2023
  • Shop
  • Contact
  • English
    • Tiếng Việt
    • English
    • Русский

© 2023 HOANLK - Premium theme by HOANLK.

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In