Cacli Jpe Without Virtual Coms - ACBJayichLab/NV_ABJ GitHub Wiki

from NV_ABJ. import * this will import the classes CacliJpeCadm2 and CacliVersion

This is a class that is based on interactions with the provided Cacli.exe file from JPE in order to use this you must add the location of the Cacli.exe

You can download the cacli version on the JPE website from the Cryo Positioning System Controller Software Section if the version is not already implemented into the python library.

[!IMPORTANT] This is not a scanner because this implementation does not assume the use of an encoder or resistive sensor and therefore we have the arbitrary motion of a step

[!TIP] To avoid interactions with other third party command line programs it is recommended to keep the the JPE software in its own folder when assigning a environment path variable

[!WARNING] This is also only programmed for use with USB at the moment. My LAN connection has never worked unfortunately so I could not program it for general cases

CacliVersion Enum

This is a classifier class to allow for the selection of different versions you can use this by typing CacliVersion.v7 or by entering a number into the the version slot when calling a function version = 7 this is not recommended though.

These are the different versions of Calci that are used so far and they have slightly different command structures. If they have the same command structure you can implement them by adjusting the match functionality in the control module.

If you implement a new version find the appropriate version on JPEs website and save the manual and software into the Cacli versions folder

Version Command Accepted Firmwares
4 CacliVersion.v4 1038E201410-004, 1038E201406-XXX
6 CacliVersion.v6 1038E201905-XX, 1038E201910-XX, 1039E201911-XX
7 CacliVersion.v7 Firmwares not listed

JPE CADM2 Command

      Jpe_positioner = CacliJpeCadm2(piezo_driver_target:str,piezo_address:int,piezo_stage:str,temperature_kelvin:float,
                frequency_hz:int,relative_step_size_percent:float,
                torque_factor:int = 1,cacli_version:CacliVersion = CacliVersion.v7,
                time_out:float = 0.1,delay_between_attempts_s:int = 5,number_of_attempts:int = 5)
  • piezo_driver_target (str): The address of the communication box e.g. 1038E201410-004
  • piezo_address (int): A value between 1 and 6 for where the piezo driver is located in the target device
  • piezo_stage (str): The type of stage that you are driving e.g. "CS021.Z" you can find available stages with cacli /STAGES match with your type
  • temperature_kelvin (float): Temperature in kelvin of the JPE
  • frequency_hz (int): What frequency the JPE is driven at
  • relative_step_size_percent (float): This is the relative step 0 to 100% you can reduce vibrations by reducing step size
  • torque_factor (int, optional): For a knob how strongly it is driven. Defaults to 1.
  • cacli_version (CacliVersion, optional): The version of cacli installed on the computer. Defaults to CacliVersion.v7.
  • time_out (float, optional): Some versions don't exit on a move or cause errors this times out of the command window. Defaults to 0.1.
  • delay_between_attempts_s (int, optional): If the command is attempted multiple times delay between attempts. Defaults to 5. number_of_attempts (int, optional): How many attempts it will retry the command. This is not done for motion commands incase it moves repeatably. Defaults to 5.

Move Positioner

The move command starts moving an actuator with specified parameters. If an RSM or OEM2 is installed, the actuator position will be tracked automatically if the actuator is fitted with a Resistive Linear Sensor (-RLS option) or Cryo Optical Encoder (-COE option) and connected to one of the channels of the RSM or OEM2 module. This then calls the Cacli command below

Command [foll. by enter] cacli MOV [ADDR] [STAGE] [TEMP] [DIR] [FREQ] [REL] [STEPS] [TRQFR] Command (example) cacli MOV 1 1 600 100 0 293 CLA2601 1

response = jpe_positioner.move_positioner(direction,steps)

  • direction:bool = True is clockwise or forward and False is counterclockwise or backward
  • steps:int = The number of steps that are to be taken

Returns

  • response:int = The response from cacli command line

[!NOTE] The rest of the inputs are drawn from the class definitions this is done to simplify the command directly and allow for occasional updating of the positioner temperatures and other properties

Stop Positioner

This command tells cacli to stop the positioner at the address of the piezo target

response = jpe_positioner.stop_positioner()

  • normal_output:bool(optional, default True) = Verbose error response (True) muted(False)

Returns

  • response:int = The response from cacli command line

Check Cacli Connection

This command is used to check that the actual hub is connected it does not check the individual drivers it is good for trouble shooting to see if your module is disconnecting regularly or if you have a connection

response = jpe_positioner.check_cacli_connection()

Returns

  • response:bool = True and is connected or False and the unit is not connected