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
31
Open Discussion / Re: Not able to read R6:0 registers on SLC?
« on: November 14, 2013, 04:39:38 PM »
Try a MOV instruction, move the value for your position into an N file and then read that value in your HMI

32
Support Questions / Storing Info
« on: October 23, 2013, 10:28:50 AM »
Hey Archie, I have a database built in Microsoft sql and I have linked the table to my data-source, and so on etc. But here is my question I have a combo box with items added from the dictionary that sends its value to my clx and I would like to store what the last item was in there when the user clicks save, do u possibly know the code to say save combo box selected item in this row and column, I've tried a few things I've found researching databases but I can't get any to work.

33
Support Questions / IP Address change in code?
« on: October 22, 2013, 10:23:35 AM »
Ok so I'm building a pretty large program and im almost done the only thing is in the future I may want to add more CLX to my program ( so it might be interacting with as many as 5 plcs at a time) I have a lot of code written to write to my ethernetdriver so i was wondering instead of adding more drivers and copying alot of the code, is there a piece of code that I could write to change my drivers ip address.  Like if I were to have a combo box or list box with the 5 plcs listed on it and depending on which was selected it wrote a certain IP address to that driver?

34
Support Questions / Re: Using Standard VB objects with HMI
« on: September 17, 2013, 10:45:52 AM »
Ended up not using that code to disable text boxes and I got my program working for the most part except now when I run it the first time I put in values and send to CLX and it works fine, though if I try to change anything and send a new set of values I get an error in your code from the CLXethernet driver code


           SyncLock (ReadLock)
            DLL(MyDLLInstance).WriteTagValue(tag, StringVals, 1, TNS)
        End SyncLock


There Error I get here says Send que full, may have lost connection or data request too fast.

Any idea why I would be getting that?

35
Support Questions / Re: Using Standard VB objects with HMI
« on: September 16, 2013, 09:36:59 AM »
So I used your code except changed one thing:

If ControlOnForm.Text <> "" AndAlso d(ControlOnForm.Text) = 0 Then
If ControlOnForm.Text <> "" AndAlso d(ControlOnForm.Text) = 8 Then (only changed the 0 to 8)

the 8 is for  End of Cycle Event  but now that I did that say I make the 5th combobox an end of cycle event i get an error on the sixth for "The given key was not present in the dictionary." The error is always on the combobox after the End of Cycle Event one.

36
Support Questions / Re: Using Standard VB objects with HMI
« on: September 13, 2013, 02:28:06 PM »
So I decided to go with the dictionary way. It works really well and saved me a lot of code, although there's still something I'm not sure how to do now. Sorry this VB has really been a learning curve for me. But if the operator/user ever selects NULL OPCODE in a combobox that will be the last step and after that the rest of the comboboxes and text boxes will just be blank and i plan for their visibility to go false and the N and F files that they're linked to, to receive values of zero. How would I go about that? I tried if statements for the visibility but then the blank combos only go invisible if you try to change the index.

37
Support Questions / Re: Using Standard VB objects with HMI
« on: September 12, 2013, 08:42:13 PM »
Thank you, took me a little bit of research to see what you're doing there but I figured it out, that will probably work though 2 of my items are actually going to have numbers in parenthesis already but I don't think it would cause a problem, is there possibly another solution though?

38
Support Questions / Re: Using Standard VB objects with HMI
« on: September 12, 2013, 04:29:10 PM »
I apologize in advance for asking so many questions, but as i said I'm new at VB programing.

Heres the deal: in the image I attached to this there are 40 comboboxes and 40 text boxes and each line represents a step so there for instance line 1 has a label step one then a combobox then a text box, so 40 lines, in each text box there will be 13 items (heat, soak, ramp, .. etc.) dependend on what step it is and on what item was selected it is going to send a value 1-13 (heat= 1, soak = 2, ramp = 3, etc.) to an N file N20[0] through N20[39] (step 1 = n20[0], step 2= n20[1], etc.).

And on top of that the value of the text box will be sent to a F file corresponding to it's step so (step 1 textbox.text = F21[0], and so on..)

Once the operator has entered in all of these items and values they will click the send to PLC button. Now I wrote a piece of code to test it and it worked with an If statement.

That code is only for the first step and there are 40 and doing this with an if statement just seems like the wrong way of doing it to me because its going to be so long and messy. So I was wondering if you could put me on the right track of writing this code if you know of a better way?

Thanks.

Private Sub btnPLC_Click(sender As System.Object, e As System.EventArgs) Handles btnPLC.Click

        If OpCodeBox1.Text = "HEAT" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 1)
        ElseIf OpCodeBox1.Text = "CARBON" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 2)
        ElseIf OpCodeBox1.Text = "NULL OPCODE" Then
            EthernetIPforCLXCom1.Write("F21[0]", 0)
            EthernetIPforCLXCom1.Write("N20[0]", 0)
        ElseIf OpCodeBox1.Text = "RAMP" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 3)
        ElseIf OpCodeBox1.Text = "SOAK" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 4)
        ElseIf OpCodeBox1.Text = "TEMP LIMIT TIME" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 5)
        ElseIf OpCodeBox1.Text = "CARBON LIMIT TIME" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 6)
        ElseIf OpCodeBox1.Text = "AMMONIA EVEN" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 7)
        ElseIf OpCodeBox1.Text = "END OF CYCLE EVENT" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 8)
        ElseIf OpCodeBox1.Text = "SPARE EVENT" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 9)
        ElseIf OpCodeBox1.Text = "PROBE BURNOFF EVEN" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 10)
        ElseIf OpCodeBox1.Text = "TEMP DEVIATION" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 11)
        ElseIf OpCodeBox1.Text = "CARBON DEVIATION" Then
            EthernetIPforCLXCom1.Write("F21[0]", OpText1.Text)
            EthernetIPforCLXCom1.Write("N20[0]", 12)
        End If
    End Sub

39
Support Questions / Re: Using Standard VB objects with HMI
« on: September 11, 2013, 04:16:26 PM »
Works just like I was hoping for, Thank you! you made a great program!

40
Support Questions / Re: Using Standard VB objects with HMI
« on: September 11, 2013, 03:34:53 PM »
or instead of a plcaddressheat option could you should me the code that would be like..

If Combobox1.text = "heat" Then


       TextBox1.Visible = True
      ' here is the part I don't know how to do (sending a value to slc/clx)
 Else
       TextBox1.Visible = False
       '........

End If

41
Support Questions / Re: Using Standard VB objects with HMI
« on: September 11, 2013, 02:06:30 PM »
If the operator selects the item heat I will need the textbox to pop up where operator will enter a number it will then write that value to an N file
at the same time when heat is selected it needs to also write a 3 to another N file

The 3 will be a constant it will never change.



42
Support Questions / Re: Using Standard VB objects with HMI
« on: September 11, 2013, 12:54:05 PM »
Ok so I have my Combobox made and I have a 3 "items" in it. I used the code from a basic label for it and in the properties its has PLCaddress, value, keypad etc.
Now all my experience is with PLCs I have barley any with structured text. My 3 Items are Heat, Soak, and Carbon. If you could show me the code that would give me a properties option of PLCaddressHeat I think I could figure out the rest.
 
Thanks.

43
Support Questions / Using Standard VB objects with HMI
« on: September 11, 2013, 09:29:31 AM »
Is it possible to use a standard combo box and have it send values to different locations such as different N files depending on what option the operator selects, and I'm pretty new to coding so if it is what would that look like?

44
Support Questions / Re: CLXEthernet Driver trouble
« on: August 28, 2013, 04:30:29 PM »
I actually had my timers in my program not controller..

Also made a small application and tried loading it to another computer like you did in your video, didn't work is the other computer going to have to have Visual studio on it?

45
Support Questions / Re: CLXEthernet Driver trouble
« on: August 27, 2013, 06:46:56 PM »
ok so... my windows xp desktop with vs 2010 refuses to communicate with the card, on the card the link lite doesn't even come on. However with my windows 7 laptop it communicates just fine, All of the TCP settings are the same on each, which is kind of a problem because the laptop is mine and the desktop is the companies, but I will just have to deal I guess.

But now this raises another question. This is my first CLX project, how am I going to address my bits, timers, and etc.? I got my basic descrete stuff working with with tag names like PV_n7[0] but I cant seem to get timer values so if i have a timer tag name timer i put in timer.ACC in plc value on panel meter and it doesn't seem to work.

Pages: 1 2 [3] 4