semvec/pypi-packages huggingface dataset:
TCPIPLS 2.1
Python connect to PLC LS
Keywords: PLC,protocol,LS electric

# Python connect to PLC LS by TCP/IP

LS protocol(LS electric Communication Protocol) implementation by Python. LS protocol enables you to operate PLC from computer.

# import library

from TCPIP.LS import conn_plpc

# setting PLC IP and Port

PLC_INFORM = {"host":"192.168.1.10", "port":2004} # Port :2004 XGT server TCP/IP

# connect to PLC

conn = conn_plpc(\*\*PLC_INFORM)

# write device

val = conn.plc_comm("XGB", "write", "bit", "M70","1")# Write ON to Bit M70

val = conn.plc_comm("XGB", "write", "bit", "M70") or conn.plc_comm("XGB", "write", "bit", "M70","0") # Write OFF to Bit M70

val = conn.plc_comm("XGB", "write", "byte", "D100","20") # Write 20 to 100th Byte(int8) D50( beacause 1 D= int16)

val = conn.plc_comm("XGB", "write", "word", "D100","1") # write 1 to Word(int16) D100

val = conn.plc_comm("XGB", "write", "dword", "D50","1") # Write 1 to 50th doubleWord(int32)( D100-D101)

val = conn.plc_comm("XGB", "write", "lword", "D25","1") # Write 1 to 25th long(int64) ( D100-D101-d102-d103)

# read device

val = conn.plc_comm("XGB", "read", "bit", "M70") # read Bit M70 return [1] or [0]

val = conn.plc_comm("XGB", "read", "byte", "D100") # read 100th Byte(int8) D50( beacause 1 D= int16)

val = conn.plc_comm("XGB", "read", "word", "D100) # read Word(int16) D100

val = conn.plc_comm("XGB", "read", "dword", "D50) # read 50th doubleWord(int32)( D100-D101)

val = conn.plc_comm("XGB", "read", "lword", "D25) # read 25th long(int64) ( D100-D101-d102-d103)

# write multi device

val = conn.plc_comm("XGB", "write", "bit", "M70,M71,M72","1,0,1")# Write ON to Bit M70, OFF M71 and ON M72

val = conn.plc_comm("XGB", "write", "bit", "M70,M71,M72") # write off all 3 bits M70,M71,M72

.......................

# read multi device

val = conn.plc_comm("XGB", "read", "bit", "M70,M71,M72") # read 3 Bits M70,M71,M72 return [1,0,1]

.............................................
recorder-utils 0.5.0
Recorder utility build upon the package 'recorder-viz'
Requires Python: >=2.7

# Prerequisite

MPI implementation such as openmpi or MPICH


# Install

Install from source
```
pip install -r requirements.txt
pip install .
```

Or Install from pip
```
pip install recorder-utils
```

# Usage

```
recorder2csv /path/to/your_trace_folder/   /path/to/output.csv/
```
A csv trace file will be generated to the output file you specified


# Test

Use the test file under test directory, the output will be in the data directory


## Example

Under Recorder-util directory
```
python3 test/test_convert_text.py
```


# API

## RecorderReader:
- GM : RecorderMetadata
- funcs : string[], utf-8
- records : *PyRecord[], range(): 0 - total_rank-1
- LMs : LocalMetadata[], range(): 0 - total_rank-1


### RecorderMetadata: 
- total_ranks : c_int
- start_ts : c_double
- time_resolution : c_double
- ts_buffer_elements : c_int
- ts_compression_algo : c_int


### LocalMetadata:
- total_records : c_size_t
- num_files : int
- filemap : set()
- function_count : int[], share the index with Recorder.funcs


### PyRecord:
- tstart : c_double
- tend : c_double
- level : c_ubyte
- func_id : c_ubyte
- tid : c_int
- arg_count : c_ubyte
    
args_to_strs : string[], utf-8

## Intervals

Current intervals are taken from POSIX and MPIIO layers. They are stored in the dataframe that return by the function ```build_offset_intervals```. The intervals contain I/O records and corresponding ```file_id, rank, function, offset, size, start time, and end time```.