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

Pages: [1] 2
1
Open Discussion / Re: Commercial Software
« on: August 29, 2014, 02:18:30 PM »
The suitability is something you'll probably have to judge for yourself. There are really too many unknown variables on your end for anyone else to answer: The most important being "How solid is your programmer?"  All that I can say for certain is that I wrote an interface for one of our machines that we use on a daily basis. There was an issue with communication to begin with, but I rewrote part of the library and have never had a single problem since. You should be able to look through my comment history to see the code I changed and the length of time that the machine has been running trouble free.

2
Support Questions / Re: Modbus/TCP ?'s
« on: April 12, 2013, 02:26:03 PM »
I've not used the modbus driver so I couldn't help with the double, but you can retrieve a memory location programmatically using
Code: [Select]
ReadAny(startAddress, numberOfAddresses) through the driver instance.

As an example in my own usage I'm getting 50 addresses starting at addr from an instance of EthernetIPforCLXComm driver named plc_clx
Code: [Select]
profile_points1 = plc_clx.ReadAny(addr, 50)

3
Support Questions / Re: Connections to a SLC 5/01 DH485
« on: April 12, 2013, 02:19:11 PM »
Using the UIC & RSLinx OPC server works wonderfully to communicate with a SLC5/01

4
Support Questions / Re: Connections to a SLC 5/01 DH485
« on: April 12, 2013, 12:13:38 PM »
The UIC-1747 arrived yesterday so I spent a couple of hours & I tried a few things but was also not able to make it work. It will obviously need some driver changes to work directly with DF1 over USB. However, I'm getting ready to look into OPC - which I know nothing at about having just stumbled across it's existence while trying to get it to work with DF1 yesterday.

If there is any willing advice out there on using an OPC interface I'd sure like to hear it! Especially if the advice is "Don't"

5
Support Questions / Re: Connections to a SLC 5/01 DH485
« on: April 04, 2013, 07:18:40 AM »
We've ordered a UIC that should be here soon. I'll update once we've gotten it & had some time to play around.

6
Support Questions / Connections to a SLC 5/01 DH485
« on: March 21, 2013, 08:06:56 AM »
I'm curious if AdvancedHMI has ever been used to communicate with a SLC 5/01 with only a DH485 port? If so, which adapters - PIC or UIC or both?

7
I had a little more time to look at this today. I'm not in any way, shape, or form saying that this is a solution - just that it reinforces the initial diagnosis.

I changed the ReadyAny() prototype declaration in ICommComponent and the function in EthernetIPforCLXComm (as well as in every other driver class that uses the inheritance) to take an optional boolean parameter to mask out external calls to the function:
Code: [Select]
    Function ReadAny(ByVal startAddress As String, ByVal numberOfElements As Integer, Optional ByVal externalCall As Boolean = False) As String()
Then I added the " And Not externalCall" to the if then/else block in ReadAny() in EthernetIPforCLXComm that contains the returns:
Code: [Select]
If PLCAddressByTNS(SequenceNumber And 255).AsyncMode And Not externalCall Then
Finally, I changed my calls in the form to include the added externalCall parameter.
Code: [Select]
feedback_points1 = plc_clx.ReadAny(addr1, 50, True)
After making these changes I have yet to be able to cause the bug to occur after 200+ button presses.

I have not seen any negative or unintended consequences yet, but it is presumed that there are going to be some.

Again, I'm not saying this is a solution or even a band-aid.

8
I figured I would show some of the logging that I did to demonstrate:

A successful read. Address Program:HEAD_2.PARISON_FB[0] is the manually called ReadAny() delivering 50 members each in 2 calls in the midst of the AsyncMode results of the components.
Code: [Select]
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress ESTOP_OK, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 114
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:HEAD_2.PARISON_FB[0], numberOfElements 50) while loop: ActiveRequest True, Delays 1
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:HEAD_2.PARISON_FB[0], numberOfElements 50) while loop: ActiveRequest True, Delays 2
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress LAST_CYCLE_TIME, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 115
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:HEAD_2.PARISON_FB[0], numberOfElements 50) SequenceNumber 116, returning d{19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,22,22,22,22,23,23,24,24,24,25,25,25,26,26,26,26,27,27,27,27,27,28,27,27,27,27,27,26,26,26,25,25,25,24}
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:ACCUM_1.CUSHION_KEYIN, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 118
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:HEAD_2.PARISON_FB[50], numberOfElements 50) SequenceNumber 119, returning d{24,24,24,23,23,23,23,22,22,22,22,22,22,21,21,21,21,21,20,20,20,20,20,20,20,20,20,20,20,20,20,19,20,20,20,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20}
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:ACCUM_1.SHOT_SIZE_KEYIN, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 120

In a bugged call to ReadyAny() it is returning as if it is also AsyncMode. This time it is for Program:HEAD_3.PARISON_CPT[0]
Code: [Select]
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress SAFETY_GUARDS_CLOSED, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 127
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress CUSHION, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 128
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress Program:HEAD_3.PARISON_CPT[0], numberOfElements 50) SyncLock: AsyncMode, SequenceNumber 129
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress EMPTY, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 131
10:19:06 AM Wednesday, March 20, 2013  :DRVR: ReadAny(startAddress ESTOP_OK, numberOfElements 1) SyncLock: AsyncMode, SequenceNumber 132

It's the same line of code in the form making both of these calls:
Code: [Select]
                    Dim profile_points1(50) As String   'read times out trying to pull all 100 points in one shot
                    Dim profile_points2(50) As String   'so break it into 2 separate arrays & calls

                    Dim addr1 As String = "Program:HEAD_" & (currentHead + 1) & ".PARISON_CPT[0]"
                    Dim addr2 As String = "Program:HEAD_" & (currentHead + 1) & ".PARISON_CPT[50]"

                    profile_points1 = plc_clx.ReadAny(addr1, 50)

Just now I notice that the unsuccessful call did not go through the delay loop, either.

9
I can reproduce it readily. I believe it's a case of having components on the form that are polling at regular intervals and a ReadAny() in code that can be triggered at unpredictable times in relation to the component's polling. In my case anyway. I loaded up the driver with logging an can positively say that I am getting the SequenceNumber returned. The only case that I can see where this can happen is if AsyncMode is true. From what I've seen is that the bug only manifests when the ReadyAny() occurs while the components are updating. I would say then that the more components and more programmatic ReadAny() calls the more likely the bug is to manifest.

The particulars of my project are that there are 6 BasicLabels & 7 BasicIndicators on the form. There are also 2 conditions that will call ReadAny(). One instance is cyclic and event-driven. Every time one of the BasicLabels changes from off to on it will read an 100 member array from the PLC. This condition very rarely will awaken the bug. The second condition is when one of 4 buttons is pushed. This will read 2 separate 100 member arrays. It is at this point that the bug is most commonly seen. I can push the buttons repeatedly around 2x per second to make this happen and it has never taken more than 20 button presses.

I'll reiterate that I'm not at a point where I have any real understanding of the code. VB is definitely not my first language and PLC communication protocols are something that I'm very in the dark about - especially AB/Rockwell. For these reasons I don't want to make any presumptions on any solution proposals. I will, however, ask if there is a preferred way to separate out the usages/properties of AsyncMode and/or to have 2 distinct procedures?

10
I'd be happy to test 3.27 for you and/or send you a project that will allow reproduction of the bug.

11
After getting some time to look deeper into the issue I had posted about in the Support Questions category it appears that sometimes the driver returns the SequenceNumber from ReadyAny() rather than the expected array of strings. It must be misinterpreting AsyncMode to make this happen. I believe this is the same issue as discussed at http://sourceforge.net/projects/advancedhmi/forums/forum/875091/topic/6729354 and I am using the 3.26 beta.

I'm not yet familiar enough with the code to fully understand how AsyncMode is being used, among other things. It looks like the driver's AsyncMode property is temporarily set to True in PollUpdate() so I'm guessing that it's possible that the ReadAny() call that I'm making is sometimes corresponding to this brief period while components on the form are updating. This wouldn't explain why once the bug manifests it is persistent, though.

Any insight, advice, or suggestions?

12
Support Questions / Re: Issues with ControlLogix communications
« on: March 14, 2013, 06:20:29 PM »
Any thoughts on what I should look for?

13
Feature Request / Re: Component event hooks
« on: March 14, 2013, 01:08:50 PM »
Well I took about 10 minutes to both read up on event handling in VB as well as add "Event Option2ChangeState(ByVal state As String)" & "RaiseEvent Option2ChangeState(Values(0))" to BasicIndicator.vb so I suppose I jumped the gun making this a feature request!

14
Application Showcase / Extruder Profile Programmer
« on: March 14, 2013, 06:15:21 AM »
4 heads, 100 profile points & 100 feedback points, 10 master points + end points, linear interpolation

ProFace touch panel connected to ControlLogix PLC

I really want to thank you, Archie! Next we're planning to add communications to a SLC that controls the base machine functions.

15
Support Questions / Re: Issues with ControlLogix communications
« on: March 13, 2013, 10:52:59 AM »
Having a little trouble getting the forum to load this morning!

I thought I should specify: even when ReadAny() is failing the components on the form (BasicLabels, BasicIndicators) still function properly.

The code inside a try/catch:

Code: [Select]

                    Dim profile_points1(50) As String   'read times out trying to pull all 100 points in one shot
                    Dim profile_points2(50) As String   'so break it into 2 separate arrays & calls

                    'ListBox1.Items.Clear()

                    profile_points1 = plc_clx.ReadAny("Program:HEAD_" & (currentHead + 1) & ".PARISON_CPT[0]", 50)

                    Dim i As Integer = 0

                    If validateReturnedArray(profile_points1) Then
                        For i = 0 To 49
                            currentProfilePoints(i) = profile_points1(i)
                            'ListBox1.Items.Add(i & ":" & profile_points1(i))
                        Next

                        profile_points2 = plc_clx.ReadAny("Program:HEAD_" & (currentHead + 1) & ".PARISON_CPT[50]", 50)

                        If validateReturnedArray(profile_points2) Then
                            comAttemptCount = 0
                            For i = 0 To 49
                                currentProfilePoints(i + 50) = profile_points2(i)
                                ' ListBox1.Items.Add((i + 50) & ":" & profile_points2(i))
                            Next
                        Else
                            comAttemptCount = comAttemptCount + 1
                            MessageBox.Show(errMsg, "bad array caught in profile loop 2. (" & comAttemptCount & ")")
                            'resetCom()
                            readParsionValues()
                        End If
                    Else
                        comAttemptCount = comAttemptCount + 1
                        MessageBox.Show(errMsg, "bad array caught in profile loop 1. (" & comAttemptCount & ")")
                        'resetCom()
                        readParsionValues()
                    End If
                    comFaultCount = 0

Pages: [1] 2