SLCDriver API#

class pycomm3.SLCDriver(path, *args, **kwargs)[source]#

An Ethernet/IP Client driver for reading and writing of data files in SLC or MicroLogix PLCs.

read(*addresses)[source]#

Reads data file addresses. To read multiple words add the word count to the address using curly braces, e.g. N120:10{10}.

Does not track request/response size like the CLXDriver.

Parameters:

addresses (str) – one or many data file addresses to read

Return type:

Union[Tag, List[Tag]]

Returns:

a single or list of Tag objects

write(*address_values)[source]#

Write values to data file addresses. To write to multiple words in a file use curly braces in the address to indicate the number of words, then set the value to a list of values to write e.g. ('N120:10{10}', [1, 2, ...]).

Does not track request/response size like the CLXDriver.

Parameters:

address_values (Tuple[str, Union[int, float, bool, List[Union[int, float, bool, str]]]]) – one or many 2-element tuples of (address, value)

Return type:

Union[Tag, List[Tag]]

Returns:

a single or list of Tag objects