Logging in via ADS PLC

Logging in via ADS PLC
none 4.0 1
  • HMI Model:
  • EasyBuilder Pro Version: 06.06…

Hello,

I want to ask somebody more elite macro guy who has any experiences with account management over PLC + macro.

I need to create permanent scanning macro which will works in the two way…

First way is like - like super user over build in popup window … then I need to send register local 9220 to PLC … that works and then I now who is using the machine …

Second way is like - normal operator from array of operators which are indentified by the rfid chip and they are creating a one group … this event I need to tell HMI to change security …

When I am appling single one from solutions higher - it works but when I connected them inside the event based code - solution over HMI logging popup - not works anymore …

`unsigned int userData
unsigned int userData_old
unsigned int userFromPlc
unsigned int userFromPlc_old

unsigned int tempPlc
unsigned int tempHmi

int value = 0

macro_command main()

GetData(userFromPlc, "Beckhoff TwinCAT PLC - Free Tag Names", "vlHMI.udtHmiScreenManagement.uiUsersStatus", 1)
GetData(tempHmi, "Beckhoff TwinCAT PLC - Free Tag Names", "vlHMI.udtHmiScreenManagement.uiUsersStatus", 1)
GetData(userData, "Local HMI", LW, 9222, 1)
DELAY(100)
GetData(tempPlc, "Local HMI", LW, 9222, 1)
DELAY(100)

if (userFromPlc <> userData) then
	if (userData_old <> userData) then
		GetData(userData, "Local HMI", LW, 9222, 1)
		DELAY(100)
		SetData(userData, "Beckhoff TwinCAT PLC - Free Tag Names", "vlHMI.udtHmiScreenManagement.uiUsersStatus", 1)
		DELAY(100)
		GetData(tempHmi, "Beckhoff TwinCAT PLC - Free Tag Names", "vlHMI.udtHmiScreenManagement.uiUsersStatus", 1)
		DELAY(1000)
		int tempp = 31
		SetData(tempp, "Beckhoff TwinCAT PLC - Free Tag Names", "vlHMI.udtHmiScreenManagement.uiUsersStatus", 1)
		userData_old = userData
		userFromPlc_old = userData
		userFromPlc = userData
	else
		while (tempPlc <> userFromPlc)
			SetData(userFromPlc, "Local HMI", LW, 9222, 1)
			GetData(tempPlc, "Local HMI", LW, 9222, 1)
		wend
		userFromPlc_old = userFromPlc
		userData_old = userFromPlc
		userData = userFromPlc
	end if
end if

end macro_command`

thanks for any help

endian