115 lines
3.0 KiB
Markdown
115 lines
3.0 KiB
Markdown
|
|
# Fins 模块文档(Python 版本)
|
|||
|
|
|
|||
|
|
## Fins
|
|||
|
|
|
|||
|
|
#### Fins 读取 string
|
|||
|
|
|
|||
|
|
* 方法说明
|
|||
|
|
|
|||
|
|
Fins 读取 string。
|
|||
|
|
|
|||
|
|
```python
|
|||
|
|
def read_fins_string(ip: str, port: int, area: int, fins_io_addr: int, bit_offset: int, word_length: int) -> str | None
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
* 输入参数
|
|||
|
|
* `ip`:str 类型,从机 IP
|
|||
|
|
* `port`:int 类型,从机端口
|
|||
|
|
* `area`:int 类型,读取的存储区域代码,16进制值如:0x82
|
|||
|
|
* `fins_io_addr`:int 类型,读取的地址位
|
|||
|
|
* `bit_offset`:int 类型,读取的偏移量
|
|||
|
|
* `word_length`:int 类型,读取的长度
|
|||
|
|
* 输出参数
|
|||
|
|
* `None`:读取失败
|
|||
|
|
* `str`:读取成功的返回值
|
|||
|
|
* 异常
|
|||
|
|
本方法不抛出异常,异常捕获后只作日志记录
|
|||
|
|
|
|||
|
|
#### Fins 读取 word
|
|||
|
|
|
|||
|
|
* 方法说明
|
|||
|
|
|
|||
|
|
Fins 读取 word。
|
|||
|
|
|
|||
|
|
```python
|
|||
|
|
def read_fins_word(ip: str, port: int, area: int, fins_io_addr: int, bit_offset: int) -> int | None
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
* 输入参数
|
|||
|
|
* `ip`:str 类型,从机 IP
|
|||
|
|
* `port`:int 类型,从机端口
|
|||
|
|
* `area`:int 类型,读取的存储区域代码,16进制值如:0x82
|
|||
|
|
* `fins_io_addr`:int 类型,读取的地址位
|
|||
|
|
* `bit_offset`:int 类型,读取的偏移量
|
|||
|
|
* 输出参数
|
|||
|
|
* `None`:读取失败
|
|||
|
|
* `int`:读取成功的返回值
|
|||
|
|
* 异常
|
|||
|
|
本方法不抛出异常,异常捕获后只作日志记录
|
|||
|
|
|
|||
|
|
#### Fins 读取 bit
|
|||
|
|
|
|||
|
|
* 方法说明
|
|||
|
|
|
|||
|
|
Fins 读取 bit。
|
|||
|
|
|
|||
|
|
```python
|
|||
|
|
def read_fins_bit(ip: str, port: int, area: int, fins_io_addr: int, bit_offset: int) -> int | None
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
* 输入参数
|
|||
|
|
* `ip`:str 类型,从机 IP
|
|||
|
|
* `port`:int 类型,从机端口
|
|||
|
|
* `area`:int 类型,读取的存储区域代码,16进制值如:0x82
|
|||
|
|
* `fins_io_addr`:int 类型,读取的地址位
|
|||
|
|
* `bit_offset`:int 类型,读取的偏移量
|
|||
|
|
* 输出参数
|
|||
|
|
* `None`:读取失败
|
|||
|
|
* `int`:读取成功的返回值
|
|||
|
|
* 异常
|
|||
|
|
本方法不抛出异常,异常捕获后只作日志记录
|
|||
|
|
|
|||
|
|
#### Fins 写入 word
|
|||
|
|
|
|||
|
|
* 方法说明
|
|||
|
|
|
|||
|
|
Fins 写入 word。
|
|||
|
|
|
|||
|
|
```python
|
|||
|
|
def write_fins_word(ip: str, port: int, area: int, fins_io_addr: int, bit_offset: int, value: int) -> None
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
* 输入参数
|
|||
|
|
* `ip`:str 类型,从机 IP
|
|||
|
|
* `port`:int 类型,从机端口
|
|||
|
|
* `area`:int 类型,写入的存储区域代码,16进制值如:0x82
|
|||
|
|
* `fins_io_addr`:int 类型,写入的地址位
|
|||
|
|
* `bit_offset`:int 类型,写入的偏移量
|
|||
|
|
* `value`:int 类型,写入的值
|
|||
|
|
* 输出参数
|
|||
|
|
* 该方法无输出参数
|
|||
|
|
* 异常
|
|||
|
|
本方法不抛出异常,异常捕获后只作日志记录
|
|||
|
|
|
|||
|
|
#### Fins 写入 bit
|
|||
|
|
|
|||
|
|
* 方法说明
|
|||
|
|
|
|||
|
|
Fins 写入 bit。
|
|||
|
|
|
|||
|
|
```python
|
|||
|
|
def write_fins_bit(ip: str, port: int, area: int, fins_io_addr: int, bit_offset: int, value: bool) -> None
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
* 输入参数
|
|||
|
|
* `ip`:str 类型,从机 IP
|
|||
|
|
* `port`:int 类型,从机端口
|
|||
|
|
* `area`:int 类型,写入的存储区域代码,16进制值如:0x82
|
|||
|
|
* `fins_io_addr`:int 类型,写入的地址位
|
|||
|
|
* `bit_offset`:int 类型,写入的偏移量
|
|||
|
|
* `value`:bool 类型,写入的值
|
|||
|
|
* 输出参数
|
|||
|
|
* 该方法无输出参数
|
|||
|
|
* 异常
|
|||
|
|
本方法不抛出异常,异常捕获后只作日志记录
|