pycomm3 icon indicating copy to clipboard operation
pycomm3 copied to clipboard

SLCDriver ReWrite Requirements

Open acedrew opened this issue 4 years ago • 8 comments
trafficstars

@ottowayi can this serve as a thread with the other SLC users and yourself to define requirements/needed improvements for the SLCDriver? I may be able to point some resources toward working on this in the near future, or tackle it myself.

  • Test performance gains of eliminating fall through full REGEX matching, instead matching just the file name and directing to the correct full length match.
  • Add more descriptive error messages and better handling to the tag parser
  • Automatic pipelining of adjacent read requests
  • Other structural changes you want to see?

acedrew avatar May 06 '21 14:05 acedrew

Yeah this looks good.

Off the top of my head right now I can think of:

  • change tag parsing to a single regex and then validate based on type
  • add SLC packet classes to move more code out of the individual driver methods
  • identify features exclusive to SLC and MicroLogix (each family) and determine if the driver should be separated into 2 different ones
  • add unit tests and documentation

ottowayi avatar May 06 '21 19:05 ottowayi

This is sort of an FYI and related to MicroLogix 1100.

The attached py files were modified to include changes from PR https://github.com/ottowayi/pycomm3/pull/138 as well as new additions for reading PID values from ML1100.

Example addressing (as can be seen in the attached picture):

  • PD11:0 will show a list of 23 INT values
  • PD11:0.LUT will show INT value for Loop Update Time
  • PD11:0.EN will show bit/bool value

The text file only shows ML1100 PID structure.

ML1100 PID.txt

py files.zip

Pycomm3 GUI (ML1100 PID reading)

GitHubDragonFly avatar May 07 '21 06:05 GitHubDragonFly

I just updated the slc_driver.py file in my previous post to also strip strings inside the _parse_read_reply(tag, data) function.

GitHubDragonFly avatar May 07 '21 20:05 GitHubDragonFly

@GitHubDragonFly would you be interested in working on this and a few other issues we have? We'd love to sponsor getting this knocked out, especially figuring out some other weirdness around I/O file indexing.

acedrew avatar May 10 '21 21:05 acedrew

I just created a slc_redo branch we can use for this, I think you guys should be able to push to it?

I have some ideas of where I'd like to start and what tasks should be done first, but I haven't started any of the work. I think best place to start would be to make a common SLCPacket class, subclassed from SendUnitData (I think), that would have the common code for every request. Then go into making read/write packets. At the same time I'd totally start over with the tag request parsing since it's a nightmare to follow.

ottowayi avatar May 10 '21 21:05 ottowayi

I will pass on collaborating on this since, in my opinion, the SLC driver seems to work properly in general.

If I do come up with any new suggestions then I will let you know and could also test whatever changes you might make.

GitHubDragonFly avatar May 11 '21 01:05 GitHubDragonFly

@GitHubDragonFly We're struggling to figure out the best way to parse I/O Tags that are indexed logically in the pycomm driver (word location in I file) but are indexed by physical card layout in most SCADA systems. Any ideas there?

acedrew avatar May 11 '21 15:05 acedrew

No ideas besides for suggesting that you try using a different driver for a test, like libplctag. If that does what you want it to do then try to figure his code or just simply ask for some ideas in that repository.

You can always do a quick test with either of these, which use libplctag:

https://github.com/GitHubDragonFly/PythonTest https://github.com/GitHubDragonFly/AB-Modbus-Master

GitHubDragonFly avatar May 11 '21 20:05 GitHubDragonFly