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

Pages: 1 [2] 3
16
Support Questions / Re: EthernetIPForMicro800 Writing Bool to PLC
« on: November 30, 2015, 02:31:03 PM »
It seems like doing that would be easier in the long run. I'll see how I can change the boolean bits I have to binary. Thanks again for your help.

17
Support Questions / Re: EthernetIPForMicro800 Writing Bool to PLC
« on: November 30, 2015, 01:50:43 PM »
Thank you for answering so quickly. I used your suggestion and it caused a different kind of error, this time in the EthernetIPforCLX in the section where it writes to the DLL.

CIP Error - Unknown Code 255

Do you have any experience with this error since Visual Basic isn't very descriptive with what's going on?

Thanks again in advance for any help or advice 

18
Support Questions / EthernetIPForMicro800 Writing Bool to PLC
« on: November 30, 2015, 09:06:36 AM »
I've run into a problem recently where I am trying to write parameters for a run of a system into the PLC. When I'm writing actual numerical values everything works fine but I have some values that are Booleans. This is what I'm writing currently (and where I'm stuck):

 For count As Integer = 0 To index
            SegmentNumber = SegmentSetpoints(index, 1) 'if the segments are read out of order then use the segment # field to indicate placement

            Label1.Text = "Segment " & count & " is being downloaded."
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].number", SegmentSetpoints(index, 1))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].next", SegmentSetpoints(index, 2))
           * EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].loop", CInt(Int(SegmentSetpoints(index, 3).Equals("true"))))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].durationSec", SegmentSetpoints(index, 4))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].startTempSP", SegmentSetpoints(index, 5))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].endTempSP", SegmentSetpoints(index, 6))
            *EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].ramp", CInt(Int(SegmentSetpoints(index, 7).Equals("true"))))
            *EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].soak", CInt(Int(SegmentSetpoints(index, 8).Equals("true"))))
            *EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].lastSegment", CInt(Int(SegmentSetpoints(index, 9).Equals("true"))))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].aquisitionInterval", SegmentSetpoints(index, 10))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].TCHHalarmLevel", SegmentSetpoints(index, 11))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].TCLHalarmLevel", SegmentSetpoints(index, 12))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].TCHLalarmLevel", SegmentSetpoints(index, 13))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].TCLLalarmLevel", SegmentSetpoints(index, 14))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].RoomHHalarmLevel", SegmentSetpoints(index, 15))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].RoomLHalarmLevel", SegmentSetpoints(index, 16))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].RoomHLalarmLevel", SegmentSetpoints(index, 17))
            EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber & "].RoomLLalarmLevel", SegmentSetpoints(index, 18))

        Next
The asterisks are where my attempt is. I tried to convert the Boolean into an integer and write that but gives me an error: Object reference not set to an instance of an object.

Any advice for this would be great appreciated. 

19
Support Questions / Micro800 String Write
« on: October 07, 2015, 01:55:13 PM »
I am using an application I have written to build a Profile within a PLC to run a ramp soak chamber.  I have all the Cycles within SQL and I retrieve them and write them to the processor in a UTD.  Everything works splendidly except for when I write to a String.  Then I receive a strange error.
Public ProgramSelected(2) as String
.
.
.
(string value at time of test was "Test Program")
EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.programName", ProgramSelected(0))

Gives me the following error:

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

Additional information: Input string was not in a correct format.

The error points to line 681             DLL(MyDLLInstance).WriteTagValue(tag, StringVals, numberOfElements, SequenceNumber, MyObjectID)
within the EthernetIPforCLXCom.vb file even thogh I am using the EthernetIPformicro800Com object.
Thanks in Advance.

20
Could someone explain the data subscription and how I would do the periodic update of this data in the background.

21
I guess the first step is to create the structures and I will do so using the following format which archie  explained was correct...

//page 2.vb
Public Class Page2
    Structure Alarm
        Public desc As String
        Public inCond As String
        Public active As String
        Public ack As String
        Public month As String
        Public day As String
        Public hour As String
        Public min As String
        Public sec As String
    End Structure

    Dim Alarms(32) As Alarm

22
Support Questions / Re: Unstable environment
« on: January 22, 2015, 02:30:20 PM »
Moved this discussion to "Large Data Read and write blocks for data heavy pages"

23
As you can see in the previous post there are errors in the reading.  All the alarm blocks are identical with updated registers (tedious process.)

When I would create this type of project on a Rockwell panel for example, I would pass parameters.  There would be a text object with a bunch of variables inserted to it with a #1 located in the instance portion of the alarm.  This would net me a custom object that is tied to whatever registers the parameter passed to it would indicate the instance needed. 

I would prefer this because It allows the future scalability to be infinite.

When using logix5000 it is even easier because I have a array of alarm user defined data type that I can place the instance into in the same fashion.

The first problem is that I need to place the data into a udt located in the HMI so I can do manipulation.  The second problem is not hogging the bandwidth by streamlining the read process.

24
Support Questions / Large Data Read and write blocks for data heavy pages
« on: January 22, 2015, 01:58:42 PM »
What I am creating is a page 2 with a bunch of alarms.
Each block has 10 registers involved.
1 is a string
1 is an integer that houses a bit array.
6 are preset and time stamp integers.

st31:0 would be the description for alarm 0
n100 would be the integer file associated with alarm 0

st31:31 would be the description for alarm 0
n131 would be the integer file associated with alarm 0

I would like to create a more efficient read because the page does not work if I simply use all BasicLabels.  It does not update as shown in the capture.

I want to provide a how-to.. to help others as well so I started this topic for that purpose since my recent questions were out of an old thread and not an easy to search item.

25
Support Questions / Re: Unstable environment
« on: January 15, 2015, 02:41:49 PM »
So I took a step back and gave up on that part.

I am trying the baby step approach now but I am having nothing but errors.  Am I incorrect in assuming that I can place a string variable in the PLCaddressValue field of a basic label and use a variable that was defined somewhere in the code?  I have tried to do so but I keep getting errors relating to me not declaring the variable.  I guess I need to know where is the correct place and where can I assign it.  I have tried in the designer and in the design window.  Both got me nothing but errors.

26
Support Questions / Re: Unstable environment
« on: January 15, 2015, 01:51:14 PM »
I am confused.  I tried what you said above and I cannot get that working.
//where plcAddress is the address of the register in string form

Me.Label1.Text = "Month: " & Alarms(0).month //i get the error Error   11   Operator '&' is not defined for types 'String' and '1-dimensional array of String'.   

//page 2.vb
Public Class Page2
    Structure Alarm
        Public desc() As String
        Public inCond() As String
        Public active() As String
        Public ack() As String
        Public month() As String
        Public day() As String
        Public hour() As String
        Public min() As String
        Public sec() As String
    End Structure

    Dim Alarms(32) As Alarm
    Dim plcAddress As String
    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '*******************************************************************************
    Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        If components IsNot Nothing Then
            Dim drv As AdvancedHMIDrivers.IComComponent
            '*****************************
            '* Search for comm components
            '*****************************
            For i As Integer = 0 To components.Components.Count - 1
                If components.Components(i).GetType.GetInterface("AdvancedHMIDrivers.IComComponent") IsNot Nothing Then
                    drv = components.Components.Item(i)
                    '* Stop/Start polling based on form visibility
                    drv.DisableSubscriptions = Not Me.Visible
                End If
            Next
            For x As Integer = 0 To Alarms.Length
                plcAddress = "ST31:" & x.ToString
                Alarms(x).desc = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":0/0"
                Alarms(x).inCond = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":0/1"
                Alarms(x).active = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":0/3"
                Alarms(x).ack = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":2"
                Alarms(x).month = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":3"
                Alarms(x).day = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":4"
                Alarms(x).hour = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":5"
                Alarms(x).min = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
                plcAddress = "N1" & x.ToString("D2") & ":6"
                Alarms(x).sec = EthernetIPforPLCSLCMicroCom1.Read(plcAddress, 1)
            Next
        End If
    End Sub


    Private Sub ReturnToMainButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MainForm.Show()
        Me.Hide()
    End Sub

    Private Sub Page2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

End Class

After is tried that I thought about skipping the structure step and creating the array of addresses and just using the label to read them and display but this was what I got from that

Me.Label1.Text = "Month: " & Me.Read(plcAddress)  //i get the error Error   11   'Read' is not a member of 'MfgControl.AdvancedHMI.Page2'.

//where Alarms(32) is a structure of strings and month is one of those

I guess I should be starting a new thread but...

27
Support Questions / Re: Unstable environment
« on: January 15, 2015, 01:11:52 PM »
I created a structure that is basically an array of string types and have the code written to fill them with the variables.  I now need to know how to actually view them in the form.  I tried a few different objects but I am unsure how to incorporate a variable into the display other than one of the PLC address tags.  Does this make any sense?  Maybe I am just overlooking something.


28
Support Questions / Re: Unstable environment
« on: January 13, 2015, 03:55:08 PM »
I am getting somewhere finally.  I just used the plc and the Ethernet driver.  I was wondering if you could enlighten me about the parameter passing capability or the best way to approach this.  Essentially I need to have the group to pass a variable to concatenate to the tag.

within the group xx

tag 1 = n1xx:0
tag 2 = n1xx:1


29
Support Questions / Re: Unstable environment
« on: January 13, 2015, 02:13:36 PM »
I do not really need it for anything more than test.  I will try the plc. I have a few downstairs on some equipment being assembled.  I will see if I have better results for the time being.  I do make a lot of projects via the emulator.  I suppose that I could use rslinx.  I just had no clue how to get into that since I didn't know what the server name was and where to find the name of it on the pc.  I fiddled with it but gave up because I saw that using the df1 with emulator looked easy.

30
Support Questions / Re: Unstable environment
« on: January 13, 2015, 01:56:28 PM »
Currently I am using v396 with the df1comm driver because I am emulating for the current development.  I am just placing the plc in a basic label for now.

I saw that there was a new release.  I would grab that and use it but once again my unfamiliarity with studio leaves me unsure.

I do not know what I would need to copy to allow me to continue with the work I have started.  I downloaded the basic label manual but it didn't help me with the problem because it seems to be a comm driver issue?  I am simply using built in commands for the first project.  It is a simple mode selection screen with pid input values.  There is a button to open form 2 which is the alarm screen. 

I need to show a string value for each alarm, and the associated value and status bits.  I will make a grouped object with all the info and then copy the object.  I would like to be able to pass a parameter to each one instead of updating 10 tags for each object since the structure in the plc is the same for all with a different start register.  I have not gotten past the string!  The string will display on page 1 but page two ...no dice.

example alarm 0 (alarm xx would be st31:xx, and data starts at n1xx:0)
st30:0 = alarm 1 information
n100:0/0 = input condition
n100:0/1 = alarm timeout
n100:0/3 = alarm acknowledged
n100:2 = alarm time month
n100:3 = alarm time day
n100:4 = alarm time hour
n100:5 = alarm time min
n100:6 = alarm time sec

Pages: 1 [2] 3