Sending Citect login variable to PLC

Join Date
Jun 2008
Location
Sweden
Posts
4
Hi
I have a project were i want to indicate to the plc that someone is logged on to the hmi system. This is done with cicode in the base template. Log in works ok, but log out doesn't.
After logging out the 'HMI_Login' variable in the plc stays '1' and the 'HMI_Login' variable in the hmi flips between '1' and '0'.

IF UserInfo(0) = "1" THEN
PLC1_HMI_Login = true;
PLC2_HMI_LogIn = true;
ELSE
PLC1_HMI_Login = false;
PLC2_HMI_LogIn = false;
END

I suspect the behavior is because i'm not allowed to change the variable after logging out from the hmi.

Anyone got a better solution?
 
I'm not familiar with Citect but can you not simply make a variable which has write access regardless of login state?

Alternatively. .. could you make your script execute every say, 2 seconds? Then have the PLC check if the bit that is being set is true every 2 seconds. If it's not, increment a counter. If it is true, set it false and reset the counter.

When your counter gets to 5 (not logged in for about 10 seconds) then your PLC logic can consider the HMI to no longer be logged in.

The order of the counter logic and the reset to zero bit is important otherwise the bit will always be 0.

The delay between writing the bit from the HMI can be adjusted to suit your system obviously. The longer the time between writes, the higher your counter value before recognising a logged out condition.
 
utrikesministern

Your probably right, you can't write if no user is logged in, How I overcome this issue is to always have someone logged in such as a "Viewer" account, so instead of loggin out you switch user back to the Viewer. In this instance you would look to see if the "Viewer" was active and act as if no one was logged in.
 
I also make use of a "Viewer" account that logs on automatically after a logout.

not sure how your template handles the logout, but you can change your logout button that calls the Logout() function to first call your own cicode script, from there you can set your variable to 0 and call the Logout() inside your script.
 

Similar Topics

Hello everybody, I'm currently working on a project where I need to implement an IoT platform based on Microsoft Azure Cloud. Communication is...
Replies
2
Views
73
I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
111
Hi I need to send a null command down a comms port. But in the crimson software when i used /x00 it coming back "Cannot use null character is...
Replies
2
Views
430
I've been having some trouble figuring out how to get the ip address for the mail relay server, is it something that I need to create separately...
Replies
10
Views
939
Hi Everyone, We have Silo System which has temperature sensor and these sensor data will be communicating through RTU unit to the Dedicated PC...
Replies
2
Views
632
Back
Top Bottom