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.


Topics - thirdeye73

Pages: [1]
1
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


2
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

3
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.

4
Support Questions / EthernetIPforCLXCom and Nested UDTs
« on: January 22, 2015, 05:35:17 PM »
I have a nested UDT that looks something like the following:

typInput:
  ResultCode (DINT)
 
typOutput:
  Trigger (DINT)
  Barcode (STRING)

typCommand:
  I (typInput)
  O (typOutput)

Then in my controller tags I declare an array:

  DBCommand (typCommand[50])

What I am trying to do in VB is set up multiple DataSubscribers that listen to the Trigger field of several of the array elements, i.e. DBCommand[1].O.Trigger.  Is this correct syntax for the PLCAddressValue property?  When I create the subscriber and run the project, it doesn't work--actually nothing seems to work.  When I delete the subscriber, all the other controls start working again.

Thanks,
Scott

5
I think I already know the answer, but wanted to see if anyone has a better way.  Here's what I want to do:

My application is a data server that listens for multiple PLC triggers (each is a DINT field of a UDT array in a CompactLogix processor).  When a trigger is set, the application will read the rest of the UDT and pass the data on to a SQL Server stored procedure.  The returned data is then passed back to the PLC.

I don't need this data to be displayed on a form (except possibly as diagnostic information, but I haven't decided whether I want to implement that yet).  My question, then, is how do I, or can I, declare the driver and data subscription in code, not attached to a form?  In testing I'm getting exceptions when I set the synchronizing object field to a class rather than a form.  I understand why that happens, though.

So here's my current thought on how to do this:

1)  Create a form that will be created when the app loads, but stays hidden (i.e. form.Visible = False).
2)  Add my driver, controls components, and subscribers to the form in design mode.
3)  Comment out the code in the VisibleChanged event so that the subscriptions will be polled even though the form is hidden.

Am I on the right track here?  If I do it right, I think I can just make the form visible when the user clicks a "Diagnostics" button, and hide the form instead of close it when I'm done viewing it.

Thanks,
Scott

6
Support Questions / RSLinx OPC and Emulate5000
« on: January 12, 2015, 06:12:47 PM »
I'm not sure whether I'm doing something wrong, or if this is related to my trying to use Emulator5000 with OPC to test.  Here's what I've done:

PLC environment:
ControlLogix emulator running under Emulate5000
RSLinx OPC Topic has been created and verified via the RSLinx OPC Test Client

VB Environment:
I added an OpcDaCom driver, and set Server Name=RSLinx OPC Server, and Topic=TOTO_Emulation (same as the one created in RSLinx).
I added a button, set it to "Set True" and set the PLCAddressClick to my tag name Pilot (controller scoped).
I added a pilot light, and set PLCAddressValue to Pilot.

When I click the button, I flip over to RSLogix5000 and see it is set to 1.
But the Pilot light does not change state.
I set the tag value to 0 in RSLogix and try again, same results.

Next, I got rid of the button and wrote PLC logic to toggle the Pilot tag on for 1 second and off for one second.
Still the Pilot light does not change state.

I added a DataSubscriber and set PLCAddressValue to Pilot.  I then set a breakpoint at the DataChanged event handler, but it never fires.

Thanks,
Scott


Pages: [1]