[PyBEAR | WARNING] :: BULK_COMM return packet timed out. Retrying BULK_COMM...
Either way, bulk communication will retry for up to 3 times. If the communication fails after all
retrial attempts, the function will return None. If there has been no reply at all, the following
message will be displayed:
[PyBEAR | ERROR] :: BULK_COMM no return.
Otherwise, the following message will be displayed:
[PyBEAR | ERROR] :: BULK_COMM only get partial return.
If any of the target BEAR returned corrupted data, the returned data of such BEAR will be
None and the corresponding error code will be -99. Note that this error is only associated
with this particular communication attempt, rather than error code of BEAR as described in
item. 6).
b) Write only
bear.bulk_write([ID1, ID2 ...], [reg1, reg2 ...],
[[ID1-data1, ID1-data2 ...], [ID2-data1, ID2-data2 ...]])
Use this function to write to the same cluster of status registers with different values to mul-
tiple BEARs. The function returns True.
a) Read then write
bear.bulk_read_write([ID1, ID2 ...], [registers to read],
[registers to write],
[[ID1-data1, ID1-data2 ...], [ID2-data1, ID2-data2 ...]])
This function will read data from the specified registers then write to the specified registers
with given data. It’s return behavior is the same as bulk read().
Examples:
# Set goal_position of BEAR 1, 2, 3 respectively to 0, 1, 2
bear.bulk_write([1, 2, 3], ['goal_position'], [[0], [1], [2]])
# Get goal_position and goal velocity of BEAR 1, 2
bear.bulk_read([1, 2], ['goal_position', 'goal_velocity'])
# Get winding_temperature of BEAR 1, 2, 3
# and write new values to their goal_iq and goal_id
bear.bulk_read_write([1, 2, 3], ['winding_temperature'],
['goal_iq', 'goal_id'], [[1, 0], [2.5, 0], [-0.3, 0]])
5) Configuration vs Status Registers Certain registers are Configuration Registers which
are persistent after shutdown, and need to be saved once they are changed, otherwise re-
stored to last saved value after power-cycle. Whereas Status Registers are non-persistent
(volatile) and will be restored to default values when the BEAR is powered on and get popu-
lated with corresponding real time status of BEAR.
28