diff --git a/Python/XA/xa_source/CHANGELOG.md b/Python/XA/xa_source/CHANGELOG.md index 888509a..59996a1 100644 --- a/Python/XA/xa_source/CHANGELOG.md +++ b/Python/XA/xa_source/CHANGELOG.md @@ -7,88 +7,101 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.3.0] - 2026-06-29 + +### Changed + +- Internal native API improvements. +- Internal python API improvements. + +## [1.2.1] - 2026-06-04 + +### Changed + +- Resynchronize of wrapper python enumerations with those in the native API. + ## [1.2.0] - 2026-06-02 ### Added -- KST101 product API support (#10003). -- KST201 product API support (#10003). +- KST101 product API support. +- KST201 product API support. ## [1.1.11] - 2026-06-01 ### Fixed -- In the native API, device with serial number unitialized in HW info is now discovered (#9926). +- In the native API, device with serial number uninitialized in HW info is now discovered. ## [1.1.10] - 2026-04-13 ### Fixed -- In the native API, the conversion factor used to convert MicrostepsPerEncoderCount in StepperLoopParams is now correct (#9906). +- In the native API, the conversion factor used to convert MicrostepsPerEncoderCount in StepperLoopParams is now correct. ## [1.1.9] - 2026-04-10 ### Fixed -- In the native API's StepperLoopParams, MicrostepsPerEncoderCount is now a signed 32-bit integer (previously unsigned) (#9906). +- In the native API's StepperLoopParams, MicrostepsPerEncoderCount is now a signed 32-bit integer (previously unsigned). ## [1.1.8] - 2026-04-10 ### Changed -- Internal native API improvements (#9902). +- Internal native API improvements. ## [1.1.7] - 2026-04-08 ### Fixed -- Removed deflection and velocity fields from the CurrentLoopParams structure (#9904). +- Removed deflection and velocity fields from the CurrentLoopParams structure. ## [1.1.6] - 2026-03-31 ### Changed -- Added GitHub changelog URL to package metadata (#9903). +- Added GitHub changelog URL to package metadata. ## [1.1.5] - 2026-03-27 ### Changed -- Internal native API improvements (#9899). +- Internal native API improvements. ## [1.1.4] - 2026-03-26 ### Changed -- Internal native API improvements (#9895). +- Internal native API improvements. ## [1.1.3] - 2026-03-26 ### Fixed -- Connected product information now correctly reported as "rotational - continuous" (rather than "rotational - fixed range") for FW103, FW6, FW12, HDR50 and NR360S stages (#9883). +- Connected product information now correctly reported as "rotational - continuous" (rather than "rotational - fixed range") for FW103, FW6, FW12, HDR50 and NR360S stages. ## [1.1.2] - 2026-03-20 ### Added -- Added native API support for PDXC3 (#9879). +- Added native API support for PDXC3. ## [1.1.1] - 2026-03-03 ### Changed -- Internal native API improvements (#9858). +- Internal native API improvements. ## [1.1.0] - 2026-02-19 ### Added -- LTS product API support (#9851). -- KDC product API support (#9850). +- LTS product API support. +- KDC product API support. ## [1.0.0] - 2026-01-21 ### Added -- Initial python wrapper API implementation (#9719, #9720). \ No newline at end of file +- Initial python wrapper API implementation. diff --git a/Python/XA/xa_source/setup.py b/Python/XA/xa_source/setup.py index 41f46a9..2a0ab2a 100644 --- a/Python/XA/xa_source/setup.py +++ b/Python/XA/xa_source/setup.py @@ -51,7 +51,7 @@ def get_tag(self): author_email = "techsupport@thorlabs.com", description = "Thorlabs XA Python SDK", project_urls={ - "Changelog": "https://github.com/Thorlabs/Motion_Control_Examples/blob/main/Python/XA/CHANGELOG.md" + "Changelog": "https://github.com/Thorlabs/Motion_Control_Examples/blob/main/Python/XA/xa_source/CHANGELOG.md" }, long_description = read_me_content, long_description_content_type="text/markdown", diff --git a/Python/XA/xa_source/src/thorlabs_xa/shared/c_params.py b/Python/XA/xa_source/src/thorlabs_xa/shared/c_params.py index 035f9cd..c5753aa 100644 --- a/Python/XA/xa_source/src/thorlabs_xa/shared/c_params.py +++ b/Python/XA/xa_source/src/thorlabs_xa/shared/c_params.py @@ -71,6 +71,7 @@ class C_TLMC_CurrentLoopParams(Structure): ("integralLimit", c_uint16), ("integralDeadBand", c_uint16), ("feedForward", c_uint16), + ("scalingFactor", c_float) ] @@ -394,17 +395,6 @@ class C_TLMC_ProfileModeParams(Structure): ("reserved", c_int8 * 4) ] -class C_TLMC_PZ_IoTriggerParams(Structure): - _pack_ = 1 - _fields_ = [ - ("numberOfPortsPerChannel", c_uint16), - ("portNumber", c_uint16), - ("portType", c_uint16), - ("mode", c_uint16), - ("polarity", c_uint16), - ("triggerParameter1", c_int32), - ("triggerParameter2", c_int32) -] class C_TLMC_PZ_LnnxControlLoopParams(Structure): _pack_ = 1 @@ -627,7 +617,7 @@ class C_TLMC_SettingItemChangedNotificationData(Structure): class C_TLMC_StageAxisParams(Structure): _pack_ = 1 - _fields_ = [("typeId", c_uint16), + _fields_ = [("productId", c_uint16), ("axisId", c_uint16), ("partNumber", c_char * 16), ("serialNumber", c_uint32), @@ -638,7 +628,11 @@ class C_TLMC_StageAxisParams(Structure): ("maxDeceleration", c_uint32), ("maxVelocity", c_uint32), ("gearBoxRatio", c_uint16), - ("reserved", c_uint8 * 22) + ("microSteps", c_uint16), + ("positionScale", c_float), + ("velocityScale", c_float), + ("accelerationScale", c_float), + ("reserved", c_uint8 * 8) ] diff --git a/Python/XA/xa_source/src/thorlabs_xa/shared/device_factory.py b/Python/XA/xa_source/src/thorlabs_xa/shared/device_factory.py index d751def..c3188f8 100644 --- a/Python/XA/xa_source/src/thorlabs_xa/shared/device_factory.py +++ b/Python/XA/xa_source/src/thorlabs_xa/shared/device_factory.py @@ -1,16 +1,12 @@ from thorlabs_xa.implementations.device_feature_groups.kdc101_feature_group import Kdc101FeatureGroup from thorlabs_xa.implementations.device_feature_groups.kpc101_feature_group import Kpc101FeatureGroup from thorlabs_xa.implementations.device_feature_groups.kst201_feature_group import Kst201FeatureGroup -from thorlabs_xa.implementations.device_feature_groups.lnnx_feature_group import LnnxFeatureGroup from thorlabs_xa.implementations.device_feature_groups.linear_translation_stage_feature_group import LinearTranslationStageFeatureGroup -from thorlabs_xa.implementations.device_feature_groups.lnnx_logical_channel_feature_group import LnnxLogicalChannelFeatureGroup from thorlabs_xa.products.kdc101 import Kdc101 from thorlabs_xa.products.kpc101 import Kpc101 from thorlabs_xa.products.kst201 import Kst201 -from thorlabs_xa.products.lnnx import Lnnx from thorlabs_xa.products.linear_translation_stage import LinearTranslationStage -from thorlabs_xa.products.lnnx_logical_channel import LnnxLogicalChannel from thorlabs_xa.native_sdks.native_functions import NativeFunctions @@ -28,12 +24,6 @@ def create(self, device_handle: int, device_info: TLMC_DeviceInfo) -> Device: # Note: It is expected that this will produce a pylance error until all device types are implemented match device_info.device_type: - case TLMC_DeviceType.TLMC_DeviceType_LnnxBaseUnit: - feature_group = LnnxFeatureGroup(device_handle, self.native_functions) - return Lnnx(device_handle, device_info, feature_group, self.native_functions) - case TLMC_DeviceType.TLMC_DeviceType_LnnxLogicalChannel: - feature_group = LnnxLogicalChannelFeatureGroup(device_handle, self.native_functions) - return LnnxLogicalChannel(device_handle, device_info, feature_group, self.native_functions) case TLMC_DeviceType.TLMC_DeviceType_Kdc101: feature_group = Kdc101FeatureGroup(device_handle, self.native_functions) return Kdc101(device_handle, device_info, feature_group, self.native_functions) diff --git a/Python/XA/xa_source/src/thorlabs_xa/shared/enums.py b/Python/XA/xa_source/src/thorlabs_xa/shared/enums.py index c239fc5..c64c792 100644 --- a/Python/XA/xa_source/src/thorlabs_xa/shared/enums.py +++ b/Python/XA/xa_source/src/thorlabs_xa/shared/enums.py @@ -30,12 +30,9 @@ class TLMC_AuxIoPortNumber(IntEnum): TLMC_AuxIoPortNumber_Port1 = 0x0001 TLMC_AuxIoPortNumber_Port2 = 0x0002 TLMC_AuxIoPortNumber_Port3 = 0x0004 - - -class TLMC_ButtonMode(IntEnum): - - TLMC_ButtonMode_Jog = 0x0001 - TLMC_ButtonMode_PresetPosition = 0x0002 + TLMC_AuxIoPortNumber_EncoderOutputMotor1 = 0x0008 + TLMC_AuxIoPortNumber_EncoderOutputMotor2 = 0x0010 + TLMC_AuxIoPortNumber_EncoderOutputMotor3 = 0x0020 class TLMC_BowIndex(IntEnum): @@ -60,6 +57,12 @@ class TLMC_BowIndex(IntEnum): TLMC_BowIndex_SCurve18 = 18 +class TLMC_ButtonMode(IntEnum): + + TLMC_ButtonMode_Jog = 0x0001 + TLMC_ButtonMode_PresetPosition = 0x0002 + + class TLMC_CalibrationState(IntEnum): TLMC_CalibrationState_Unknown = 0x00 TLMC_CalibrationState_FileNotPresent = 0x01 @@ -67,11 +70,6 @@ class TLMC_CalibrationState(IntEnum): TLMC_CalibrationState_Inactive = 0x03 -class TLMC_ChannelEnableStates(IntEnum): - ChannelEnabled = 0x01 - ChannelDisabled = 0x02 - - class TLMC_ConnectedProductAxisType(IntEnum): TLMC_ConnectedProductAxisType_Unknown = 0 TLMC_ConnectedProductAxisType_Single = 1 @@ -126,6 +124,11 @@ class TLMC_DeviceFamily(IntEnum): TLMC_DeviceFamily_ThorlabsMotionControl = 0 +class TLMC_DeviceListChange(IntEnum): + TLMC_DeviceListChange_EntryAdded = 0 + TLMC_DeviceListChange_EntryRemoved = 1 + + class TLMC_DeviceType(IntEnum): TLMC_DeviceType_Bbd30xBaseUnit = 0 TLMC_DeviceType_Bbd30xLogicalChannel = 1 @@ -147,14 +150,10 @@ class TLMC_DeviceType(IntEnum): TLMC_DeviceType_Kpc101 = 17 TLMC_DeviceType_Pdxc2 = 18 TLMC_DeviceType_Pdxc3 = 19 - TLMC_DeviceType_Kna101 = 20 - TLMC_DeviceType_LnnxBaseUnit = 21 - TLMC_DeviceType_LnnxLogicalChannel = 22 - - -class TLMC_DeviceListChange(IntEnum): - TLMC_DeviceListChange_EntryAdded = 0 - TLMC_DeviceListChange_EntryRemoved = 1 + TLMC_DeviceType_UmcxBaseUnit = 20 + TLMC_DeviceType_UmcxBrushlessLogicalChannel = 21 + TLMC_DeviceType_UmcxStepperLogicalChannel = 22 + TLMC_DeviceType_Anonymous = 23 class TLMC_DigitalInput(IntFlag): @@ -168,6 +167,16 @@ class TLMC_DigitalInput(IntFlag): | TLMC_DigitalInput_3 | TLMC_DigitalInput_4) +class TLMC_IoTriggerPortNumber(IntFlag): + TLMC_IoTriggerPortNumber_None = 0x0000 + TLMC_IoTriggerPortNumber_Port1 = 0x0001 + TLMC_IoTriggerPortNumber_Port2 = 0x0002 + TLMC_IoTriggerPortNumber_Port3 = 0x0004 + TLMC_IoTriggerPortNumber_Port4 = 0x0008 + TLMC_IoTriggerPortNumber_Port5 = 0x0010 + TLMC_IoTriggerPortNumber_Port6 = 0x0020 + TLMC_IoTriggerPortNumber_Port7 = 0x0040 + class TLMC_DigitalOutput(IntFlag): TLMC_DigitalOutput_None = 0x00 @@ -241,13 +250,21 @@ class TLMC_IoTriggerInMode(IntEnum): TLMC_IoTriggerInMode_TriggersRelativeMove = 0x0002 TLMC_IoTriggerInMode_TriggersAbsoluteMove = 0x0003 TLMC_IoTriggerInMode_TriggersHomeMove = 0x0004 + TLMC_IoTriggerInMode_TriggersHomeStop = 0x0005 class TLMC_IoTriggerInSource(IntEnum): TLMC_IoTriggerInSource_Software = 0x0000 - TLMC_IoTriggerInSource_BNC1 = 0x0001 - TLMC_IoTriggerInSource_BNC2 = 0x0002 - TLMC_IoTriggerInSource_BNC3 = 0x0003 + TLMC_IoTriggerInSource_Io1 = 0x0001 + TLMC_IoTriggerInSource_Io2 = 0x0002 + TLMC_IoTriggerInSource_Io3 = 0x0003 + TLMC_IoTriggerInSource_BNC1 = TLMC_IoTriggerInSource_Io1 + TLMC_IoTriggerInSource_BNC2 = TLMC_IoTriggerInSource_Io2 + TLMC_IoTriggerInSource_BNC3 = TLMC_IoTriggerInSource_Io3 + TLMC_IoTriggerInSource_AuxIoUserInput1 = 0x0004 + TLMC_IoTriggerInSource_AuxIoUserInput2 = 0x0005 + TLMC_IoTriggerInSource_AuxIoUserInput3 = 0x0006 + TLMC_IoTriggerInSource_AuxIoUserInput4 = 0x0007 class TLMC_IoTriggerOutMode(IntEnum): @@ -267,17 +284,6 @@ class TLMC_IoTriggerPolarity(IntEnum): TLMC_IoTriggerPolarity_ActiveIsLogicLow = 0x0002 -class TLMC_IoTriggerPortNumber(IntFlag): - TLMC_IoTriggerPortNumber_None = 0x0000 - TLMC_IoTriggerPortNumber_Port1 = 0x0001 - TLMC_IoTriggerPortNumber_Port2 = 0x0002 - TLMC_IoTriggerPortNumber_Port3 = 0x0004 - TLMC_IoTriggerPortNumber_Port4 = 0x0008 - TLMC_IoTriggerPortNumber_Port5 = 0x0010 - TLMC_IoTriggerPortNumber_Port6 = 0x0020 - TLMC_IoTriggerPortNumber_Port7 = 0x0040 - - class TLMC_JogMode(IntEnum): TLMC_JogMode_Continuous = 0x0001 TLMC_JogMode_SingleStep = 0x0002 @@ -296,7 +302,6 @@ class TLMC_JoystickAxis(IntEnum): class TLMC_JoystickDirectionSense(IntEnum): - TLMC_JoystickDirectionSense_Disabled = 0x0000 TLMC_JoystickDirectionSense_Positive = 0x0001 TLMC_JoystickDirectionSense_Negative = 0x0002 @@ -679,25 +684,21 @@ class TLMC_NotificationId(IntEnum): TLMC_NotificationId_PiezoKpcIoSettingsChanged = 60 TLMC_NotificationId_PiezoKpcIoTriggerParamsChanged = 61 TLMC_NotificationId_PiezoKpcMmiParamsChanged = 62 - TLMC_NotificationId_NanoTrakModeChanged = 63 - TLMC_NotificationId_NanoTrakStatusChanged = 64 - TLMC_NotificationId_NanoTrakCircleParamsChanged = 65 - TLMC_NotificationId_NanoTrakRangeParamsChanged = 66 - TLMC_NotificationId_NanoTrakPhaseCompensationParamsChanged = 67 - TLMC_NotificationId_PiezoKnaIoTriggerParamsChanged = 68 - TLMC_NotificationId_NanoTrakCircleHomePositionChanged = 69 - TLMC_NotificationId_NanoTrakGainChanged = 70 - TLMC_NotificationId_NanoTrakTrackThresholdChanged = 71 - TLMC_NotificationId_TNAIoSettingsChanged = 72 - TLMC_NotificationId_PiezoKnaMmiParamsChanged = 73 - TLMC_NotificationId_PiezoXyScanDataChanged = 74 - TLMC_NotificationId_NanoTrakCircleDiameterLutDataChanged = 75 - TLMC_NotificationId_NanoTrakStatusBitsChanged = 76 - TLMC_NotificationId_NanoTrakFeedbackSourceChanged = 77 - TLMC_NotificationId_MonitorOutputParamsChanged = 78 - TLMC_NotificationId_LnnxControlLoopParamsChanged = 79 - TLMC_NotificationId_LnnxNotchFilterParamsChanged = 80 - TLMC_NotificationId_PiezoIoTriggerParamsChanged = 81 + TLMC_NotificationId_AbnormalMoveDetectionParamsChanged = 63 + TLMC_NotificationId_PiezoInertialMotorAmplifierOutputParamsChanged = 64 + TLMC_NotificationId_PiezoInertialMotorClosedLoopMoveParamsChanged = 65 + TLMC_NotificationId_PiezoInertialMotorClosedLoopParamsChanged = 66 + TLMC_NotificationId_PiezoInertialMotorCurrentPositionChanged = 67 + TLMC_NotificationId_PiezoInertialMotorEthernetParamsChanged = 68 + TLMC_NotificationId_PiezoInertialMotorExternalTriggerConfigChanged = 69 + TLMC_NotificationId_PiezoInertialMotorExternalTriggerParamsChanged = 70 + TLMC_NotificationId_PiezoInertialMotorJogParamsChanged = 71 + TLMC_NotificationId_PiezoInertialMotorOpenLoopMoveParamsChanged = 72 + TLMC_NotificationId_PiezoInertialMotorStatusChanged = 73 + TLMC_NotificationId_PiezoInertialMotorTriggerTargetPositionChanged = 74 + TLMC_NotificationId_UmcStatusChanged = 75 + TLMC_NotificationId_AuxIoConfigurationChanged = 76 + class TLMC_OperatingMode(IntFlag): TLMC_OperatingMode_StatusPushedByController = 0x00000000 @@ -710,12 +711,16 @@ class TLMC_OperatingMode(IntFlag): TLMC_OperatingMode_DoNotSendDisconnectOnFinalClose = 0x00020000 TLMC_OperatingMode_DoNotAutoSetConnectedProduct = 0x00040000 TLMC_OperatingMode_DoNotSendNoFlashProgrammingOnConnect = 0x00080000 + TLMC_OperatingMode_DoNotAutoCalibrate = 0x00100000 + TLMC_OperatingMode_DoNotSendHardwareInfoRequestOnConnect = 0x00200000 TLMC_OperatingMode_Apt = (TLMC_OperatingMode_StatusPushedByController | TLMC_OperatingMode_SendEndOfMoveMessages) TLMC_OperatingMode_Kinesis = (TLMC_OperatingMode_AutomaticStatusPolling | TLMC_OperatingMode_SendEndOfMoveMessages) TLMC_OperatingMode_Default = TLMC_OperatingMode_Apt TLMC_OperatingMode_Expert = ( TLMC_OperatingMode_DoNotChangeStatusPollingMode | TLMC_OperatingMode_DoNotLoadParamsOnConnect | - TLMC_OperatingMode_DoNotSendDisconnectOnFinalClose | TLMC_OperatingMode_DoNotAutoSetConnectedProduct) + TLMC_OperatingMode_DoNotSendDisconnectOnFinalClose | TLMC_OperatingMode_DoNotAutoSetConnectedProduct | + TLMC_OperatingMode_DoNotSendNoFlashProgrammingOnConnect | TLMC_OperatingMode_DoNotAutoCalibrate | + TLMC_OperatingMode_DoNotSendHardwareInfoRequestOnConnect) class TLMC_ParameterGroupId(IntEnum): @@ -863,6 +868,7 @@ class TLMC_ResultCode(IntEnum): TLMC_SimulationCreationError = 24 TLMC_ConnectedProductNotSet = 25 TLMC_CalibrationFileNotPresent = 26 + TLMC_ConnectedProductUnknown = 27 class TLMC_ScaleType(IntEnum): @@ -881,13 +887,6 @@ class TLMC_ScaleType(IntEnum): TLMC_ScaleType_NormalizedStrainGauge = 12 TLMC_ScaleType_RescaledVoltage = 13 TLMC_ScaleType_RescaledDistance = 14 - TLMC_ScaleType_Phase = 15 - TLMC_ScaleType_Frequency = 16 - TLMC_ScaleType_Current = 17 - TLMC_ScaleType_UserDiameter = 18 - TLMC_ScaleType_NanoTrak = 19 - TLMC_ScaleType_Pid = 20 - TLMC_ScaleType_QFactor = 21 class TLMC_SettingStringFormat(IntEnum): @@ -905,20 +904,82 @@ class TLMC_SoftLimitOperatingMode(IntEnum): TLMC_SoftLimitOperatingMode_RotationStageLimit = 0x0080 -class TLMC_StageAxis_AxisId(IntEnum): +class TLMC_StageAxisId(IntEnum): TLMC_StageAxisId_Unknown = 0x0001 TLMC_StageAxisId_Rotary = 0x0003 TLMC_StageAxisId_X = 0x0010 TLMC_StageAxisId_Y = 0x0011 TLMC_StageAxisId_Single = 0x0012 - - -class TLMC_StageAxis_TypeId(IntEnum): - TLMC_StageAxisType_Unknown = 0x0001 - TLMC_StageAxisType_MLS203_X = 0x0010 - TLMC_StageAxisType_MLS203_Y = 0x0011 - TLMC_StageAxisType_DDS = 0x0012 - TLMC_StageAxisType_DDR = 0x0075 + TLMC_StageAxisId_Pitch = 0x0013 + TLMC_StageAxisId_Roll = 0x0014 + TLMC_StageAxisId_Yaw = 0x0015 + + +class TLMC_StageProductId(IntEnum): + TLMC_StageProductId_Unknown_PDXC = 0x0000 + TLMC_StageProductId_Unknown = 0x0001 + TLMC_StageProductId_MLS203_X = 0x0010 + TLMC_StageProductId_MLS203_Y = 0x0011 + TLMC_StageProductId_DDS = 0x0012 + TLMC_StageProductId_DRV001 = 0x0049 + TLMC_StageProductId_DRV013 = 0x0050 + TLMC_StageProductId_DRV014 = 0x0051 + TLMC_StageProductId_NanoMax_300_Y_Axis_DRV208 = 0x0060 + TLMC_StageProductId_NanoMax_300M_Y_Axis_DRV208 = 0x0061 + TLMC_StageProductId_NanoMax_300_Z_Axis_DRV208 = 0x0062 + TLMC_StageProductId_NanoMax_300M_Z_Axis_DRV208 = 0x0063 + TLMC_StageProductId_NanoMax_600_Y_Axis_DRV208 = 0x0064 + TLMC_StageProductId_NanoMax_600M_Y_Axis_DRV208 = 0x0065 + TLMC_StageProductId_NanoMax_600_Z_Axis_DRV208 = 0x0066 + TLMC_StageProductId_NanoMax_600M_Z_Axis_DRV208 = 0x0067 + TLMC_StageProductId_NanoMax_600_Pitch_Axis_DRV208 = 0x0068 + TLMC_StageProductId_NanoMax_600M_Pitch_Axis_DRV208 = 0x0069 + TLMC_StageProductId_NanoMax_600_Yaw_Axis_DRV208 = 0x006A + TLMC_StageProductId_NanoMax_600M_Yaw_Axis_DRV208 = 0x006B + TLMC_StageProductId_NanoMax_600_Roll_Axis_DRV208 = 0x006C + TLMC_StageProductId_NanoMax_600M_Roll_Axis_DRV208 = 0x006D + TLMC_StageProductId_NanoMax_300_X_Axis_DRV001 = 0x006E + TLMC_StageProductId_NanoMax_300M_X_Axis_DRV001 = 0x006F + TLMC_StageProductId_NanoMax_300_Y_Axis_DRV001 = 0x0070 + TLMC_StageProductId_NanoMax_300M_Y_Axis_DRV001 = 0x0071 + TLMC_StageProductId_NanoMax_300_Z_Axis_DRV001 = 0x0072 + TLMC_StageProductId_NanoMax_300M_Z_Axis_DRV001 = 0x0073 + TLMC_StageProductId_NanoMax_600_X_Axis_DRV001 = 0x0074 + TLMC_StageProductId_DDR = 0x0075 + TLMC_StageProductId_FW6 = 0x0076 + TLMC_StageProductId_FW12 = 0x0077 + TLMC_StageProductId_NanoMax_600_Z_Axis_DRV001 = 0x0078 + TLMC_StageProductId_NanoMax_600M_Z_Axis_DRV001 = 0x0079 + TLMC_StageProductId_NanoMax_600_Pitch_Axis_DRV001 = 0x007A + TLMC_StageProductId_NanoMax_600M_Pitch_Axis_DRV001 = 0x007B + TLMC_StageProductId_NanoMax_600_Yaw_Axis_DRV001 = 0x007C + TLMC_StageProductId_NanoMax_600M_Yaw_Axis_DRV001 = 0x007D + TLMC_StageProductId_NanoMax_600_Roll_Axis_DRV001 = 0x007E + TLMC_StageProductId_NanoMax_600M_Roll_Axis_DRV001 = 0x007F + TLMC_StageProductId_NanoMax_600M_X_Axis_DRV001 = 0x0080 + TLMC_StageProductId_NanoMax_600_Y_Axis_DRV001 = 0x0081 + TLMC_StageProductId_NanoMax_600M_Y_Axis_DRV001 = 0x0082 + TLMC_StageProductId_HDR50M = 0x00AE + TLMC_StageProductId_HDR50 = 0x00AF + TLMC_StageProductId_DRV225 = 0x00B0 + TLMC_StageProductId_DRV250 = 0x00B1 + TLMC_StageProductId_DRV208 = 0x00B2 + TLMC_StageProductId_NRT100 = 0x00B3 + TLMC_StageProductId_NRT150 = 0x00B4 + TLMC_StageProductId_FW103 = 0x00B6 + TLMC_StageProductId_LPXY1_X = 0x00B8 + TLMC_StageProductId_LPXY1_Y = 0x00B9 + TLMC_StageProductId_LNR502 = 0x00BB + TLMC_StageProductId_LNR502E = 0x00BC + TLMC_StageProductId_NanoMax_300_X_Axis_DRV208 = 0x00BD + TLMC_StageProductId_NanoMax_300M_X_Axis_DRV208 = 0x00BE + TLMC_StageProductId_NanoMax_600_X_Axis_DRV208 = 0x00BF + TLMC_StageProductId_NanoMax_600M_X_Axis_DRV208 = 0x00C0 + TLMC_StageProductId_NRT100M = 0x00C3 + TLMC_StageProductId_NRT150M = 0x00C4 + TLMC_StageProductId_LNR502M = 0x00CB + TLMC_StageProductId_LNR502EM = 0x00CC + TLMC_StageProductId_AutoIdNotPresent = 0x8000 class TLMC_StatusItemId(IntEnum): @@ -990,30 +1051,6 @@ class TLMC_StatusItemId(IntEnum): TLMC_StatusItemId_PulseAcquired = 65 TLMC_StatusItemId_PulseAcquiring = 66 TLMC_StatusItemId_WrongStageDetected = 67 - TLMC_StatusItemId_CirclePositionA = 68 - TLMC_StatusItemId_CirclePositionB = 69 - TLMC_StatusItemId_CircleDiameter = 70 - TLMC_StatusItemId_AbsoluteReading = 71 - TLMC_StatusItemId_RelativeReading = 72 - TLMC_StatusItemId_Range = 73 - TLMC_StatusItemId_UnderOverRead = 74 - TLMC_StatusItemId_Gain = 75 - TLMC_StatusItemId_PhaseCompensationA = 76 - TLMC_StatusItemId_PhaseCompensationB = 77 - TLMC_StatusItemId_TrackingWithSignal = 78 - TLMC_StatusItemId_TrackingOnlyChannelA = 79 - TLMC_StatusItemId_TrackingOnlyChannelB = 80 - TLMC_StatusItemId_AutoRange = 81 - TLMC_StatusItemId_UnderRead = 82 - TLMC_StatusItemId_OverRead = 83 - TLMC_StatusItemId_ChannelAConnected = 84 - TLMC_StatusItemId_ChannelBConnected = 85 - TLMC_StatusItemId_ChannelAEnabled = 86 - TLMC_StatusItemId_ChannelBEnabled = 87 - TLMC_StatusItemId_ChannelAControlMode = 88 - TLMC_StatusItemId_ChannelBControlMode = 89 - TLMC_StatusItemId_NanoTrakMode = 90 - TLMC_StatusItemId_FeedbackSaturated = 91 class TLMC_StatusItemValue(IntEnum): @@ -1023,6 +1060,11 @@ class TLMC_StatusItemValue(IntEnum): TLMC_ValueType_float = 3 +class TLMC_StepperLoopParams_LoopMode(IntEnum): + TLMC_StepperLoopParams_LoopMode_Open = 0x0001 + TLMC_StepperLoopParams_LoopMode_Closed = 0x0002 + + class TLMC_StepperStatusBit(IntEnum): TLMC_StepperStatusBit_ClockwiseHardLimit = 0x00000001 TLMC_StepperStatusBit_CounterclockwiseHardLimit = 0x00000002 @@ -1037,11 +1079,6 @@ class TLMC_StepperStatusBit(IntEnum): TLMC_StepperStatusBit_Enabled = 0x80000000 -class TLMC_StepperLoopParams_LoopMode(IntEnum): - TLMC_StepperLoopParams_LoopMode_Open = 0x0001 - TLMC_StepperLoopParams_LoopMode_Closed = 0x0002 - - class TLMC_StopMode(IntEnum): TLMC_StopMode_Immediate = 1 TLMC_StopMode_Profiled = 2 @@ -1092,9 +1129,6 @@ class TLMC_Unit(IntEnum): TLMC_Unit_Nanoseconds = 18 TLMC_Unit_Millivolts = 19 TLMC_Unit_Steps = 20 - TLMC_Unit_Milliamps = 21 - TLMC_Unit_NanoTrak = 22 - TLMC_Unit_QFactor = 23 class TLMC_UniversalStatusBit(IntFlag): diff --git a/Python/XA/xa_source/src/thorlabs_xa/shared/map_native_to_python.py b/Python/XA/xa_source/src/thorlabs_xa/shared/map_native_to_python.py index 2c86100..a924d25 100644 --- a/Python/XA/xa_source/src/thorlabs_xa/shared/map_native_to_python.py +++ b/Python/XA/xa_source/src/thorlabs_xa/shared/map_native_to_python.py @@ -2,10 +2,10 @@ from typing import TypeAlias, Union -from thorlabs_xa.shared.c_params import C_TLMC_AdcInputs, C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ApiVersion, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_DeviceInfo, C_TLMC_FirmwareVersion, C_TLMC_GeneralMoveParams, C_TLMC_HardwareInfo, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_JoystickSettingsParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MonitorOutputParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_IoTriggerParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_LnnxControlLoopParams, C_TLMC_PZ_LnnxNotchFilterParams, C_TLMC_PZ_MaxOutputVoltageParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakStatus, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PZ_StageInfoParams, C_TLMC_PZ_Status, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_RichResponse, C_TLMC_Setting, C_TLMC_StageAxisParams, C_TLMC_StatusItem, C_TLMC_StepperLoopParams, C_TLMC_StepperStatus, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_UniversalStatus, C_TLMC_VelocityParams +from thorlabs_xa.shared.c_params import C_TLMC_AdcInputs, C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ApiVersion, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_DeviceInfo, C_TLMC_FirmwareVersion, C_TLMC_GeneralMoveParams, C_TLMC_HardwareInfo, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_JoystickSettingsParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MonitorOutputParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_LnnxControlLoopParams, C_TLMC_PZ_LnnxNotchFilterParams, C_TLMC_PZ_MaxOutputVoltageParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakStatus, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PZ_StageInfoParams, C_TLMC_PZ_Status, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_RichResponse, C_TLMC_Setting, C_TLMC_StageAxisParams, C_TLMC_StatusItem, C_TLMC_StepperLoopParams, C_TLMC_StepperStatus, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_UniversalStatus, C_TLMC_VelocityParams from thorlabs_xa.shared.params import TLMC_AdcInputs, TLMC_AnalogMonitorConfigurationParams, TLMC_ApiVersion, TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_CurrentLoopParams, TLMC_DcPidParams, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_GeneralMoveParams, TLMC_HardwareInfo, TLMC_HomeParams, TLMC_IoConfigurationParams, TLMC_IoTriggerParams, TLMC_JogParams, TLMC_JoystickParams, TLMC_JoystickSettingsParams, TLMC_KcubeIoTriggerParams, TLMC_KcubeMmiParams, TLMC_KcubePositionTriggerParams, TLMC_LcdDisplayParams, TLMC_LcdMoveParams, TLMC_LimitSwitchParams, TLMC_MonitorOutputParams, TLMC_MotorOutputParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PZ_IoTriggerParams, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_LnnxControlLoopParams, TLMC_PZ_LnnxNotchFilterParams, TLMC_PZ_MaxOutputVoltageParams, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakStatus, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_PZ_NanoTrakTrackThresholdParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_SlewRateParams, TLMC_PZ_StageInfoParams, TLMC_PZ_Status, TLMC_PositionLoopParams, TLMC_PotentiometerParams, TLMC_PowerParams, TLMC_ProfileModeParams, TLMC_RichResponse, TLMC_Setting, TLMC_StageAxisParams, TLMC_StatusItem, TLMC_StepperLoopParams, TLMC_StepperStatus, TLMC_TrackSettleParams, TLMC_TriggerParamsForDcBrushless, TLMC_TriggerParamsForStepper, TLMC_UniversalStatus, TLMC_VelocityParams -from thorlabs_xa.shared.enums import TLMC_AnalogMonitorMotorChannel, TLMC_AnalogMonitorSystemVariable, TLMC_ButtonMode, TLMC_ConnectedProductAxisType, TLMC_ConnectedProductMovementType, TLMC_CurrentLoopPhase, TLMC_DeviceFamily, TLMC_DeviceType, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_IoPortMode, TLMC_IoPortSource, TLMC_IoTriggerPolarity, TLMC_IoTriggerPortNumber, TLMC_JogMode, TLMC_JogStopMode, TLMC_JoystickAxis, TLMC_JoystickDirectionSense, TLMC_JoystickModel, TLMC_JoystickSerialInterface, TLMC_KcubeIoTriggerMode, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickDirectionSense, TLMC_KcubeMmi_JoystickGear, TLMC_MonitorOutput, TLMC_PZ_IoTriggerMode, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_LnnxControlLoopParamsOverrideMode, TLMC_PZ_LnnxNotchFilterParamsOverrideMode, TLMC_PZ_NanoTrakAbsolutePowerAdjustType, TLMC_PZ_NanoTrakCircleDiameterMode, TLMC_PZ_NanoTrakGainControlMode, TLMC_PZ_NanoTrakPhaseCompensationMode, TLMC_PZ_NanoTrakRange, TLMC_PZ_NanoTrakRangeChangeType, TLMC_PZ_NanoTrakRangeMode, TLMC_PZ_NanoTrakStatusBit, TLMC_PZ_NanoTrakTrackingMode, TLMC_PZ_NanoTrakTrackingState, TLMC_PZ_NanoTrakUnderOverReadType, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_SensorType, TLMC_PZ_StageProductId, TLMC_PZ_StatusBit, TLMC_PZ_TnaIoSignalOutputMode, TLMC_PZ_TnaIoSignalRangeType, TLMC_PZ_TnaIoSignalSourceBoostType, TLMC_PZ_TnaIoSignalSourceMode, TLMC_PZ_VoltageLimit, TLMC_PortType, TLMC_ScaleType, TLMC_SoftLimitOperatingMode, TLMC_StageAxis_AxisId, TLMC_StageAxis_TypeId, TLMC_StatusItemId, TLMC_StepperLoopParams_LoopMode, TLMC_TriggerModesForDcBrushless, TLMC_TriggerModesForStepper, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_ValueType +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorMotorChannel, TLMC_AnalogMonitorSystemVariable, TLMC_ButtonMode, TLMC_ConnectedProductAxisType, TLMC_ConnectedProductMovementType, TLMC_CurrentLoopPhase, TLMC_DeviceFamily, TLMC_DeviceType, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_IoPortMode, TLMC_IoPortSource, TLMC_IoTriggerPolarity, TLMC_IoTriggerPortNumber, TLMC_JogMode, TLMC_JogStopMode, TLMC_JoystickAxis, TLMC_JoystickDirectionSense, TLMC_JoystickModel, TLMC_JoystickSerialInterface, TLMC_KcubeIoTriggerMode, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickDirectionSense, TLMC_KcubeMmi_JoystickGear, TLMC_MonitorOutput, TLMC_PZ_IoTriggerMode, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_LnnxControlLoopParamsOverrideMode, TLMC_PZ_LnnxNotchFilterParamsOverrideMode, TLMC_PZ_NanoTrakAbsolutePowerAdjustType, TLMC_PZ_NanoTrakCircleDiameterMode, TLMC_PZ_NanoTrakGainControlMode, TLMC_PZ_NanoTrakPhaseCompensationMode, TLMC_PZ_NanoTrakRange, TLMC_PZ_NanoTrakRangeChangeType, TLMC_PZ_NanoTrakRangeMode, TLMC_PZ_NanoTrakStatusBit, TLMC_PZ_NanoTrakTrackingMode, TLMC_PZ_NanoTrakTrackingState, TLMC_PZ_NanoTrakUnderOverReadType, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_SensorType, TLMC_PZ_StageProductId, TLMC_PZ_StatusBit, TLMC_PZ_TnaIoSignalOutputMode, TLMC_PZ_TnaIoSignalRangeType, TLMC_PZ_TnaIoSignalSourceBoostType, TLMC_PZ_TnaIoSignalSourceMode, TLMC_PZ_VoltageLimit, TLMC_PortType, TLMC_ScaleType, TLMC_SoftLimitOperatingMode, TLMC_StageAxisId, TLMC_StageProductId, TLMC_StatusItemId, TLMC_StepperLoopParams_LoopMode, TLMC_TriggerModesForDcBrushless, TLMC_TriggerModesForStepper, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_ValueType BufLike: TypeAlias = ( ctypes.Array[ctypes.c_char] @@ -105,6 +105,7 @@ def current_loop_params(c_params: C_TLMC_CurrentLoopParams) -> TLMC_CurrentLoop params.integral_limit = c_params.integralLimit params.integral_dead_band = c_params.integralDeadBand params.feed_forward = c_params.feedForward + params.scaling_factor = c_params.scalingFactor; return params @@ -417,19 +418,6 @@ def profile_mode_params(c_params: C_TLMC_ProfileModeParams) -> TLMC_ProfileModeP return params - @staticmethod - def pz_io_trigger_params(c_params: C_TLMC_PZ_IoTriggerParams) -> TLMC_PZ_IoTriggerParams: - - params = TLMC_PZ_IoTriggerParams() - params.number_of_ports_per_channel = c_params.numberOfPortsPerChannel - params.port_number = TLMC_IoTriggerPortNumber(c_params.portNumber) - params.port_type = TLMC_PortType(c_params.portType) - params.mode = TLMC_PZ_IoTriggerMode(c_params.mode) - params.polarity = TLMC_IoTriggerPolarity(c_params.polarity) - params.trigger_parameter1 = c_params.triggerParameter1 - params.trigger_parameter2 = c_params.triggerParameter2 - - return params @staticmethod def pz_lnnx_control_loop_params(c_params: C_TLMC_PZ_LnnxControlLoopParams) -> TLMC_PZ_LnnxControlLoopParams: @@ -758,7 +746,8 @@ def status_item(c_params: C_TLMC_StatusItem) -> TLMC_StatusItem: def stage_axis_params(c_params: C_TLMC_StageAxisParams) -> TLMC_StageAxisParams: params = TLMC_StageAxisParams() - params.axis_id = TLMC_StageAxis_AxisId(c_params.axisId) + params.acceleration_scale = c_params.accelerationScale; + params.axis_id = TLMC_StageAxisId(c_params.axisId) params.counts_per_unit = c_params.countsPerUnit params.gear_box_ratio = c_params.gearBoxRatio params.max_acceleration = c_params.maxAcceleration @@ -766,9 +755,12 @@ def stage_axis_params(c_params: C_TLMC_StageAxisParams) -> TLMC_StageAxisParams: params.min_position = c_params.minPosition params.max_position = c_params.maxPosition params.max_velocity = c_params.maxVelocity + params.micro_steps = c_params.microSteps; params.part_number = MapNativeToPython.string(c_params.partNumber) + params.position_scale = c_params.positionScale; + params.product_id = TLMC_StageProductId(c_params.productId) params.serial_number = c_params.serialNumber - params.type_id = TLMC_StageAxis_TypeId(c_params.typeId) + params.velocity_scale = c_params.velocityScale; return params diff --git a/Python/XA/xa_source/src/thorlabs_xa/shared/map_python_to_native.py b/Python/XA/xa_source/src/thorlabs_xa/shared/map_python_to_native.py index 09c76d0..0e7124e 100644 --- a/Python/XA/xa_source/src/thorlabs_xa/shared/map_python_to_native.py +++ b/Python/XA/xa_source/src/thorlabs_xa/shared/map_python_to_native.py @@ -1,6 +1,6 @@ from ctypes import c_bool, c_char, c_double, c_int16, c_int32, c_longlong, c_uint16, c_uint32, c_uint8 -from thorlabs_xa.shared.c_params import C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_GeneralMoveParams, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_JoystickSettingsParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MonitorOutputParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_IoTriggerParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_LnnxControlLoopParams, C_TLMC_PZ_LnnxNotchFilterParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakEEPROMParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformLoopTableSample, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PZ_StageInfoParams, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_StageAxisParams, C_TLMC_StepperLoopParams, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_Value, C_TLMC_VelocityParams +from thorlabs_xa.shared.c_params import C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_GeneralMoveParams, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_JoystickSettingsParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MonitorOutputParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_LnnxControlLoopParams, C_TLMC_PZ_LnnxNotchFilterParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakEEPROMParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformLoopTableSample, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PZ_StageInfoParams, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_StageAxisParams, C_TLMC_StepperLoopParams, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_Value, C_TLMC_VelocityParams from thorlabs_xa.shared.params import TLMC_AnalogMonitorConfigurationParams, TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_CurrentLoopParams, TLMC_DcPidParams, TLMC_GeneralMoveParams, TLMC_HomeParams, TLMC_IoConfigurationParams, TLMC_IoTriggerParams, TLMC_JogParams, TLMC_JoystickParams, TLMC_JoystickSettingsParams, TLMC_KcubeIoTriggerParams, TLMC_KcubeMmiParams, TLMC_KcubePositionTriggerParams, TLMC_LcdDisplayParams, TLMC_LcdMoveParams, TLMC_LimitSwitchParams, TLMC_MonitorOutputParams, TLMC_MotorOutputParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PZ_IoTriggerParams, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_LnnxControlLoopParams, TLMC_PZ_LnnxNotchFilterParams, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_NanoTrakEEPROMParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_PZ_NanoTrakTrackThresholdParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformLoopTableSample, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_SlewRateParams, TLMC_PZ_StageInfoParams, TLMC_PositionLoopParams, TLMC_PotentiometerParams, TLMC_PowerParams, TLMC_ProfileModeParams, TLMC_StageAxisParams, TLMC_StepperLoopParams, TLMC_TrackSettleParams, TLMC_TriggerParamsForDcBrushless, TLMC_TriggerParamsForStepper, TLMC_Value, TLMC_VelocityParams MAPPING_STRING_ENCODING = 'utf-8' @@ -65,6 +65,7 @@ def current_loop_params(params: TLMC_CurrentLoopParams) -> C_TLMC_CurrentLoopPar c_params.integralLimit = c_uint16(params.integral_limit) c_params.integralDeadBand = c_uint16(params.integral_dead_band) c_params.feedForward = c_uint16(params.feed_forward) + c_params.scalingFactor = c_float(params.scaling_factor) return c_params @@ -364,20 +365,6 @@ def pz_kpc_io_trigger_params(params: TLMC_PZ_KpcIoTriggerParams) -> C_TLMC_PZ_Kp return c_params - @staticmethod - def pz_io_trigger_params(params: TLMC_PZ_IoTriggerParams) -> C_TLMC_PZ_IoTriggerParams: - - c_params = C_TLMC_PZ_IoTriggerParams() - c_params.numberOfPortsPerChannel = params.number_of_ports_per_channel - c_params.portNumber = c_uint16(int(params.port_number)) - c_params.portType = c_uint16(int(params.port_type)) - c_params.mode = c_uint16(int(params.mode)) - c_params.polarity = c_uint16(int(params.polarity)) - c_params.triggerParameter1 = params.trigger_parameter1 - c_params.triggerParameter2 = params.trigger_parameter2 - - return c_params - @staticmethod def pz_kpc_mmi_params(params: TLMC_PZ_KpcMmiParams) -> C_TLMC_PZ_KpcMmiParams: @@ -607,7 +594,7 @@ def value(params: TLMC_Value) -> C_TLMC_Value: def stage_axis_params(params: TLMC_StageAxisParams) -> C_TLMC_StageAxisParams: c_params = C_TLMC_StageAxisParams() - c_params.typeId = c_uint16(int(params.type_id)) + c_params.productId = c_uint16(int(params.product_id)) c_params.axisId = c_uint16(int(params.axis_id)) c_params.partNumber = MapPythonToNative.string(params.part_number) c_params.serialNumber = c_uint32(params.serial_number) @@ -618,6 +605,10 @@ def stage_axis_params(params: TLMC_StageAxisParams) -> C_TLMC_StageAxisParams: c_params.maxDecceleration = c_uint32(params.max_deceleration) c_params.maxVelocity = c_uint32(params.max_velocity) c_params.gearBoxRatio = c_uint16(params.gear_box_ratio) + c_params.microSteps = c_uint16(params.micro_steps) + c_params.positionScale = c_uint16(params.position_scale) + c_params.velocityScale = c_uint16(params.velocity_scale) + c_params.accelerationScale = c_uint16(params.acceleration_scale) return c_params diff --git a/Python/XA/xa_source/src/thorlabs_xa/shared/params.py b/Python/XA/xa_source/src/thorlabs_xa/shared/params.py index 65cc1f3..072a295 100644 --- a/Python/XA/xa_source/src/thorlabs_xa/shared/params.py +++ b/Python/XA/xa_source/src/thorlabs_xa/shared/params.py @@ -1,6 +1,6 @@ from typing import Sequence -from thorlabs_xa.shared.enums import TLMC_AnalogMonitorMotorChannel, TLMC_AnalogMonitorSystemVariable, TLMC_ButtonMode, TLMC_ConnectedProductAxisType, TLMC_ConnectedProductMovementType, TLMC_CurrentLoopPhase, TLMC_DeviceFamily, TLMC_DeviceType, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_IoPortMode, TLMC_IoPortSource, TLMC_IoTriggerPolarity, TLMC_IoTriggerPortNumber, TLMC_JogMode, TLMC_JogStopMode, TLMC_JoystickAxis, TLMC_JoystickDirectionSense, TLMC_JoystickModel, TLMC_JoystickSerialInterface, TLMC_KcubeIoTriggerMode, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickDirectionSense, TLMC_KcubeMmi_JoystickGear, TLMC_KcubeMmi_JoystickMode, TLMC_MonitorOutput, TLMC_PZ_IoTriggerMode, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_LnnxControlLoopParamsOverrideMode, TLMC_PZ_LnnxNotchFilterParamsOverrideMode, TLMC_PZ_NanoTrakAbsolutePowerAdjustType, TLMC_PZ_NanoTrakCircleDiameterMode, TLMC_PZ_NanoTrakGainControlMode, TLMC_PZ_NanoTrakPhaseCompensationMode, TLMC_PZ_NanoTrakRange, TLMC_PZ_NanoTrakRangeChangeType, TLMC_PZ_NanoTrakRangeMode, TLMC_PZ_NanoTrakStatusBit, TLMC_PZ_NanoTrakTrackingMode, TLMC_PZ_NanoTrakTrackingState, TLMC_PZ_NanoTrakUnderOverReadType, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_SensorType, TLMC_PZ_StageProductId, TLMC_PZ_StatusBit, TLMC_PZ_TnaIoOutRangeType, TLMC_PZ_TnaIoOutRouteType, TLMC_PZ_TnaIoSignalOutputMode, TLMC_PZ_TnaIoSignalRangeType, TLMC_PZ_TnaIoSignalSourceBoostType, TLMC_PZ_TnaIoSignalSourceMode, TLMC_PZ_VoltageLimit, TLMC_PortType, TLMC_ProfileMode, TLMC_SoftLimitOperatingMode, TLMC_StageAxis_AxisId, TLMC_StageAxis_TypeId, TLMC_StatusItemId, TLMC_StepperLoopParams_LoopMode, TLMC_TriggerModesForDcBrushless, TLMC_TriggerModesForStepper, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_ValueType +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorMotorChannel, TLMC_AnalogMonitorSystemVariable, TLMC_ButtonMode, TLMC_ConnectedProductAxisType, TLMC_ConnectedProductMovementType, TLMC_CurrentLoopPhase, TLMC_DeviceFamily, TLMC_DeviceType, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_IoPortMode, TLMC_IoPortSource, TLMC_IoTriggerPolarity, TLMC_IoTriggerPortNumber, TLMC_JogMode, TLMC_JogStopMode, TLMC_JoystickAxis, TLMC_JoystickDirectionSense, TLMC_JoystickModel, TLMC_JoystickSerialInterface, TLMC_KcubeIoTriggerMode, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickDirectionSense, TLMC_KcubeMmi_JoystickGear, TLMC_KcubeMmi_JoystickMode, TLMC_MonitorOutput, TLMC_PZ_IoTriggerMode, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_LnnxControlLoopParamsOverrideMode, TLMC_PZ_LnnxNotchFilterParamsOverrideMode, TLMC_PZ_NanoTrakAbsolutePowerAdjustType, TLMC_PZ_NanoTrakCircleDiameterMode, TLMC_PZ_NanoTrakGainControlMode, TLMC_PZ_NanoTrakPhaseCompensationMode, TLMC_PZ_NanoTrakRange, TLMC_PZ_NanoTrakRangeChangeType, TLMC_PZ_NanoTrakRangeMode, TLMC_PZ_NanoTrakStatusBit, TLMC_PZ_NanoTrakTrackingMode, TLMC_PZ_NanoTrakTrackingState, TLMC_PZ_NanoTrakUnderOverReadType, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_SensorType, TLMC_PZ_StageProductId, TLMC_PZ_StatusBit, TLMC_PZ_TnaIoOutRangeType, TLMC_PZ_TnaIoOutRouteType, TLMC_PZ_TnaIoSignalOutputMode, TLMC_PZ_TnaIoSignalRangeType, TLMC_PZ_TnaIoSignalSourceBoostType, TLMC_PZ_TnaIoSignalSourceMode, TLMC_PZ_VoltageLimit, TLMC_PortType, TLMC_ProfileMode, TLMC_SoftLimitOperatingMode, TLMC_StageAxisId, TLMC_StageProductId, TLMC_StatusItemId, TLMC_StepperLoopParams_LoopMode, TLMC_TriggerModesForDcBrushless, TLMC_TriggerModesForStepper, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_ValueType class TLMC_AnalogMonitorConfigurationParams(): def __init__(self): @@ -2585,8 +2585,8 @@ def status_bits(self, val: TLMC_PZ_StatusBit) -> None: class TLMC_StageAxisParams(): def __init__(self): - self._type_id = TLMC_StageAxis_TypeId.TLMC_StageAxisType_Unknown - self._axis_id = TLMC_StageAxis_AxisId.TLMC_StageAxisId_Unknown + self._product_id = TLMC_StageProductId.TLMC_StageProductId_Unknown + self._axis_id = TLMC_StageAxisId.TLMC_StageAxisId_Unknown self._part_number = "" self._serial_number = 0 self._counts_per_unit = 0 @@ -2596,21 +2596,25 @@ def __init__(self): self._max_deceleration = 0 self._max_velocity = 0 self._gear_box_ratio = 0 + self._micro_steps = 0 + self._position_scale = 0 + self._velocity_scale = 0 + self._acceleration_scale = 0 @property - def type_id(self) -> TLMC_StageAxis_TypeId: - return self._type_id + def product_id(self) -> TLMC_StageProductId: + return self._product_id - @type_id.setter - def type_id(self, val: TLMC_StageAxis_TypeId): - self._type_id = val + @product_id.setter + def product_id(self, val: TLMC_StageProductId): + self._product_id = val @property - def axis_id(self) -> TLMC_StageAxis_AxisId: + def axis_id(self) -> TLMC_StageAxisId: return self._axis_id @axis_id.setter - def axis_id(self, val: TLMC_StageAxis_AxisId): + def axis_id(self, val: TLMC_StageAxisId): self._axis_id = val @property @@ -2685,6 +2689,38 @@ def gear_box_ratio(self) -> int: def gear_box_ratio(self, val: int): self._gear_box_ratio = val + @property + def micro_steps(self) -> int: + return self._micro_steps + + @micro_steps.setter + def micro_steps(self, val: int): + self._micro_steps = val + + @property + def position_scale(self) -> float: + return self._position_scale + + @position_scale.setter + def position_scale(self, val: float): + self._position_scale = val + + @property + def velocity_scale(self) -> float: + return self._velocity_scale + + @velocity_scale.setter + def velocity_scale(self, val: float): + self._velocity_scale = val + + @property + def acceleration_scale(self) -> float: + return self._acceleration_scale + + @acceleration_scale.setter + def acceleration_scale(self, val: float): + self._acceleration_scale = val + class TLMC_TriggerParamsForStepper(): def __init__(self): @@ -2827,6 +2863,7 @@ def __init__(self): self._integral_limit = 0 self._integral_dead_band = 0 self._feed_forward = 0 + self._scaling_factor = 0 @property def phase(self) -> TLMC_CurrentLoopPhase: @@ -2876,6 +2913,13 @@ def feed_forward(self) -> int: def feed_forward(self, val: int): self._feed_forward = val + @property + def scaling_factor(self) -> float: + return self._scaling_factor + + @scaling_factor.setter + def scaling_factor(self, val: float): + self._scaling_factor = val class TLMC_PotentiometerParams: def __init__(self):