Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - timryder

Pages: 1 2 [3] 4 5 6
31
Support Questions / Re: AdvancedHMIv399yBeta12
« on: September 27, 2018, 10:54:16 AM »
For the default windows driver, if you click and then drag down the button will maintain.

32
Additional Components / Re: NEW!!! User Management Plugin
« on: June 04, 2018, 09:14:34 AM »
Did you add handlers for the Form Load event?

Code: [Select]
        AddHandler UserManagement.userLoggedIn, AddressOf handleUserLoggedIn
        AddHandler UserManagement.userLoggedOut, AddressOf handlerUserLoggedOut

replace the handleUserLoggedIn and handlerUserLoggedOut with whatever the names of your methods you want to handle the event.

33
Support Questions / Re: ModbusTCP parsing a PLC Boolean Array
« on: May 29, 2018, 11:49:07 AM »
No I haven't... anything YOU know of which would be advantageous to justify getting the latest?


 

34
Support Questions / ModbusTCP parsing a PLC Boolean Array
« on: May 29, 2018, 10:10:26 AM »
I have a job i'm doing for a customer that wants me to make an interface for their PLC.  The PLC is of type GE CPE330.  I'm using ModbusTCP to interface with it successfully so far.  I'm at a snag where I need to parse through a boolean array they have to determine what faults are active in the system.  It's 100 booleans and I need to send it over ModbusTCP to the HMI. I can use straight booleans or i can pack it into an INT somehow. 

But what on the AHMI side should I do to evaluate that data? I'm using a DataSubscriber 2 already on my MDI Parent for other items and I can add whatever element I need to that which will constantly check the machine for the active faults.  But what data type... how do I address it? How do I parse it?

I have 40500 and UP to work with for Modbus Addresses.

Please your thoughts are very much appreciated.

35
Support Questions / Suggestion for a change on ALL controls
« on: January 24, 2018, 07:28:10 AM »
I have had several times now where there's something causing one of the controls in my form to constantly keep adding more COMComponents to my form? Everytime I build or make a code change and come back to the Designer, it'll add another one!!  I have looked through each control on my form one by one using VS and each one is set for the same exact ComComponent but yet still it keeps adding them. I noticed in the logic of every control basically if you add it to the form and there is no ComComponent specified that it will add one automatically for you.  I think this is problematic.

Can you either:
A.) Figure out why and fix that
B.) Instead of adding them either do nothing or message box that you need to add one to the form and list the name of the control which is requesting one be added.

Thanks

36
Application Showcase / Re: Bar Code Verification App
« on: January 11, 2018, 04:12:01 PM »
Clear, simple... not too cluttered.  Good job :)

I've done tons of custom applications with the Cognex Vision products. I use their SDK's all the time for applications. 
Good work.

37
Additional Components / Re: NEW!!! User Management Plugin
« on: December 18, 2017, 10:28:32 AM »
Sure,

Here are the icons I used

38
Additional Components / NEW!!! User Management Plugin
« on: December 12, 2017, 12:23:55 PM »
Hey guys,

Per a request from a customer I created a new UserManagement component of my own.  There are plenty of tutorials out there on how to do this in VB.net but for those who aren't code savvy I thought I would share mine and offer any help I can to those who reply to this thread.

First off here is what it looks like on MY user interface.

ScreenShots:




Features:
  • Login/Logout function
  • Local .csv database of users and passwords
  • 3 Levels of privileges Operator, Supervisor, Administrator
  • Passwords are stored as Encrypted strings
  • Public events for Login Logout each page can subscribe to
Usage:
Start by adding the file(s) to your project. Right click on your project name and select "Add --> Existing Item"


Please make sure to select all of the files in the .zip which were including as an attachment in this post.


Login:
Next somewhere on your project add a Button control to your form and double-click on it to add the handler for the Click event and show the related code.
The is a function in the UserManagement Class called "Login" this function when called for the very first time ever on a computer will check if the local database file (.csv) exists yet on the computer.  If it does not then the function will create it and also add the "Admin" user to the database.  The "Admin" user has the default login of User: Admin   Pass: password.  Note that the Username is NOT case sensitive but the Password however is.

Add a call to this Login function using code similar to this.
Code: [Select]
    Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
        frmLogin.ShowDialog()
        If Not UserManagement.currentUser = "" Then
            'Do Something here to handle the login succesfull... maybe update a label.text control with the UserManagement.currentUser.
            'There will also be a UserManagement.currentPrivilage which will be set based on the credentials of the user which logged in.
        End If
    End Sub

When the function is called it will display the Login Dialog.  The Login Dialog will handle the call to the login function within the UserManagement.vb. When the login is successful the function will set 2 shared variables in the UserManagement class for the "currentUser" and "currentPrivilage".  It will also fire a Shared Event for the Login.

It is recommended that you have each form which will dynamically be changing based on the User logged in and their Privileges to subscribe to the public events of "userLoggedIn" and "userLoggedOut".  Here is how to handle those events.

In the Load event for the Form in question, add a handler for each event.
Code: [Select]
        AddHandler UserManagement.userLoggedIn, AddressOf handleUserLoggedIn
        AddHandler UserManagement.userLoggedOut, AddressOf handlerUserLoggedOut

Next create the Subs for each of those events or you can copy this code and add it to your own.
Code: [Select]
    Private Sub handleUserLoggedIn()
        If UserManagement.currentPrivilage = UserManagement.Privilage.Administrator Or UserManagement.currentPrivilage = UserManagement.Privilage.Supervisor Then
            Me.tbManualVinEntry.Enabled = True
        End If
    End Sub
    Private Sub handlerUserLoggedOut()
        If Not UserManagement.currentPrivilage = UserManagement.Privilage.Administrator Or Not UserManagement.currentPrivilage = UserManagement.Privilage.Supervisor Then
            Me.tbManualVinEntry.Enabled = False
        End If
    End Sub

In these examples I am checking the value of the privilege for the current user who is logged in. That is stored in the UserManagement.currentPrivilage variable. Depending on the privilege of the user you can create different methods to turn On or OFF various user controls on the form.  Each form can subscribe to these events and alter the controls within accordingly.

Logout:
Finally back on the main form where the Login button resides.  Add another button for the Logout functionality. Then in the Click event of the button add the following code.
Code: [Select]
        Dim myUserManagement As New UserManagement
        Call myUserManagement.Logout()

Adding a User:
To add a user, somewhere in you project create a button to add a user. Double click on this button to access the click event code.  Add the following code.
Code: [Select]
    Private Sub btnAddNewUser_Click(sender As Object, e As EventArgs) Handles btnAddNewUser.Click
        frmAddUser.ShowDialog()
    End Sub

This will open up the frmAddUser so you can properly add a user to the database.  NOTE: It is suggested that the visibility property of this button be set to False by default and only enabled if the current user logged in has a Privilege of Administrator.  That can be handled by reading the Login section above.


The addUser function will check if the username already exists in the database and if so will prompt if you would like to overwrite it. This gives you the ability to just change the password easily if needed.  After you click "Add User" the function will display a messagebox to inform you if it was a success or a failure.

Deleteing a User:
In my example there is a combo box which I populate on the load event of the form of all of the users in the database. To do this add a ComboBox


To do this, add a Combo Box control to your form, set the Name property to "cboUserList" then open up the Load Event logic of the form.  Add the following code (make sure you change the name of the Combo Box control to match your project if needed)
Code: [Select]
        Me.cboUserList.Items.Clear()
        Dim userList As New List(Of String)
        Dim _userManagement As New UserManagement
        _userManagement.getUserList(userList)

        If Not userList.Count = 0 Then
            For i = 0 To userList.Count - 1
                Me.cboUserList.Items.Add(userList.Item(i).ToString)
            Next
        End If

Next add a new button control to your form and set the Text property to "Remove User".  Double click on the button to open the click event code.  Add the following code to yours keeping in mind the name of the Combo Box from the previous step.
Code: [Select]
    Private Sub btnDeleteSelectedUser_Click(sender As Object, e As EventArgs) Handles btnDeleteSelectedUser.Click
        If Not Me.cboUserList.Text = Nothing Then
            Dim _userManagement As New UserManagement
            _userManagement.deleteExistingUser(Me.cboUserList.Text)
            Dim i As Integer = Me.cboUserList.SelectedIndex
            Me.cboUserList.Items.RemoveAt(i)
        End If
    End Sub

This function will find the Username in the database and remove it.  The comboBox will also remove the item from the list.

Please let me know if you have any questions below or of something isn't clear and I will modify this post and elaborate more.

Thanks! and enjoy.


39
Support Questions / Re: Path Segment Error (Invalid Tag Name)
« on: November 15, 2017, 06:20:21 PM »
What PLC. This very much matters.

40
Open Discussion / Re: Wiki
« on: November 11, 2017, 05:19:05 PM »
Also Archie,

You should probably link the WiKi on your main site because it's nowhere to be found on there.
Actually... I can't even find it anymore.  Where the heck is it?  Can someone link me?

41
Open Discussion / Re: Wiki
« on: November 11, 2017, 03:14:10 PM »
If the Wiki control allows for moderators yes.  Otherwise for now let's get some content going for this guy! He's done a LOT of hard work and he needs a break.

42
Open Discussion / Wiki
« on: November 10, 2017, 07:19:51 AM »
Archie,

There's a lot missing on the Wiki which some users like Phrog and Myself would be happy to contribute to when we get time. But I can't seem to make an account and my login for this doesn't work.
Can you either A fix it so people can make an account or B add a thread where we can request to have you make an account for us.
Unless of course you don't want public contributions to the pages but then why would it be a Wiki :)

Thanks

43
Application Showcase / Re: Design Time editing like RA ME etc.
« on: November 09, 2017, 07:26:01 AM »
Yeah I can just pull the dll out of the Bin Folder. 
How did you create this do you have any references websites or anything you used to make it?

44
Support Questions / Re: Dual monitors (PC)
« on: November 08, 2017, 03:59:51 PM »
You have all kinds of errors when you build this project.

45
Support Questions / Re: Lost all my Comms
« on: November 08, 2017, 11:51:24 AM »
OK seems to have fixed that... I have a few new strange issues.

First, on the driver setting the .DisableSubscriptions = True doesn't seem to do anything.  I went through on every form and set the property of the driver to True and when I Wireshark them it would seem that they still are being polled.  I can see the tags on the other forms still constantly being polled.  I also am using the Form.Leave and Form.Enter events to set the property to True and False respectively. No matter what though they still seem to keep polling.

For some reason on 2 of my forms in the designer, there automatically keeps coming back a Driver EthernetIPforCLXCom1 but I checked the list of components on the form and every single one has the EthernetIPforMicro800Com1 already set as the ComComponent. Why the heck does this keep happening?

OTher than that I think I have everything fixed by upping the Poll Override times and by making completely sure that all of the DisableMultiServiceRequest = True.  Everything seems to be ok now.  Thoughts on this silly little issue in the Designer?

NOTE:  The Final configuration for me is that you CAN write down an array to the Micro800 family and you CAN read an array of values with the DS2.  I used the Starting address of the Tag TagName[1] and set the value of the number of elements to the Array Size [32].

Pages: 1 2 [3] 4 5 6