SIMATIC08
Member
Hello everybody
Ths is my issue :
- I want to attribute for each USER a variable in my project and use it when they LOGGED
So i used this script bellow (But in this solution i am obligate to login with Small letters)
what I want is to login with Capital, Small or Mixed Letters so I need to CONVERT "#CurrentUser" Variable to Small Letters befor the "strcmp(txt,"user_name")" command
(For Information : I have basic knowledge in C- Language so please i need a detailled information)
Script :
#define Tag_1 "@CurrentUser"
#define Tag_2 "USER_1_LOGGED"
char* txt;
txt =SysMalloc(20);
txt = GetTagChar(Tag_1);
printf ("txt=%s\r\n", txt);
if (strcmp(txt,"user_name"))
{
SetTagBit(Tag_2,0);
return 100;
}
else
{
SetTagBit(Tag_2,1);
return 200;
}
I will so greetful if you could help me in this issue becaus i am in rush
Thans
Ths is my issue :
- I want to attribute for each USER a variable in my project and use it when they LOGGED
So i used this script bellow (But in this solution i am obligate to login with Small letters)
what I want is to login with Capital, Small or Mixed Letters so I need to CONVERT "#CurrentUser" Variable to Small Letters befor the "strcmp(txt,"user_name")" command
(For Information : I have basic knowledge in C- Language so please i need a detailled information)
Script :
#define Tag_1 "@CurrentUser"
#define Tag_2 "USER_1_LOGGED"
char* txt;
txt =SysMalloc(20);
txt = GetTagChar(Tag_1);
printf ("txt=%s\r\n", txt);
if (strcmp(txt,"user_name"))
{
SetTagBit(Tag_2,0);
return 100;
}
else
{
SetTagBit(Tag_2,1);
return 200;
}
I will so greetful if you could help me in this issue becaus i am in rush
Thans