Skip to content

Commit e1acf0c

Browse files
committed
-pcan_channel string, bit_rate, and delay_ms arguments added
to BS1200 constructor, all with default values CAN Rx Frame refractor -Incoming (from BS1200) frames are now written to a dictionary of CAN Frames to store the latest data from each frame incoming from initialized box ids by _recv_msg listener method -action statuses to get BS1200 values now parse data from most recently cached frame -action status methods to set values now have 'wait' argument to wait default of 10 ms delay after writing for new CAN frames to be cached -Reset logic in error handling
1 parent 8f1516e commit e1acf0c

File tree

4 files changed

+188
-143
lines changed

4 files changed

+188
-143
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ To initialize the driver, simply create an instance with a integer list of the B
5959
```
6060
from bs1200 import BS1200
6161
62-
test_unit = BS1200([0])
63-
test_unit.query_system_status(0)
62+
test_unit = BS1200([1])
63+
test_unit.query_system_status(1)
6464
test_unit.close()
6565
```
6666
Or an equivalent statement using the Python 'with' structure can be used for the driver:
6767
```
6868
from bs1200 import BS1200
6969
70-
with BS1200([0]) as bs:
71-
bs.query_system_status(0)
70+
with BS1200([1]) as bs:
71+
bs.query_system_status(1)
7272
```
73-
for a single BS1200 with the CAN Box ID set to 0.
73+
for a single BS1200 with the CAN Box ID set to 1.
7474
Once the object is created, the PCAN bus is initialized and a communication session using the device channel PCAN_USBBUS1 has started. The following action status methods may then be used to interact with the BS1200 bus:
7575
| Driver Method Name | Parameters | Description |
7676
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "BS1200_driver"
3-
version = "1.3.0"
3+
version = "1.3.2"
44
authors = [{ name = "Mikhail Kharitonov", email = "[email protected]"}]
55
description= "Python interface to the Bloomy BS1200"
66
readme = "README.md"
7-
dependencies = ["python-can==4.0", "uptime", "nisyscfg", "paramiko", "scp"]
7+
dependencies = ["python-can", "uptime", "nisyscfg", "paramiko", "scp"]
88

99
[project_urls]
1010
"Homepage" = "https://github.com/BloomyControls/BS1200-Python-Driver"

src/bs1200/can_frames.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
from struct import pack
22
from can import Message
33

4+
base_rx_arbids = [256, 288, 304, 320, 384, 400, 416, 640, 672, 688]
5+
base_tx_arbids = [128, 160, 176, 192, 512, 544, 1024, 1152, 1184, 1200, 1280, 1296, 1360]
6+
7+
def init_frame_dict(boxids: list) -> dict:
8+
return {id: None for
9+
id in [id+box for id in base_rx_arbids for box in boxids]}
10+
411
def cell_V_set_1_4(box_id: int, cell_1_4_v: list) -> Message:
512
"""
613
Sets the Voltage Setpoints for Cells 1-4, range 0 to 5 V

0 commit comments

Comments
 (0)