Difference between revisions of "EthernetIPforCLXCom"
m |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 15: | Line 15: | ||
|- | |- | ||
|CIPConnectionSize | |CIPConnectionSize | ||
− | |The maximum number of bytes in a single packet. The larger the number, the more efficient the communications. A value of 508 works with all Allen Bradley PLCs tested. Some of the newer models will allow a higher value. | + | |The maximum number of bytes in a single packet. The larger the number, the more efficient the communications. A value of 508 works with all Allen Bradley PLCs tested. Some of the newer models will allow a higher value. As of V3.99y, this value can be set as high as 4000 if using firmware 20 or higher. |
|- | |- | ||
|DisableMultiServiceRequest | |DisableMultiServiceRequest | ||
Line 45: | Line 45: | ||
<b>BeginReadMultiple(taglist() as string)</b> - A very efficient way of reading multiple mixed tags. | <b>BeginReadMultiple(taglist() as string)</b> - A very efficient way of reading multiple mixed tags. | ||
+ | |||
+ | <b>[[WriteUDT]](TagName as string, Value as Object)</b> - Used to write all data to a UDT in a single call and as few packets as possible. | ||
+ | |||
+ | <b>[[ReadUDT]](Of ObjectType)(TagName as string, NumberOfElements as Integer)</b> Reads a complete UDT and creates a .NET object to hold the data | ||
<font size="4"><u>'''Addressing'''</u></font> | <font size="4"><u>'''Addressing'''</u></font> | ||
Line 66: | Line 70: | ||
<code> | <code> | ||
− | Dim MyDriver as EthernetIPForCLXCom | + | '* Synchronous read of a single tag<br> |
+ | '* This is the simplest way to read a tag, however it does block the UI thread until the data is returned<br> | ||
+ | Dim MyDriver as New EthernetIPForCLXCom<br> | ||
+ | MyDriver.IPAddress="192.168.0.10"<br> | ||
+ | Dim MyValue as String<br> | ||
+ | MyValue=MyDriver.Read("MyTag") | ||
</code> | </code> |
Latest revision as of 00:07, 9 May 2019
EthernetIPforCLXCom
This driver specifically targets the Allen Bradley line of ControlLogix and CompactLogix PLCs. It uses tag names directly to access data values in the PLC.
Properties | |
---|---|
IPAddress | The TCP/IP address of the PLC to communicate with |
Port | The TCP/IP port. In nearly all cases this will be 44818 |
CIPConnectionSize | The maximum number of bytes in a single packet. The larger the number, the more efficient the communications. A value of 508 works with all Allen Bradley PLCs tested. Some of the newer models will allow a higher value. As of V3.99y, this value can be set as high as 4000 if using firmware 20 or higher. |
DisableMultiServiceRequest | A multi-service request allows more than one request per packet. This can dramatically increase the speed of retrirving values. Not all PLCs support this, such as the Micro800 series. |
DisableSubscriptions | uses updating of subscriptions. This is useful in cases such as when hiding a form and there is no longer a need to refresh the values. Or when used with a Trend Chart, it can pause the charting. |
PollRateOverride | This set the target rate for refreshing all of the subscriptions. When there are a large number of subscriptions that have to be split amongst sever requests, this value is divided by the number of requests required to determine the delay between each packet. A value of 0 will make the driver update as fast as the PLC will respond, but be cautious because it can reach rates less than 5ms and start to use a lot of resources. |
INIFileName | An INI file can be created to store the properties for being set during application startup. See INI File Usage for more details |
INIFileSection | Specifies the section within the INI file to use for this driver instance settings |
RoutePath | Used to specify routing through ControlLogix chassis. Explained in more detail on the Routing Paths page |
Methods
For the methods common to all drivers see the section on the IComComponent
GetTagList() - Returns the list of controller scope and program scope tags. This is a synschronous method and can delay for a long time when reading a program with a very large tag list.
BeginReadMultiple(taglist() as string) - A very efficient way of reading multiple mixed tags.
WriteUDT(TagName as string, Value as Object) - Used to write all data to a UDT in a single call and as few packets as possible.
ReadUDT(Of ObjectType)(TagName as string, NumberOfElements as Integer) Reads a complete UDT and creates a .NET object to hold the data
Addressing
Controller scope tags are addressed by directly using the tag name. For example:
MyTag
Program scope tags require a prefix to indicate which program. For example:
PROGRAM:MainRoutine.MyTag
UDT elements are read by specifying the UDT variable. For example:
MyUDTTag.Element
Code Samples
'* Synchronous read of a single tag
'* This is the simplest way to read a tag, however it does block the UI thread until the data is returned
Dim MyDriver as New EthernetIPForCLXCom
MyDriver.IPAddress="192.168.0.10"
Dim MyValue as String
MyValue=MyDriver.Read("MyTag")