bicarlsen / easy-biologic

Python library for communicating with Biologic devices.
GNU General Public License v3.0
18 stars 11 forks source link

Limited voltage/duration length in CA, and limited current/duration length in CP #9

Closed chemyibinjiang closed 2 years ago

chemyibinjiang commented 2 years ago

Hello, I was trying to implement pulse electrodeposition through the CA/CP functions. When I was implementing it, I found the voltages/currents/durations are limited to certain sizes in CA and CP. To be specific, when the length of duration is too large, an error occurs in both cases: EcError: ERR_GEN_INVALIDPARAMETERS (-4): Invalid function parameters.

Here is the code to replicate the error:

import easy_biologic
import sys
import logging
import time 
import numpy as np 
from matplotlib import pyplot as plt
bl_potentiostat = easy_biologic.BiologicDevice('USB0')
bl_potentiostat.connect()
params={'voltages':[0.4,0.5,0.6,0.7,0.8],
                'durations':[0.1,0.1,0.1,0.1,0.1],
                'vs_initial':False,
                'time_interval':0.1,
                'current_interval': 0.001}
durations = np.tile([0.001,0.002],(100,1)).flatten() 
voltages = np.tile([0.1,0.2],(100,1)).flatten()
params['voltages'] = voltages.tolist()
params['durations'] = durations.tolist()

ca = easy_biologic.base_programs.CALimit(device=bl_potentiostat,params = params,channels = [0])
ca.run()

The same error occurs for CP.

bicarlsen commented 2 years ago

voltages and durations can have a maxiumum length of 100 points. This is a limitation of the Biologic itself. For more information you can consult the EC-Lab Development Package Guide v6.00 Section 7.6.2.