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

Pages: [1] 2
1
I have been able to build a lab test with a spare PLC I found.  I cannot replicate the problem.  This leads me to suspect it's a network load issue, as the real-world application also has several VFDs, 2 barcode scanners, a robot, and an HMI all eating up Ethernet/IP bandwidth.  The PLC is almost maxed out on allowed E/IP connections.


2
I am currently using v3.97d, EthernetIPforCLXCom driver.  My application acts as a data server between a CompactLogix PLC and a SQL Express database.  The application has about 25 data subscribers, each of which listens for a boolean PLC tag.  The DataChanged event handler has the following typical format:

    * Read one or more PLC tags
    * Execute a SQL stored procedure
    * Write the returned results to PLC tags

The PLC tags are fields of a UDT, mostly INT and BOOL data types, although there are one or two STRING typed tags.

This application has been working well for around four years now, but there is one nagging issue that has recently hit the customer's radar:  when the PC is rebooted, and the data server application starts, the first DataChanged event of each subscription fails with an exception.  Second and subsequent events work just fine.

Unfortunately I do not have the exact exception data, but if memory serves it is a conversion error, and there is nothing that points to where in the code it happens.

I am verifying that I have an established connection with the PLC before processing subscription data--by this I mean that when I handle the ConnectionEstablished event, I am starting a heartbeat timer with the PLC.  The PLC will not initiate any "triggers" until the app reports it is connected and the heartbeat timer is active.

Also, when an error happens, I write an error code to the PLC, and it successfully receives this tag write.

I have updated the application to v3.99x, and simplified it quite a bit.  I now use one DataSubscriber2, add all the tags I need to listen for, and in the event handler I branch with a select statement based on the PLC address.  However, I am currently off site and cannot test.

My questions are:

1)  Are there any known issues in v3.97d that could cause the described behavior?
2)  My poll rate is set to 500ms.  I don't really want to make it too long, as the app needs to have a fairly quick response time.  Could poll rate be a contributing factor?
3)  Is there a better way to listen for my trigger tags, or to read/write the additional tags when a trigger is being handled?

Thanks,
Scott


3
Tips & Tricks / Re: Basic Database Tutorial
« on: November 21, 2016, 09:34:57 AM »
I have used both MS SQL and SQL Lite on different projects, and here's my short pros/cons list:

SQLite
Pros:  easy to install and deploy; great for small/simple databases; single data file
Cons:  no stored procedures; requires additional library reference for .NET; requires third-party software for db admin (but several good ones are available for free)

MS SQL
Pros:  better for complex/large databases; stored procedures mean less database-specific code in the .NET project; integrated admin tool
Cons:  setup and deployment can be messy and confusing

When I need to interface with a database, my decision usually boils down to whether or not I need stored procedures.

Scott

4
Support Questions / Update existing project from 397e to 398t
« on: August 13, 2015, 07:01:13 AM »
I have an existing project running version 397e, talking to a CompactLogix processor.  I am considering updating to the latest version, but have a couple of questions:

1)  I am using VC 2010 Pro for development.  Is the newest AHMI version compatible or would I have to get the latest VS Express?
2)  Can anyone provide a brief list of new features?  I saw a post about comm loss recovery, and that sounds like something my project could benefit from.
3)  My project is pretty big, lots of programmed subscribers and a large chunk of code to interface with a SQL database.  Is there an easy way to point my project to the 398t libraries, rather than importing my project code to the sample project?

Thanks,
Scott

5
I have had great success in a couple of apps using GemBox to write data to Excel from .NET.  The software is free (with some limitations, a paid version is available but for my needs I have had no issues).  It does not require Excel to be installed on the system, and as such does not use MS Excel's automation object model.  The interface is also much cleaner, and the web site has excellent samples to get you up and going.

http://www.gemboxsoftware.com/spreadsheet/overview

Scott

6
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 27, 2015, 01:29:04 PM »
Changed my sleep time to 10ms, down to 17 seconds.  That I can live with.

7
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 27, 2015, 01:26:30 PM »
I gave up for the time being on writing string arrays, and insterad am writing them individually as follows:

Code: [Select]
                For i As Integer = 0 To ss.Timestamp.GetUpperBound(0)
                    frmMain_EIPCLX.Write("SystemStatus_TimeStamp[" & i + 1 & "]", ss.Timestamp(i))
                    System.Threading.Thread.Sleep(100)
                Next

The drawback is that it takes about 45 seconds for all the writes to complete.  Granted there's a good bit of data being sent, but I'd like to make it faster.  First place to start obviously is my Sleep(100) statement.

Ultimately I'd like to get the array writes to work, but I've got something functional now.

Thanks,
Scott

8
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 27, 2015, 12:00:33 PM »
Okay, I'm making some headway, but have run into another issue, this time with string arrays.  I put the following code in a background worker thread:

Code: [Select]
                ' barcode
                range_str = ss.Barcode.Take(40).ToArray
                frmMain_EIPCLX.Write("SystemStatus_Barcode[1]", 40, range_str)
                System.Threading.Thread.Sleep(5000)

                range_str = ss.Barcode.Skip(40).Take(40).ToArray
                frmMain_EIPCLX.Write("SystemStatus_Barcode[41]", 40, range_str)
                System.Threading.Thread.Sleep(5000)

                range_str = ss.Barcode.Skip(80).Take(25).ToArray
                frmMain_EIPCLX.Write("SystemStatus_Barcode[81]", 25, range_str)
                System.Threading.Thread.Sleep(5000)

The above works without any problems on several DINT arrays (Int32 in VB), but I'm getting index out of bounds errors on the string arrays.  I have verified that all the arrays are dimensioned the same (105 elements in VB and 106 in the PLC--PLC index 0 is not used).

Here is the stack trace of the exception:

   at MfgControl.AdvancedHMI.Drivers.CIP.ForwardOpen(Int32 sendSequence)
   at MfgControl.AdvancedHMI.Drivers.CIP.WriteTagValue(CLXAddress tag, String[] value, Int32 numberOfElements, Int32 sequenceNumber, Int64 OwnerObjectID)
   at AdvancedHMIDrivers.EthernetIPforCLXCom.Write(String startAddress, Int32 numberOfElements, String[] dataToWrite) in C:\Amtec\jobs\_C00645 - TOTO Robotic Storage and Retrieval System\Controls\Programs\AdvancedHMI\AdvancedHMIBetaV397c\AdvancedHMIDrivers\AllenBradley\EthernetIPforCLXCom.vb:line 548
   at TOTO_DataServer.frmMain.GetSystemStatus_DoWork(Object sender, DoWorkEventArgs e) in C:\Amtec\jobs\_C00645 - TOTO Robotic Storage and Retrieval System\Controls\Programs\VB.NET\TOTO_DataServer\TOTO_DataServer\frmMain.vb:line 906




9
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 26, 2015, 03:59:48 PM »
I think I've narrowed down my problem somewhat.  The issue is not that the driver is not writing to the array.  The issue is that the driver is taking a *long* time to write to the array.  If I change my code from this:

Code: [Select]
mEIPCLX.Write("DINTArray[0]", VBArray)

(where DINTArray and VBArray both have 105 elements) to this:

Code: [Select]
mEIPCLX.Write("DINTArray[0]", 10, VBArray)

my problems magically disappear.

So it looks like to maintain app responsiveness and avoid latency issues (for lack of a better term), I'll need to multiplex my array writes.

10
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 26, 2015, 02:04:37 PM »
Here's my workaround, but I'm afraid it may be wasteful of network bandwidth:

Code: [Select]
For i as Integer = 0 to VBArray.GetUpperBound(0)
  mEIPCLX.Write("DINTArray[" & i & "]", VBArray[i])
Next

I have about ten separate arrays that need to be written to inside that for loop, and each one contains roughly 100 elements.  But I have verified all the data appears in the PLC when I do that.  And to make things worse, I need to execute this code repeatedly, at a frequency of once per second ideally.  As for data types, there will be several DINT arrays, a couple of BOOL arrays, and several STRING arrays.

Oh, and one more piece of info.  I mentioned I was using the UDT patch--I have tried reverting to the unmodified 3.97d DLL file as well, and the problem still happens, so it's not anything the patch introduced.

11
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 26, 2015, 01:56:03 PM »
That had no effect.  But I do notice that when the exception hits, my application code is on the line *after* the write, but the data did not get written to the PLC.  Stepping through the code, the actual write routine executes with no visible errors (I am stepping over the Write() routine).

12
Support Questions / Re: EthernetIPforCLX - writing to arrays?
« on: January 26, 2015, 01:40:17 PM »
More info:  I added a call to GetTagInformation, and tried the tag name with and without the "
  • " appended.  Both times I get the following result in the CLXTag object:


AbbreviatedType = 196
ArrayElements = 0
BitNumber = -1
Instance = 0
TagName = "SYSTEMSTATUS_TOTALCOUNT"

I am running with version 3.97d plus the patch Archie provided for UDT array access.

13
Support Questions / EthernetIPforCLX - writing to arrays?
« on: January 26, 2015, 01:33:30 PM »
I have been trying to write values in an array out to an array in the PLC, with little success.  Here is what I have tried so far:

Code: [Select]
mEIPCLX.Write("DINTArray",100,VBarray)
mEIPCLX.Write("DINTArray[0]",100,VBarray)
mEIPCLX.Write("DINTArray,VBArray)
mEIPCLX.Write("DINTArray[0],VBArray)

Each time I get a "no response from PLC getting tag information" error.

I can write a single value from the VB array to any single element of the PLC array with no issue.

14
Support Questions / Re: EthernetIPforCLXCom and Nested UDTs
« on: January 22, 2015, 10:32:26 PM »
Any time frame yet on when that feature might be added?  So far I'm loving your software, so I'm certainly not complaining, but that would definitely be useful.

I have the luxury of reworking the PLC data structures however I want, so I can set it up to have an individual UDT-typed tag per command.  I would still like to use nested UDTs though, so would I be able to have a tag reference that looks like this:  DBCommand.O.Trigger, where DBCommand is a UDT that contains another UDT O, which in turn contains (a DINT or BOOL) field Trigger?

In the scenario above I would set up a data subscriber on the trigger tag, and in the data changed event I would read any other required data (other fields in the O sub-structure).  After the database returns the requested data I would write to one or more fields in the I sub-structure.

There is one other situation where I will be getting a fairly large amount of data from the database.  My original plan was again to use an array of UDTs.  I can restructure the data so that I populate an array for each column of data.  What data types are supported for array read/writes?  I have seen some posts that mention only integer types are supported, but that may have been for earlier versions?  I will have a mix of DINT, REAL, STRING, and BOOL arrays in this data.

Thanks,
Scott

15
Support Questions / Re: EthernetIPforCLXCom and Nested UDTs
« on: January 22, 2015, 05:56:22 PM »
Some more info:

I trapped both the SuccessfulSubscription and DataReturned events.  I get the SuccessfulSubscription, not neither DataReturned nor DataChanged events.

I then started playing with tags.  The following is successful:

  * TESTDBCMD.Trigger (base type = typOutput)

Here's where it starts to fall apart:

  * TESTDBCMDARRAY[1].Trigger (base type = typOutput)

My other data subscriber (a simple PLC heartbeat) works a few times and then stops.

Scott

Pages: [1] 2