- Interactive Q & A - Interactive Q & A (
-   LIVE PLC Questions And Answers (
-   -   Any iFix Gurus out there? (

James42005 January 21st, 2020 12:20 AM

Any iFix Gurus out there?
I have hit a wall on a request I received for a change to iFix. Operations want security added to a button which resets a counter. The way it works currently is there is an object with script, when clicked on, a confirmation popup is opened. If selected yes the scripts writes a command to the PLC tag to reset the counter. I need to add security over the button based on user group currently logged in. I have the user groups set up and functioning well, I use the security to limit changes to datalinks all the time but I am having trouble figuring out how to lock out the script from running based on security level. I am just learning VB so, any tips?

g.mccormick January 21st, 2020 07:03 AM

Instead of keeping the script from running, can you check permissions inside script?

parky January 21st, 2020 07:09 AM

Hmm.. I thought I just posted this but has not shown up oh well...

Dim Result As Integer
Dim UserID As String
Dim UserName As String
Dim GroupName As String
Dim UserInfo As String
System.FixGetUserInfo UserID, UserName, GroupName
Use FixGetUser system function to access to logged on user.

James42005 January 21st, 2020 11:50 PM

So... I am an idiot. Or maybe iFix sucks. Maybe a little bit of both. So I was able to do it with tag based security. I am not sure why I couldn't get it to work yesterday. I was really proud of myself at first because I thought I wrote really fancy script to do what I wanted, but it turned out it was doing nothing. Haha, oh well, a win is a win. Thanks for your help.

All times are GMT -4. The time now is 09:58 PM.