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 - Jesse

Pages: 1 [2] 3 4
16
Feature Request / Idea for a new somewhat complicated control
« on: January 13, 2014, 06:21:49 PM »
Hey Archie,

Before I start I'd just like to point out this isn't an idea for logging data so much, I can write the code to log data to a database but what I'm looking for is more of a visual instrument.
I'm attaching with this a photo of a chart recorder from an EZ HMI panel that graphs lines of your setpoints and actual process values in real time.

My idea for you was to make a control that is a graph that the user has properties for a Time span and then also a property of how many increments to break that timespan into on the graph. Also properties for the left side of the graph such as your actual process value like 0 to 2500 degrees etc., and options to set a certain color line to a specific tag your polling information from. Now im not interested in keeping this information, it would just be a nice troubleshooting tool to be able to see what my process values have been for the last hour prior to me being called out to that machine, So what I'm saying is a scrolling graph that once the oldest information has past it is lost. I'd try to make this control myself but I know nothing of how to use graphics in Vb.net.

It be pretty cool if this control is possible to make without logging data but I'm not sure if it is, What do you think?

17
Support Questions / Re: Possible problem with EthernetSLC Driver
« on: January 13, 2014, 06:01:19 PM »
Yup, That solved the problem

18
Support Questions / Re: Possible problem with EthernetSLC Driver
« on: January 03, 2014, 10:13:59 AM »
Whoops, Figured it out. Hopefully noone sees the error in the Sub ConnState()

19
Support Questions / Possible problem with EthernetSLC Driver
« on: January 03, 2014, 09:08:15 AM »
Ok, HMI communicates with 5 PLCS 4 of which are CLX and 1 5/05 slc.
When the user selects a machine with a CLX it changes IP and enables subsciptions for that driver and disables for the SLC driver, Vise Versa with selecting the machine with the SLC then CLX driver subscriptions are disabled.

On a side note both drivers are set to subscriptions disabled when the program loads
here is the code for sending my info from my Labels.
Code: [Select]
Private Sub SendProgramToFunaceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendProgramToFunaceToolStripMenuItem.Click

        Dim CodeLabels = {CodeLabel1, CodeLabel2, CodeLabel3, CodeLabel4, CodeLabel5, CodeLabel6, CodeLabel7, CodeLabel8, CodeLabel9, CodeLabel10, CodeLabel11, CodeLabel12, CodeLabel13, CodeLabel14, CodeLabel15, CodeLabel16, CodeLabel17, CodeLabel18, CodeLabel19, CodeLabel20, CodeLabel21, CodeLabel22, CodeLabel23, CodeLabel24, CodeLabel25, CodeLabel26, CodeLabel27, CodeLabel28, CodeLabel29, CodeLabel30, CodeLabel31, CodeLabel32, CodeLabel33, CodeLabel34, CodeLabel35, CodeLabel36, CodeLabel37, CodeLabel38, CodeLabel39, CodeLabel40, CodeLabel40}
        Dim CodeValueLabels = {CodeValueLabel1, CodeValueLabel2, CodeValueLabel3, CodeValueLabel4, CodeValueLabel5, CodeValueLabel6, CodeValueLabel7, CodeValueLabel8, CodeValueLabel9, CodeValueLabel10, CodeValueLabel11, CodeValueLabel12, CodeValueLabel13, CodeValueLabel14, CodeValueLabel15, CodeValueLabel16, CodeValueLabel17, CodeValueLabel18, CodeValueLabel19, CodeValueLabel20, CodeValueLabel21, CodeValueLabel22, CodeValueLabel23, CodeValueLabel24, CodeValueLabel25, CodeValueLabel26, CodeValueLabel27, CodeValueLabel28, CodeValueLabel29, CodeValueLabel30, CodeValueLabel31, CodeValueLabel32, CodeValueLabel33, CodeValueLabel34, CodeValueLabel35, CodeValueLabel36, CodeValueLabel37, CodeValueLabel38, CodeValueLabel39, CodeValueLabel40, CodeValueLabel40}
        Dim StepLabels = {Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9, Label10, Label11, Label12, Label13, Label14, Label15, Label16, Label17, Label18, Label19, Label20, Label21, Label22, Label23, Label24, Label25, Label26, Label27, Label28, Label29, Label30, Label31, Label32, Label33, Label34, Label35, Label36, Label37, Label38, Label39, Label40, Label40}
        Dim BatchNumber As String

        OkToSend = True

        CodeValueLabelValidation()

        If OkToSend = True Then

            If ConnToSLC = False And ConnToCLX = True Then

                BatchNumber = InputBox("Enter Batch Number: ", "Batch Number")

                Dim C As Integer
                C = 0

                Try

                    If BatchNumber <> "" Then
                        EthernetIPforCLXCom1.Write("HMI_BATCH_NUMBER_IN_BUFFER", BatchNumber)
                        EthernetIPforCLXCom1.Write("HMI_CODE[0]", inc + 1)
                    Else
                        MsgBox("You Did Not Enter A Batch Number!")
                        Exit Try
                    End If

                    ProgBarForm.Show()

                    For C = 0 To 39
                        ProgBarForm.ProgressLabel.Text = C + 1
                        ProgBarForm.ProgressBar1.PerformStep()
                        EthernetIPforCLXCom1.Write("HMI_CODE[" & C + 41 & "]", CInt(d(CodeLabels(C).Text)))
                        EthernetIPforCLXCom1.Write("HMI_CODE_VALUE[" & C + 41 & "]", CodeValueLabels(C).Text)
                        System.Threading.Thread.Sleep(25)
                    Next

                    ProgBarForm.Close()

                Catch ex As Exception
                    MsgBox(ex)
                    ProgBarForm.Close()
                End Try

            ElseIf ConnToSLC = True And ConnToCLX = False Then

                BatchNumber = InputBox("Enter Batch Number: ", "Batch Number")

                Dim C As Integer
                C = 0

                Try

                    If BatchNumber <> "" Then
                        EthernetIPforPLCSLCMicroCom1.Write("ST10:0", BatchNumber)
                        EthernetIPforPLCSLCMicroCom1.Write("N7:40", inc + 1)
                    Else
                        MsgBox("You Did Not Enter A Batch Number!")
                        Exit Try
                    End If

                    ProgBarForm.Show()

                    For C = 0 To 39
                        ProgBarForm.ProgressLabel.Text = C + 1
                        ProgBarForm.ProgressBar1.PerformStep()
                        EthernetIPforPLCSLCMicroCom1.Write("N7:" & C + 41 & "", CInt(d(CodeLabels(C).Text)))
                        EthernetIPforPLCSLCMicroCom1.Write("F8:" & C + 41 & "", CSng(CodeValueLabels(C).Text))
                        System.Threading.Thread.Sleep(25)
                    Next

                    ProgBarForm.Close()

                Catch ex As Exception
                    MsgBox(ex)
                    ProgBarForm.Close()
                End Try

            End If

        Else
            MsgBox("Did not send program due to bad Opcode or Values! Please Try Again.")
        End If

    End Sub

Here is the code for enabling and disabling subscriptions, the Boolean variables are changed when a machine is selected and then runs this sub right after:
Code: [Select]
Sub ConnState()
        If ConnToCLX = False Then
            EthernetIPforCLXCom1.DisableSubscriptions = True
        ElseIf ConnToCLX = True Then
            EthernetIPforCLXCom1.DisableSubscriptions = False
        End If

        If ConnToSLC = False Then
            EthernetIPforPLCSLCMicroCom1.DisableSubscriptions = True
        ElseIf ConnToSLC = True Then
            EthernetIPforPLCSLCMicroCom1.DisableSubscriptions = True
        End If
    End Sub


Sending info to any 4 of the CLX works fine but once i send to the SCL the loop usually gets hung up around step 28 and at catch ex As Exception it says "Argument 'Prompt' cannot be converted to type string". Also at startup it continually throws "A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in AdvancedHMIDrivers.dll

Is there something wrong somewhere in my code or did I just find a fluke? Also sometime the code works for sending the info to the SLC but after the send my BasicLabels no longer updat themselves.

20
Open Discussion / Re: Cross Threading Error
« on: December 31, 2013, 08:52:46 AM »
I'm currently having a similar problem. My goal was when connection was established to make a label say "Connected to Machine 'A' (or B or C etc) depending on the IP address at the current time. Then when a Connection closed to make the same label read "No Connection".  But I got that same cross threading error.
I got around this by writing:
Control.CheckForIllegalCrossThreadCalls = False         in the mainform load sub
(this is bad practice I know)

Now when I cange an IP address my code works for about 5 seconds  and says "Connected" then connection is momentarily lost (changes to "No Connection") and then returned but my IPConnectionEstablished sub doesn't occur again to change the label back to "Connected", but I am communicating.

This problem is really quite the brain buster.

21
Support Questions / Re: Errors on VB 2013
« on: December 18, 2013, 07:57:12 PM »
Update: uninstalled 2013 and went with 2010.. ended up still getting lots of errors when I loaded in my code..

Turns out some of my references were wrong? I deleted the references with warnings then built my program again and it corrected itself.

So its possible 2013 could have worked..

22
Support Questions / Errors on VB 2013
« on: December 18, 2013, 05:00:27 PM »
hey archie I was building a program on my own personal computer using VB 2010 but now my company has supplied me with a company computer to build this project on, so I install VB 2013 express to continue my work, but now when opening my project in 2013 im getting these errors(in the attached picture). Any ideas? Can I use AdvancedHMI in 2013?

23
Support Questions / Testing Connection on form
« on: December 17, 2013, 07:36:29 PM »
So I'm using 1 driver to communicate with several IPs by just changing IP in the code and its working just fine but theres one problem. When I change the IP to a plc thats not even connected and try to send info to it there are no errors thrown. This could be a problem if an operator ever sends info to a PLC thats not connected. I'm using a CLXIP driver, is there a way that when I change IP address it will test if its successfully communicating?

24
Support Questions / Re: Array Question
« on: November 19, 2013, 08:25:05 PM »
Ok so turns out the tabindex wasn't the problem at all.

I used the Cint method and it still didn't work, but once I took out the line Else EndBox = 120 it worked. But only half way, now if I select END OF CYCLE the rest go invisible but when I change it to something else they stay invisible because EndBox's value hasn't changed

25
Support Questions / Re: Array Question
« on: November 19, 2013, 08:16:24 PM »
I think I'm going to try one of the first two. You lost me on that third one ha.

26
Support Questions / Re: Array Question
« on: November 19, 2013, 07:09:29 PM »
Yes I think so.

Right now my code is...
Code: [Select]
       Private Sub Visibility()

        For Each ControlOnForm As Control In Me.Controls
            If TypeOf ControlOnForm Is ComboBox Then
                If ControlOnForm.Text = "END OF CYCLE EVENT (G 192)" Then
                    EndBox = ControlOnForm.TabIndex
                Else
                    EndBox = 120
                End If
            End If
        Next

        For Each ControlOnForm As Control In Me.Controls
            If ControlOnForm.TabIndex > EndBox + 1 And ControlOnForm.TabIndex < 120 Then
                ControlOnForm.Visible = False
                If TypeOf ControlOnForm Is ComboBox Then
                    ControlOnForm.Text = "NULL OPCODE"
                ElseIf TypeOf ControlOnForm Is TextBox Then
                    ControlOnForm.Text = "0"
                End If
            End If
        Next


    End Sub


Basically if any Combo says END OF CYCLE EVENT all labels, combos, and textboxes after that one's row should go invisible.

I first tried using their tag numbers but since tags are an object and not an integer it worked sometimes but had some wackey results sometimes such as allowing just a couple combos that should have gone invisible to stay visible.

Now that I'm using tab index it doesn't seem to work at all because for some reason when one does equal END OF CYCLE EVENT  it doesnt change ENDBOX's value.

So instead of using tabindex or tag values I was wondering if an array of comboboxes and textboxes would be possible.



27
Support Questions / Array Question
« on: November 19, 2013, 04:25:05 PM »
Still working on figuring out VB code.. is it possible in VB 2010 to make an array of comboboxes and if so what would that look like code wise

28
Support Questions / Re: Driver Question
« on: November 14, 2013, 08:51:43 PM »
Got it.

Steps to fix this problem..

Right click on project in solution explorer
click properties
Then compile tab
then advanced compile options
change target CPU from any cpu to x86

and problem solved..

29
Support Questions / Re: Driver Question
« on: November 14, 2013, 08:22:33 PM »
Ok so I did that and now...

This was my code for connecting to my access data base and it was working but now that its being used with the advanced hmi stuff i get an error that says
 
"The Microsoft.ACE.OLEDB.12.0 provider is not register on the local machine"

Code: [Select]
        '' Sets value for dbProver, dbSource, And con.connectionstring
        Try
            dbProvider = "Provider=Microsoft.ACE.OLEDB.12.0;"
            dbSource = "Data Source = C:\Users\jessedmcneely\Documents\Access Databases\FurnacePrograms.accdb"
            con.ConnectionString = dbProvider & dbSource

            ''Opens connection to database
            con.Open()

            ''Selects all data from database
            sql = " SELECT * FROM FurnacePrograms"

            ''Set Da as new DataAdapter uses variale sql to sends to con
            Da = New OleDb.OleDbDataAdapter(sql, con)

            '' Fills the Dataset with the data from the database via DataAdapter
            Da.Fill(ds, "FurnacePrograms")

            ''Closes DataBase Connection
            con.Close()

            ''Counts rows in the dataset and sets MaxRows equal to the number of rows
            MaxRows = ds.Tables("FurnacePrograms").Rows.Count

            ''Sets inc equal to zero to load first program on startup
            inc = 0

            ''Calls Sub NavigateRecords
            NavigateRecords()

            ''If any of the previous steps could not be accomplished it will throw an error message
        Catch ex As Exception
            MsgBox(ex.Message)

        End Try

30
Support Questions / Driver Question
« on: November 14, 2013, 04:53:01 PM »
So I was just writing a test program in VB to get some things working before I wrote the program with all of the advanced HMI extras in the project.

Well, I pretty much finish the program and everything is working but instead of remaking the whole thing in a form with all the Advanced HMI extras, is there a way that I could just Import the driver for a Controllogix Ethernet.

And if so what would those steps be?

Pages: 1 [2] 3 4