0% found this document useful (0 votes)
346 views73 pages

PSF MLX90365 1.14

Uploaded by

marco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
346 views73 pages

PSF MLX90365 1.14

Uploaded by

marco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

PTC04 - PSF - MLX90365

Product Specific Function description

M L X 9 0 3 65 P R O D U C T
S P E C I F IC F U N C T I O N S
S OFTWARE L IBRARY

PSF 90365 _ Rev 1.14


SKO 2013-09-13

PSF090365AAMLX Library Object Model 2013-09-13 -1-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

1 Contents
1 CONTENTS .............................................................................................................................................................. 2
2 INTRODUCTION .................................................................................................................................................... 4
3 SOFTWARE STRUCTURE .................................................................................................................................... 4
3.1 Object Model ...................................................................................................................................................... 4
3.2 Object Structure and Hierarchy .......................................................................................................................... 5
3.3 Objects with Interfaces ....................................................................................................................................... 5
4 PSF090365AAMLXMANAGER OBJECT ............................................................................................................ 6
4.1 Background ......................................................................................................................................................... 6
5 PSF090365AAMLXDEVICE OBJECT .................................................................................................................. 7
5.1 Background ......................................................................................................................................................... 7
5.2 Scope of the PSF090365AAMLXDevice object ................................................................................................ 8
5.3 SelectedDevice Property ..................................................................................................................................... 8
5.4 PTC04 Property .................................................................................................................................................. 9
5.5 Solver Property ................................................................................................................................................. 10
5.6 Advanced Property ........................................................................................................................................... 10
5.7 ReadFullDevice Method ................................................................................................................................... 11
5.8 ProgramDevice Method .................................................................................................................................... 12
5.9 GetEEParameterCode Method .......................................................................................................................... 12
5.10 SetEEParameterCode Method .......................................................................................................................... 13
5.11 GetEEParameterValue Method ......................................................................................................................... 14
5.12 SetEEParameterValue Method ......................................................................................................................... 14
5.13 GetVdd Method ................................................................................................................................................ 15
5.14 GetIdd Method .................................................................................................................................................. 16
5.15 Measure Method ............................................................................................................................................... 16
5.16 GetAngle Method ............................................................................................................................................. 17
5.17 GetAngleOut Method ....................................................................................................................................... 18
5.18 DeviceReplaced Method ................................................................................................................................... 19
5.19 ReadEEParametersFromIni Method ................................................................................................................. 19
6 PSF090365AAMLXSOLVER OBJECT ............................................................................................................... 21
6.1 Background ....................................................................................................................................................... 21
6.2 Scope ................................................................................................................................................................ 21
6.3 Solver procedure flow – 5 Points ...................................................................................................................... 23
6.4 Solver procedure flow – 17 Points .................................................................................................................... 24
6.5 CopySolverSettingsToParameters Method ....................................................................................................... 24
6.6 CharacterizeOutputDAC Method ..................................................................................................................... 25
6.7 DefineDPByMidPos Method ............................................................................................................................ 26
6.8 DefineDPByAngle Method............................................................................................................................... 27
6.9 SetCoordinate0 Method .................................................................................................................................... 27
6.10 SetCoordinateA Method ................................................................................................................................... 28
6.11 SetCoordinateB Method ................................................................................................................................... 29
6.12 SetCoordinateC Method ................................................................................................................................... 29
6.13 SetCoordinateD Method ................................................................................................................................... 30
6.14 SetCoordinateE Method .................................................................................................................................... 31
6.15 SetSlopeS0 Method........................................................................................................................................... 32
6.16 SetSlopeA Method ............................................................................................................................................ 32
6.17 SetSlopeB Method ............................................................................................................................................ 32
6.18 SetSlopeC Method ............................................................................................................................................ 32
6.19 SetSlopeD Method ............................................................................................................................................ 32
6.20 SetFirstFitPoint Method .................................................................................................................................... 32
6.21 SetNextFitPoint Method ................................................................................................................................... 33

PSF090365AAMLX Library Object Model 2013-09-13 -2-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.22 DeleteLastFitPoint Method ............................................................................................................................... 34


6.23 FitPoints Method .............................................................................................................................................. 34
6.24 SetClamping Method ........................................................................................................................................ 35
6.25 SetPWMT Method ............................................................................................................................................ 36
6.26 SetPowerSaving Method................................................................................................................................... 36
6.27 Memlock Method.............................................................................................................................................. 37
7 PSF090365AAMLXADVANCED OBJECT......................................................................................................... 38
7.1 Background ....................................................................................................................................................... 38
7.2 Scope of the PSF090365AAMLXAdvanced object ......................................................................................... 38
7.3 SetVdd Method ................................................................................................................................................. 38
7.4 SetVBat Method ............................................................................................................................................... 39
7.5 SelectDevice Method ........................................................................................................................................ 39
7.6 GetSetting Method ............................................................................................................................................ 40
7.7 SetSetting Method ............................................................................................................................................ 40
7.8 SettingInUse Property ....................................................................................................................................... 41
7.9 GetSolverSetting Method ................................................................................................................................. 42
7.10 SetSolverSetting Method .................................................................................................................................. 43
7.11 SolverSettingInUse Property ............................................................................................................................ 44
7.12 OpenProfile Method ......................................................................................................................................... 45
7.13 SaveProfile Method .......................................................................................................................................... 45
7.14 SaveProfileAs Method ...................................................................................................................................... 46
7.15 ReadFullRAM Method ..................................................................................................................................... 46
7.16 ProgramRAM Method ...................................................................................................................................... 47
7.17 GetRAMParameter Method .............................................................................................................................. 48
7.18 SetRAMParameter Method............................................................................................................................... 48
7.19 GetRAMParameterDirect Method .................................................................................................................... 49
7.20 SetRAMParameterDirect Method ..................................................................................................................... 50
7.21 MemWriteWithCRC Method............................................................................................................................ 50
7.22 MemWrite Method ........................................................................................................................................... 52
7.23 MemRead Method ............................................................................................................................................ 53
7.24 MemReadSafe Method ..................................................................................................................................... 53
7.25 ReadData Method ............................................................................................................................................. 54
7.26 WriteData Method ............................................................................................................................................ 55
7.27 SetDBMux Method ........................................................................................................................................... 56
7.28 HotReset Method (obsoleted) ........................................................................................................................... 57
7.29 NopAlive Method ............................................................................................................................................. 57
7.30 DisconnectDevice Method ................................................................................................................................ 58
7.31 CheckCRC Method ........................................................................................................................................... 58
7.32 Logging Property .............................................................................................................................................. 59
7.33 ChipVersion Property ....................................................................................................................................... 60
7.34 ReadChipVersion Method ................................................................................................................................ 61
8 ENUMERATION CONSTANTS .......................................................................................................................... 62
8.1 ParamCodesEEPROM enumeration ................................................................................................................. 62
8.2 ParamCodesRAM enumeration ........................................................................................................................ 68
8.3 MeasureParameters enumeration ...................................................................................................................... 69
8.4 MeasureTypes enumeration .............................................................................................................................. 69
8.5 SettingCodes enumeration ................................................................................................................................ 69
8.6 SolverSettingCodes enumeration ...................................................................................................................... 70
9 HISTORY RECORDS ........................................................................................................................................... 72
10 DISCLAIMER .................................................................................................................................................... 72

PSF090365AAMLX Library Object Model 2013-09-13 -3-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

2 Introduction
PSF090365AAMLX is MS Windows software library, which meets the requirements for a Product Specific
Functions (PSF) module, defined in Melexis Programmable Toolbox (MPT) object model. The library
implements in-process COM objects for interaction with MLX90365 firmware for Melexis PTC04 programmers.
It is designed primarily to be used by MPT Framework application, but also can be loaded as a standalone in-
process COM server by other applications that need to communicate with the above-mentioned Melexis
products.
The library can be utilized in all programming languages, which support ActiveX automation. This gives great
flexibility in designing the application with the only limitation to be run on MS Windows OS. In many scripting
languages, objects can be directly created and used. In others, though, the first step during implementation is to
include the library in your project. The way it can be done depends on the programming language and the
specific Integrated Development Environment (IDE) used:
 in C++ it can be imported by #import directive
 in Visual Basic it either can be directly used as pure Object or added as a reference to the project
 in C# it has to be added as a reference to the project
 in NI LabView, for each Automation refnum the corresponding ActiveX class has to be selected
 in NI LabWindows an ActiveX Controller has to be created

3 Software Structure

3.1 Object Model


MPT object model specifies that a PSF module must expose two COM objects which implement certain COM
interfaces. MLX90365 PSF implements these two objects and two additional objects for advanced operations.

 PSF090365AAMLXManager object – implements IPSFManager standard MPT interface. This is a


standard PSFManager object. MPT Framework and other client applications create a temporary instance
of that object, just for device scanning procedure. After that this instance is released.
This is the first required object. Refer to MPT Developer Reference document for more information about
PSFManager object and IPSFManager interface.
 PSF090365AAMLXDevice object – implements IPSF090365AAMLXDevice specific interface.
However, this interface derives from IMPTDevice standard MPT interface and therefore
PSF090365AAMLXDevice also implements the functionality of MPTDevice standard MPT object. In
addition to standard IMPTDevice methods, IPSF090365AAMLXDevice interface exposes methods,
which are specific to this library. They are described in this document.
This is the second required COM object. Refer to MPT Developer Reference document for more
information about MPTDevice object and IMPTDevice interface.
 PSF090365AAMLXAdvanced object – implements IPSF090365AAMLXAdvanced library specific
interface. This object implements advanced functions that would be rarely used in order to perform
specific operations not available with the standard device functions. In general, most of the methods of
that object provide direct access to MLX90365 firmware commands implemented in PTC04 programmer.

 PSF090365AAMLXSolver object - implements IPSF090365AAMLXSolver library specific interface.


This object provides methods to easy tune your product in your application

PSF090365AAMLX Library Object Model 2013-09-13 -4-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

3.2 Object Structure and Hierarchy

PSF090365AAMLXManager

PSF090365AAMLXDevice

Solver PSF090365AAMLXSolver

Advanced PSF090365AAMLXAdvanced

PTC04 PTC04PSFDevice

3.3 Objects with Interfaces

IPSF090365AAMLXDevice IMPTDevice
IPSFManager

IDispatch
IDispatch ISupportErrorInfo
PSF090365AAMLX PSF090365AAMLX
Manager Device ISpecifyPropertyPages
ISupportErrorInfo IPersist

IPSF090365AAMLXSolver IPSF090365AAMLXAdvanced
PSF090365AAMLX ISupportErrorInfo PSF090365AAMLX ISupportErrorInfo
Solver Advanced
IDispatch IDispatch

IPTC04PSFDevice IMPTDevice

IDispatch
ISupportErrorInfo
PTC04PSF
Device ISpecifyPropertyPages
IPersist

PSF090365AAMLX Library Object Model 2013-09-13 -5-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

4 PSF090365AAMLXManager Object

4.1 Background
This object is created only once and is destroyed when the library is unmapped from process address space. Each
subsequent request for this object returns the same instance.
PSF090365AAMLXManager object implements standard MPT category
CATID_MLXMPTPSFSerialModule, which is required for automatic device scanning. C++ standalone client
applications can create an instance of this object by using the standard COM API CoCreateInstance with class ID
CLSID_PSF090365AAMLXManager, or ProgID “MPT. PSF090365AAMLXManager”:
hRes = ::CoCreateInstance(CLSID_PSF090365AAMLXManager, NULL, CLSCTX_INPROC,
IID_IPSFManager, (void**) &pPSFMan);
Visual Basic applications should call CreateObject function to instantiate PSF090365AAMLXManager:
Set PSFMan = CreateObject(“MPT. PSF090365AAMLXManager”)
The primary objective of this instantiation is to call ScanStandalone method. C++:
hRes = pPSFMan->ScanStandalone(dtSerial, varDevices, &pDevArray);
Or in Visual Basic:
Set DevArray = PSFMan.ScanStandalone(dtSerial)
ScanStandalone function returns collection of PSF090365AAMLXDevice objects, one for each connected PTC-
04 programmer. The collection is empty if there are no connected programmers.

PSF090365AAMLX Library Object Model 2013-09-13 -6-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

5 PSF090365AAMLXDevice Object

5.1 Background
This object implements standard MPT category CATID_MLXMPTPSFSerialDevice as well as library specific
CATID_MLXMPT90365PTC04Device category. It also declares required specific category
CATID_MLXMPT90365PTC04UIModule for identification of required user interface modules.
This object can be created directly with CoCreateInstance/CreateObject or by calling the device scanning
procedure ScanStandalone of PSF090365AAMLXManager object. The following Visual Basic subroutine shows
how to instantiate PSF090365AAMLXDevice object by performing device scan on the system:
Sub CreateDevice()
Dim PSFMan As PSF090365AAMLXManager, DevicesCol As ObjectCollection, I As Long
On Error GoTo lError

Set PSFMan = CreateObject("MPT.PSF090365AAMLXManager")


Set DevicesCol = PSFMan.ScanStandalone(dtSerial)
If DevicesCol.Count <= 0 Then
MsgBox ("No PTC-04 programmers found!")
Exit Sub
End If

' Dev is a global variable of type PSF090365AAMLXDevice


‘ Select first device from the collection
Set Dev = DevicesCol(0)
MsgBox (Dev.Name & " device found on " & Dev.Channel.Name)
If DevicesCol.Count > 1 Then
For I = 1 To DevicesCol.Count - 1
' We are responsible to call Destroy(True) on the device objects we do not need
Call DevicesCol(I).Destroy(True)
Next I
End If
Exit Sub

lError:
MsgBox Err.Description
Err.Clear
End Sub

Developers can also manually connect the device object to a serial channel object thus bypassing standard device
scanning procedure. The following Visual Basic subroutine allows manual connection along with standard
device scanning depending on input parameter bAutomatic:
Sub CreateDevice(bAutomatic As Boolean)
Dim PSFMan As PSF090365AAMLXManager, DevicesCol As ObjectCollection, I As Long
Dim CommMan As CommManager, Chan As MPTChannel
On Error GoTo lError

If bAutomatic Then
' Automatic device scanning begins here
Set PSFMan = CreateObject("MPT.PSF090365AAMLXManager")
Set DevicesCol = PSFMan.ScanStandalone(dtSerial)
If DevicesCol.Count <= 0 Then
MsgBox ("No PTC-04 programmers found!")
Exit Sub
End If

If DevicesCol.Count > 1 Then


For I = 1 To DevicesCol.Count - 1
'We are responsible to call Destroy(True) on device objects we do not need
Call DevicesCol(I).Destroy(True)
Next I
End If
Set MyDev = DevicesCol(0)
Else
' Manual connection begins here

PSF090365AAMLX Library Object Model 2013-09-13 -7-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Set CommMan = CreateObject("MPT.CommManager")


Set MyDev = CreateObject("MPT.PSF090365AAMLXDevice")
I = ActiveWorkbook.Names("SerialPort").RefersToRange.Value2
Set Chan = CommMan.Channels.CreateChannel(CVar(I), ctSerial)
MyDev.Channel = Chan
' Check if a PTC04 programmer is connected to this channel
Call MyDev.CheckSetup(False)
End If
MsgBox (MyDev.Name & " programmer found on " & MyDev.Channel.Name)
Exit Sub

lError:
MsgBox Err.Description
Err.Clear
End Sub

PSF090365AAMLXDevice object implements IMPTDevice standard MPT interface. Please refer to MPT
Developer reference document for description of the properties and methods of this interface.
In addition PSF090365AAMLXDevice object implements IPSF090365AAMLXDevice library specific
interface, which derives from IMPTDevice. The following is a description of its properties and methods.

5.2 Scope of the PSF090365AAMLXDevice object


This object supports all needs for a standard user.
With these basic functions, you’re able to discover this Melexis Product.

5.3 SelectedDevice Property

5.3.1 Description
Specifies what die to be used by subsequent operations: It’s a soft switch, meaning that there is not an immediate
action visible on hardware.
All functions implemented in the library use the SelectedDevice property to determine what die (A or B) you‘re
working with. It also concerns settings as for example SetParameter.

DEFAULT: when never used, die A is selected.

5.3.2 Syntax

Visual Basic:
Property SelectedDevice as Long

C++:
HRESULT get_SelectedDevice(/*[out,retval]*/ int* pValue);
HRESULT set_SelectedDevice(/*[in]*/ int Value);

5.3.3 Parameters

Value
A int specifying new value for the property. 1 selects die A and 2 selects die B.

pValue
An address of int variable that receives current value of the property. 1 specifies that die A is currently
selected and 2 specifies that die B is currently selected.

PSF090365AAMLX Library Object Model 2013-09-13 -8-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

5.3.4 Return value

Visual Basic:
1 if die A is currently selected or 2 if die B is currently selected.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pValue contains valid number.
Any other error code The operation failed.

5.4 PTC04 Property

5.4.1 Description
This property holds a reference to PTC04PSFDevice co-object.

5.4.2 Syntax

Visual Basic:
Property PTC04 as Object

C++:
HRESULT get_PTC04(/*[out][retval]*/ LPDISPATCH* pVal);
HRESULT set_PTC04(/*[in]*/ LPDISPATCH Value);

5.4.3 Parameters

Value
An IDispatch* specifying new PTC04 object. Nothing happens if the object is the same instance as the
existing one. Otherwise PSF090365AAMLXDevice object releases its current PTC04 object and connects
to the new one. This also includes replacing of the communication Channel object with the one from the
new PTC04 object.

pVal
Address of IDispatch* pointer variable that receives the interface pointer to the PTC04 device object. If
the invocation succeeds, the caller is responsible for calling IUnknown::Release() on the pointer when it
is no longer needed.

5.4.4 Return value

Visual Basic:
A reference to the PTC04 co-object.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains valid pointer.
Any other error code The operation failed. *pVal contains NULL.

PSF090365AAMLX Library Object Model 2013-09-13 -9-


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

5.5 Solver Property

5.5.1 Description

This is a read-only property which returns a reference to PSF090365AAMLXSolver co-object.

5.5.2 Syntax

Visual Basic:
Property Solver as Object
Read only

C++:
HRESULT get_Solver(/*[out][retval]*/ IPSF090365AAMLXSolver** pVal);

5.5.3 Parameters

pVal
Address of IPSF090365AAMLXSolver* pointer variable that receives the interface pointer to the Solver
object. If the invocation succeeds, the caller is responsible for calling IUnknown::Release() on the
pointer when it is no longer needed.

5.5.4 Return value

Visual Basic:
A reference to the Solver co-object.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid pointer.
Any other error code The operation failed. *pVal contains NULL.

5.6 Advanced Property

5.6.1 Description

This is a read-only property which returns a reference to PSF090365AAMLXAdvanced co-object.

5.6.2 Syntax

Visual Basic:
Property Advanced as Object
Read only

C++:
HRESULT get_Advanced(/*[out][retval]*/ IPSF090365AAMLXAdvanced* pVal);

PSF090365AAMLX Library Object Model 2013-09-13 - 10 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

5.6.3 Parameters

pVal
Address of IPSF090365AAMLXAdvanced* pointer variable that receives the interface pointer to the
Advanced object. If the invocation succeeds, the caller is responsible for calling IUnknown::Release()
on the pointer when it is no longer needed.

5.6.4 Return value

Visual Basic:
A reference to the Advanced co-object.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid pointer.
Any other error code The operation failed. *pVal contains NULL.

5.7 ReadFullDevice Method

5.7.1 Description
Reads the whole EEPROM of MLX90365. Updates the internal EEPROM cache with values taken from the
chip. This method is provided to speed up the performance because it updates the whole cache with a single
command.
Tip: Use the CheckCRC method to validate if the received EERPOM data is not corrupted.

5.7.2 Syntax

Visual Basic:
Sub ReadFullDevice()

C++:
HRESULT ReadFullDevice();

5.7.3 Parameters

None

5.7.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 11 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

5.8 ProgramDevice Method

5.8.1 Description
Writes the whole EEPROM of MLX90365. Takes the values from the internal EEPROM cache.
Only the variables that are modified will be programmed.

5.8.2 Syntax

Visual Basic:
Sub ProgramDevice()

C++:
HRESULT ProgramDevice();

5.8.3 Parameters

None

5.8.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

5.9 GetEEParameterCode Method

5.9.1 Description
Returns the code of a particular EEPROM parameter as it is represented in EEPROM. It is optimized because it
uses the EEPROM cache maintained by the library. ReadFullDevice method could be called before calling
GetEEParameterCode to update the whole cache. However GetEEParameterCode works correctly even if
ReadFullDevice is not called.

5.9.2 Syntax

Visual Basic:
Function GetEEParameterCode(paramID as ParamCodesEEPROM)

C++:
HRESULT GetEEParameterCode(/*[in]*/ ParamCodesEEPROM paramID, /*[out,retval]*/
TVariant* pVal);

5.9.3 Parameters

paramID

PSF090365AAMLX Library Object Model 2013-09-13 - 12 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.

pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed. The values are represented
as bytes or unsigned integers depending on the parameter.

5.9.4 Return value

Visual Basic:
A Variant containing the code of an EEPROM parameter.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is Empty.

5.10 SetEEParameterCode Method

5.10.1 Description
Changes the code of a particular EEPROM parameter. The method works with the EEPROM cache maintained
by the library.
ProgramDevice method must be called in order to update the EEPROM of the chip with the codes from the
cache.

5.10.2 Syntax

Visual Basic:
Sub SetEEParameterCode(paramID as ParamCodesEEPROM, Value)

C++:
HRESULT SetEEParameterCode(/*[in]*/ ParamCodesEEPROM paramID, /*[in]*/
TVariantInParam Value);

5.10.3 Parameters

paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.

Value
A VARIANT containing new code for the parameter.

5.10.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning

PSF090365AAMLX Library Object Model 2013-09-13 - 13 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

S_OK The operation completed successfully.


Any other error code The operation failed.

5.11 GetEEParameterValue Method

5.11.1 Description
Returns the translated value of a particular EEPROM parameter. It first calls GetEEParameterCode method
and then translates the code of the parameter into a suitable value. For example, the parameter ALPHAX is
translated into a floating point number which represents degrees.
Translation is not defined for all parameters and this method returns an error if it receives paramID which is not
supported.

5.11.2 Syntax

Visual Basic:
Function GetEEParameterValue(paramID as ParamCodesEEPROM)

C++:
HRESULT GetEEParameterValue(/*[in]*/ ParamCodesEEPROM paramID, /*[out,retval]*/
TVariant* pVal);

5.11.3 Parameters

paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.

pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.

5.11.4 Return value

Visual Basic:
A Variant containing the translated value of an EEPROM parameter.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is Empty.

5.12 SetEEParameterValue Method

5.12.1 Description
Changes the value of a particular EEPROM parameter. It first translates the value to a corresponding code and
then calls SetEEParameterCode method to modify the parameter in the cache. For example, this method

PSF090365AAMLX Library Object Model 2013-09-13 - 14 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

expects the parameter ALPHAX to be a floating point number which will be translated into a 2-byte code which
can be stored into the EEPROM.
Translation is not defined for all parameters and this method returns an error if it receives paramID which is not
supported.
ProgramDevice method must be called in order to update the EEPROM of the chip with the codes from the
cache.

5.12.2 Syntax

Visual Basic:
Sub SetEEParameter(paramID as ParamCodesEEPROM, Value)

C++:
HRESULT SetEEParameter(/*[in]*/ ParamCodesEEPROM paramID, /*[in]*/
TVariantInParam Value);

5.12.3 Parameters

paramID
A ParamCodesEEPROM constant specifying the ID of the EEPROM parameter.

Value
A VARIANT containing new value for the parameter.

5.12.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

5.13 GetVdd Method

5.13.1 Description
Measures the VDD value of the selected device. Returns the value in a calibrated Voltage signal.

5.13.2 Syntax

Visual Basic:
Function GetVdd() as Single

C++:
HRESULT GetVdd(/*[out,retval]*/ float* pVal);

5.13.3 Parameters

PSF090365AAMLX Library Object Model 2013-09-13 - 15 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

pVal
An address of float variable that will receive the return value of the method.

5.13.4 Return value

Visual Basic:
A Single containing the VDD value of the selected device.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is zero.

5.14 GetIdd Method

5.14.1 Description
Measures the IDD value of the selected device.

5.14.2 Syntax

Visual Basic:
Function GetIdd() as Single

C++:
HRESULT GetIdd(/*[out,retval]*/ float* pVal);

5.14.3 Parameters

pVal
An address of float variable that will receive the return value of the method.

5.14.4 Return value

Visual Basic:
A Single containing the IDD value of the selected device.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is zero.

5.15 Measure Method

5.15.1 Description
Measures the resp. signal on the selected device and returns the value in %VDD or Absolute value or PWM. It is
important the relays controlling PWM or Voltage measurements (bits 2 and 3 of DB-IO byte accordingly for
DieA and DieB; PWM is on when the bit=1) to be properly set in advance. This can be done by the following
code fragments:
Visual Basic:

PSF090365AAMLX Library Object Model 2013-09-13 - 16 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

btDBIO = PTC.GetDBIO
If bPWM Then
btDBIO = btDBIO Or 4 Or 8
Else
btDBIO = btDBIO And (Not (4 Or 8))
End If
Call PTC.SetDBIO(btDBIO)

C++:
pPTC->GetDBIO(&btDBIO);
if (bPWM)
btDBIO |= (1 << 2) | (1 << 3);
else
btDBIO &= ~((1 << 2) | (1 << 3));
pPTC->SetDBIO(btDBIO);

5.15.2 Syntax

Visual Basic:
Function Measure(paramOut as MeasureParameters, paramType as MeasureTypes) as Single

C++:
HRESULT Measure(/*[in]*/ MeasureParameters paramOut, /*[in]*/ MeasureTypes
paramType, /*[out,retval]*/ float* pVal);

5.15.3 Parameters

paramID
A MeasureParameters constant specifying the output to measure.

paramID
A MeasureTypes constant specifying the type of measurement.

pVal
An address of float variable that will receive the return value of the method.

5.15.4 Return value

Visual Basic:
A Single containing the result of measurement.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is zero.

5.16 GetAngle Method

5.16.1 Description
Looks into the RAM, gets THETAR2P and returns an angle based on this value with respect to EE_DP and
EE_CCW parameters.

PSF090365AAMLX Library Object Model 2013-09-13 - 17 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

5.16.2 Syntax

Visual Basic:
Function GetAngle() as Single

C++:
HRESULT GetAngle(/*[out,retval]*/ float* pfAngle);

5.16.3 Parameters

pfAngle
An address of float variable that will receive the return value of the method in Degrees.

5.16.4 Return value

Visual Basic:
A Single containing the angle in Degrees.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pfAngle contains a valid value.
Any other error code The operation failed. *pfAngle is zero.

5.17 GetAngleOut Method

5.17.1 Description
Looks into the RAM, gets digital output THETAOUT and returns a corresponding value in %VDD.

5.17.2 Syntax

Visual Basic:
Function GetAngleOut() as Single

C++:
HRESULT GetAngleOut(/*[out,retval]*/ float* pfValue);

5.17.3 Parameters

pfValue
An address of float variable that will receive the return value of the method in %VDD.

5.17.4 Return value

Visual Basic:
A Single containing the return value in %VDD.

PSF090365AAMLX Library Object Model 2013-09-13 - 18 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pfValue contains a valid value.
Any other error code The operation failed. *pfValue is zero.

5.18 DeviceReplaced Method

5.18.1 Description
Informs the object that the sensor is replaced and the EEPROM cache and some internal variables should be
invalidated. Only the selected device is taken into account.

5.18.2 Syntax

Visual Basic:
Sub DeviceReplaced()

C++:
HRESULT DeviceReplaced();

5.18.3 Parameters

None

5.18.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

5.19 ReadEEParametersFromIni Method

5.19.1 Description
This method reads EEPROM parameter values from INI file and stores them in the internal PC cache. Two
sections from the INI file will be scanned “[EEPROM Parameter Values]“ and “[EEPROM Parameter Codes]”.
Entries in the former section must be “parameter_name=float_value” and must have translation value defined in
ParamCodesEEPROM table. Entries in the later section must be “parameter_name=decimal_value” or
“parameter_name=0xhexadecimal_value”. If a parameter exists in both sections, its value will be taken from
“[EEPROM Parameter Values]” section. Parameters, which names are not defined for the current ChipVersion
will be skipped.
Here is an example of such an INI file:
...
[EEPROM Parameter Values]
LNRAX = 12.5

[EEPROM Parameter Codes]

PSF090365AAMLX Library Object Model 2013-09-13 - 19 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

GAINMIN = 0
GAINMAX = 0x1A
...

ProgramDevice method must be called in order to update the EEPROM of the chip with the codes from the
cache.

5.19.2 Syntax

Visual Basic:
Sub ReadEEParametersFromIni(IniFileName As String, [OnlyFullWords As Boolean = False])

C++:
HRESULT ReadEEParametersFromIni(/*[in]*/ BSTR IniFileName, /*[in,defaultvalue(0)]*/
VARIANT_BOOL OnlyFullWords);

5.19.3 Parameters

IniFileName
A String, specifying the full path to an INI file, containing the parameters to set.

OnlyFullWords
A Boolean specifying if only parameters, which occupy full 16 bit word from EEPROM must be read
(True case). This will avoid eventual reading of EEPROM, which would happen if this parameter is
False and in the INI file there are parameters, which occupy only few bits from an EEPROM word.
Hence, with the True case it’s possible to program EEPROM of an IC without reading it.

5.19.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 20 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6 PSF090365AAMLXSolver Object

6.1 Background
This object cannot be created directly; it is only accessible as “Solver” property of PSF090365AAMLXDevice
object.
PSF090365AAMLXSolver object implements IPSF090365AAMLXSolver library specific interface. The
following is a description of its methods.

6.2 Scope
This object provides services to easy tune your product in your application.

When these functions are not fully serving your needs, you can check with your application contact into Melexis
how to get support.
Note: By using the PSF090365AAMLXDevice object, you’re always able to do everything what you want.

2D application : 4 points + 5 slopes

It is possible to use the second solver method and use two, three, four or five calibration points for defining the transfer
curve of the IC.
The first calibration point is always point 0, which is only used to calculate the slope to the second
Use method SetCoordinate0, SetCoordinateA, SetCoordinateB, SetCoordinateC, SetCoordinateD and SetCoordinateE
to calibrate the device.

Vout
100%
Diagnostic Area
Clamp high D
(CH)

C SC
CY

B SB
BY

AY A SA
S0

Clamp low 0
(CL)
0% Ax Bx Diagnostic Area Cx
Angular position or

3 rd calibration point :

4 th calibration point :

5 th calibration point :
2 nd calibration point :
1 st calibration point :

Position C

Position D
Position B
Position A
Position 0

Figure 6-1 : 4 point / 5 slopes application solver

PSF090365AAMLX Library Object Model 2013-09-13 - 21 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

2D application : 17 points + 16 slopes

In the EEPRROM of 90365, a 16 slopes / 17 point output characteristic can be defined.


The starting point of the output characteristic is @ 0 deg , which can be modified by the 8 bit discontinuity Point, and
the angular distance between 2 points is defined by 360 deg /16 = 22.5 deg.
After the calculation of the output, the programmable clamping levels define the min/max output level.

Figure 6-2 : 17 point / 16 slopes application solver

PSF090365AAMLX Library Object Model 2013-09-13 - 22 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.3 Solver procedure flow – 5 Points

Connect PTC-04

SetCoordinateA

Select Device Extra point ?


NOP or contact test
Device replaced Yes
Chipversion
Readback
SetCoordinateB
Check CRC

Extra point ?
No
Solversetting Yes

SetCoordinateC

Maunually Automatic
Extra point ?
NoNo
SetSolversetting Load profile
Yes

SetCoordinateD

Copy SolverSetting to Partameters Extra point ? No

Yes

SetCoordinateE
DefineDPByAngle

Extra
parameters ?

Analog mode ?
Yes

Yes Setparameter
No
Characterize Output DAC
No

Program device

SetCoordinate0
Check device

PSF090365AAMLX Library Object Model 2013-09-13 - 23 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.4 Solver procedure flow – 17 Points

Connect PTC-04

Select Device
NOP or contact test
Device replaced
CHIPVERSION
Readback
Check CRC

Extra point ?

Solversetting
Yes

SetNextFitPoint
Maunually Automatic
No

SetSolversetting Load profile

FitPoints

Copy SolverSetting to Partameters

DefineDPByAngle
Extra
parameters ?

Yes
Analog mode ?

Setparameter
Yes No

Characterize Output DAC


No

Program device

SetFirstFitPoint
Check

6.5 CopySolverSettingsToParameters Method

6.5.1 Description
Copies all Solver settings (without Solver targets) to corresponding parameters in the EEPROM cache. Thus, a
client application could use just a profile to read the settings, optionally modify some of them and then do
CopySolverSettingsToParameters to set them in the EEPROM cache. This method should be called before
CharacterizeOutputDAC and SetMinGain methods.

6.5.2 Syntax

Visual Basic:
Sub CopySolverSettingsToParameters()

PSF090365AAMLX Library Object Model 2013-09-13 - 24 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

C++:
HRESULT CopySolverSettingsToParameters();

6.5.3 Parameters

None

6.5.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.6 CharacterizeOutputDAC Method

6.6.1 Description
With this method, you can measure and calculate coefficients (OutputDacGain;OutputDacOffset) for level
correction of OUT1 and OUT2. The following is a detailed description of the steps:

1. Set Clamp Low\High to 5% and measure both outputs


2. Set Clamp Low\High to 95% and measure both outputs
3. Calculate to get OutputDacGain and OutputDacOffset for both outputs
4. Set Clamp low = 0% and Clamp high = 100%

All subsequent calls to SetEEParameterValue method will calculate the level value to store in the EEPROM by
using the following formula:

DAC_Value_EEPROM [%VDD] = Requested_DAC_Value [%VDD] * Gain + Offset

All subsequent calls to GetEEParameterValue method will calculate the level value from that in the EEPROM
by using the following formula:

Returned_DAC_Value [%VDD] = (DAC_Value_EEPROM [%VDD] – Offset) / Gain

NOTE: Also for all solver functions, only the selected die is taken in account!
NOTE: Gain and Offset coefficients can be read or write directly with GetSolverSetting and SetSolverSetting
functions, using setting codes SolverSettingOutput1DACGain, SolverSettingOutput1DACOffset,
SolverSettingOutput2DACGain and SolverSettingOutput2DACOffset
NOTE: Gain and Offset coefficients can be set to 1.0 and 0.0 respectively with a call to DeviceReplaced
method

6.6.2 Syntax

Visual Basic:
Sub CharacterizeOutputDAC()

C++:

PSF090365AAMLX Library Object Model 2013-09-13 - 25 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

HRESULT CharacterizeOutputDAC();

6.6.3 Parameters

None

6.6.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.7 DefineDPByMidPos Method

6.7.1 Description
Reads current THETAR2P from the RAM of the device, calculates DP so that current position to correspond to
180 deg and stores it into EE_DP parameter.

6.7.2 Syntax

Visual Basic:
Function DefineDPByMidPos() as Single

C++:
HRESULT DefineDPByMidPos (/*[out,retval]*/ float* pDP);

6.7.3 Parameters

pDP
An address of Single variable receiving the calculated DP.

6.7.4 Return value

Visual Basic:
A Single containing the calculated DP.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 26 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.8 DefineDPByAngle Method

6.8.1 Description
Reads current THETAR2P from the RAM of the device, calculates DP so that current position to correspond to
the given angle and stores it into EE_DP parameter.

6.8.2 Syntax

Visual Basic:
Function DefineDPByAngle(Angle as Single) as Single

C++:
HRESULT DefineDPByAngle (/*[in]*/ float Angle, /*[out,retval]*/ float* pDP);

6.8.3 Parameters

Angle
A Single specifying the angle in [deg] for the current position.

pDP
An address of Single variable receiving the calculated DP.

6.8.4 Return value

Visual Basic:
A Single containing the calculated DP.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.9 SetCoordinate0 Method

6.9.1 Description
When the mechanical position is set to position 0, this function will make the INITIALISATION for solving this
device.

Actions:
* This function will only measure and remember the current angle in order to use it later in SetCoordinateA
method.

NOTE: Also for all solver functions, only the selected device is taken into account!

6.9.2 Syntax

Visual Basic:

PSF090365AAMLX Library Object Model 2013-09-13 - 27 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Sub SetCoordinate0(Level as Single)

C++:
HRESULT SetCoordinate0(/*[in]*/ float Level);

6.9.3 Parameters

Level
A Single specifying Y coordinate for the current position in %VDD (from 0.0 to 100.0).

6.9.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.10 SetCoordinateA Method

6.10.1 Description
This method is called when the mechanical position is set to position A. It will treat next action:

Actions:
* This function will measure the current angle and use it to find out if the slope is positive or negative.
* It will store the X and Y coordinates of point A to the device
* It will clear (means FFFF) the coordinates for point B, C, D
* It will calculate slope 0 (before A) and copy it for all the slopes.

NOTE: Also for all solver functions, only the selected device is taken into account!

6.10.2 Syntax

Visual Basic:
Sub SetCoordinateA(Level as Single)

C++:
HRESULT SetCoordinateA(/*[in]*/ float Level);

6.10.3 Parameters

Level
A Single specifying Y coordinate of point A in %VDD (from 0.0 to 100.0).

6.10.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:

PSF090365AAMLX Library Object Model 2013-09-13 - 28 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Return value Meaning


S_OK The operation completed successfully.
Any other error code The operation failed.

6.11 SetCoordinateB Method

6.11.1 Description
This method is called when the mechanical position is set to position B. It will treat next action:

* This gets the current angle by asking the device for it


* It will store the X and Y coordinates of point B to the device
* It will calculate the Slope for A and copy it to the slope for B and C

NOTE: Also for all solver functions, only the selected device is taken in account!
NOTE: If this step is not executed, no problem will appear. This can happen in the case of a two points solver.

6.11.2 Syntax

Visual Basic:
Sub SetCoordinateB(Level as Single)

C++:
HRESULT SetCoordinateB(/*[in]*/ float Level);

6.11.3 Parameters

Level
A Single specifying Y coordinate of point B in %VDD (from 0.0 to 100.0).

6.11.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.12 SetCoordinateC Method

6.12.1 Description
This method is called when the mechanical position is set to position C. It will treat next action:

* This gets the current angle by asking the device for it


* It will store the X and Y coordinates of point C to the device
* It will calculate the Slope for B and copy it to the slope C

NOTE: Also for all solver functions, only the selected device is taken in account!
NOTE: If this step is not executed, no problem will appear. This can happen in the case of a two points solver.

PSF090365AAMLX Library Object Model 2013-09-13 - 29 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.12.2 Syntax

Visual Basic:
Sub SetCoordinateC(Level as Single)

C++:
HRESULT SetCoordinateC(/*[in]*/ float Level);

6.12.3 Parameters

Level
A Single specifying Y coordinate of point C in %VDD (from 0.0 to 100.0).

6.12.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.13 SetCoordinateD Method

6.13.1 Description
This method is called when the mechanical position is set to position D. It will treat next action:

* This gets the current angle by asking the device for it


* It will calculate the Slope for C

NOTE: Also for all solver functions, only the selected device is taken in account!
NOTE: If this step is not executed, no problem will appear. This can happen in the case of a two points solver.
NOTE: This point also can be a fictive point, overwriting the slope for C can be done with the function
SetSlopeC.

6.13.2 Syntax

Visual Basic:
Sub SetCoordinateD(Level as Single)

C++:
HRESULT SetCoordinateD(/*[in]*/ float Level);

6.13.3 Parameters

Level
A Single specifying Y coordinate of point D in %VDD (from 0.0 to 100.0).

PSF090365AAMLX Library Object Model 2013-09-13 - 30 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.13.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.14 SetCoordinateE Method

6.14.1 Description
This method is called when the mechanical position is set to position E. It will treat next action:

* This gets the current angle by asking the device for it


* It will calculate the Slope for D

NOTE: Also for all solver functions, only the selected device is taken in account!
NOTE: If this step is not executed, no problem will appear. This can happen in the case of a two points solver.
NOTE: This point also can be a fictive point, overwriting the slope for D can be done with the function
SetSlopeD.

6.14.2 Syntax

Visual Basic:
Sub SetCoordinateE(Level as Single)

C++:
HRESULT SetCoordinateE(/*[in]*/ float Level);

6.14.3 Parameters

Level
A Single specifying Y coordinate of point E in %VDD (from 0.0 to 100.0).

6.14.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 31 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.15 SetSlopeS0 Method

6.16 SetSlopeA Method

6.17 SetSlopeB Method

6.18 SetSlopeC Method

6.19 SetSlopeD Method

6.19.1 Description
When you need a specific or fixed slope for resp A, B, C, D or S0, you can overwrite an eventual calculated
slope with this function.

6.19.2 Syntax

Visual Basic:
Sub SetSlopeA(Slope as Single)

C++:
HRESULT SetSlopeA(/*[in]*/ float Slope);

6.19.3 Parameters

Slope
A Single specifying slope to overwrite default or calculated slope in [%VDD / DEG].

6.19.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.20 SetFirstFitPoint Method

6.20.1 Description
This method is called for the first position in order to make the initialization for the solving this device. It will
measure the current angle and store its value along with the given required level.
This method does not directly update EE_Yxx parameters. FitPoints method must be used as soon as all the
required points are defined.
NOTE: Also for all solver functions, only the selected device is taken into account!

PSF090365AAMLX Library Object Model 2013-09-13 - 32 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.20.2 Syntax

Visual Basic:
Sub SetFirstFitPoint(Level as Single)

C++:
HRESULT SetFirstFitPoint(/*[in]*/ float Level);

6.20.3 Parameters

Level
A Single specifying Y coordinate for the current position in %VDD (from 0.0 to 100.0).

6.20.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.21 SetNextFitPoint Method

6.21.1 Description
This method is called for each position after the first one. It will measure the current angle and store its value
along with the given required level. When the method is called for the second point it may define DP according
to the rotation direction and the slope between the first two points.
This method does not directly update EE_Yxx parameters. FitPoints method must be used as soon as all the
required points are defined.

NOTE: Also for all solver functions, only the selected device is taken into account!

6.21.2 Syntax

Visual Basic:
Sub SetNextFitPoint(Level as Single)

C++:
HRESULT SetNextFitPoint(/*[in]*/ float Level);

6.21.3 Parameters

Level
A Single specifying Y coordinate of point A in %VDD (from 0.0 to 100.0).

6.21.4 Return value

C++:

PSF090365AAMLX Library Object Model 2013-09-13 - 33 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.22 DeleteLastFitPoint Method

6.22.1 Description
This method can be called to remove the last stored position.

NOTE: Also for all solver functions, only the selected device is taken into account!

6.22.2 Syntax

Visual Basic:
Sub DeleteLastFitPoint()

C++:
HRESULT DeleteLastFitPoint();

6.22.3 Parameters

None

6.22.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.23 FitPoints Method

6.23.1 Description
This method is called when all the required points are defined. It will calculate the EE_Y0 – EE_Y16 parameters
using the specified algorithm.

NOTE: Also for all solver functions, only the selected device is taken into account!

6.23.2 Syntax

Visual Basic:
Sub FitPoints(Algorithm as Long, pMaxError as Single) as Long

C++:
HRESULT FitPoints(/*[in]*/long Algorithm, /*[out]*/float* pMaxError,
/*[out,retval]*/long* pMaxErrorPoint);

PSF090365AAMLX Library Object Model 2013-09-13 - 34 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.23.3 Parameters

Algorithm
A Long specifying the required algorithm. Possible values are:
1 – Linear interpolation
2 – Front end fit. This algorithm is applicable for as minimum as 6 defined points. If less points are
defined, linear interpolation algorithm is automatically selected.

pMaxError
An address of a Single variable receiving the maximum deviation between the defined points and
resulting transfer characteristic.

pMaxErrorPoint
An address of a Long variable receiving the number of point (starting with 1), where is the maximum
deviation.

6.23.4 Return value

Visual Basic:
A Long containing the number of point (starting with 1), where is the maximum deviation.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.24 SetClamping Method

6.24.1 Description
With this method, you can fix the levels for Clamping High \ Low. Usually this is the last step of the solver
procedure.

NOTE: Also for all solver functions, only the selected device is taken in account!

6.24.2 Syntax

Visual Basic:
Sub SetClamping(LowLevel as Single, HighLevel as Single)

C++:
HRESULT SetClamping(/*[in]*/ float LowLevel, /*[in]*/ float HighLevel);

6.24.3 Parameters

LowLevel
A Single specifying low clamping level in %VDD (from 0.0 to 100.0).

HighLevel
A Single specifying high clamping level in %VDD (from 0.0 to 100.0).

PSF090365AAMLX Library Object Model 2013-09-13 - 35 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

6.24.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.25 SetPWMT Method

6.25.1 Description
This method finally tunes the frequency of PWM signal. It should be called after main calibration is done and
device is programmed, thus ensuring the correct output mode is established. Frequency is tuned by a
measurement of the signal on the output, recalculating EE_PWMT parameter and storing it into the cache. After
successful execution of SetPWMT, changed parameters can be programmed into device by ProgramDevice
method.

6.25.2 Syntax

Visual Basic:
Sub SetPWMT(Freq as Single)

C++:
HRESULT SetPWMT(/*[in]*/float Freq);

6.25.3 Parameters

Freq
A Single specifying the required frequency of the output signal in Hz.

6.25.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.26 SetPowerSaving Method

6.26.1 Description
This method enables or disables POWERSAVING option in EEPROM.

6.26.2 Syntax

Visual Basic:

PSF090365AAMLX Library Object Model 2013-09-13 - 36 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Sub SetPowerSaving (Enable as Boolean)

C++:
HRESULT SetPowerSaving (/*[in]*/VARIANT_BOOL Enable);

6.26.3 Parameters

Enable
A Boolean specifying whether POWERSAVING to be enabled (True) or disabled (False).

6.26.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

6.27 Memlock Method

6.27.1 Description
This method sets MEMLOCK parameter to 3 and programs the connected device. In case of success, further
trials for updating EEPROM of this device will fail.
Note, that this method is applicable for MLX90365ABD and newer.

6.27.2 Syntax

Visual Basic:
Sub Memlock()

C++:
HRESULT Memlock();

6.27.3 Parameters

None

6.27.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 37 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7 PSF090365AAMLXAdvanced Object

7.1 Background
This object cannot be created directly; it is only accessible as “Advanced” property of
PSF090365AAMLXDevice object.
PSF090365AAMLXAdvanced object implements IPSF090365AAMLXAdvanced library specific interface. The
following is a description of its methods.

7.2 Scope of the PSF090365AAMLXAdvanced object


This object implements advanced functions that would be rarely used in order to perform specific operations not
available with the standard device functions. In general, most of the methods of that object provide direct access
to MLX90365 firmware commands, implemented in PTC04 programmer.

7.3 SetVdd Method

7.3.1 Description
Changes the VDD of MLX90365. This applies only to the selected die.

NOTE: Most of the PTC04 firmware commands manipulate VDD, thus the voltage set by this method is valid
until the next command is sent to the programmer. SetSetting method must be used if persistent voltage is
needed.

7.3.2 Syntax

Visual Basic:
Sub SetVdd(fVdd as Single)

C++:
HRESULT SetVdd(/*[in]*/ float fVdd);

7.3.3 Parameters

fVdd
A Single specifying new VDD in voltages.

7.3.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 38 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.4 SetVBat Method

7.4.1 Description
Changes the VBat voltage of MLX90365 (PPS3 of PTC04). This applies to both dies.

NOTE: Many of the PTC04 firmware commands manipulate VBat, thus the voltage set by this method must be
considered valid until the next command is sent to the programmer. SetSetting method must be used if persistent
voltage is needed.

7.4.2 Syntax

Visual Basic:
Sub SetVBat(fVBat as Single)

C++:
HRESULT SetVBat(/*[in]*/ float fVBat);

7.4.3 Parameters

fVBat
A Single specifying new VBat in voltages.

7.4.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.5 SelectDevice Method

7.5.1 Description
Immediately sends the SelectDevice command to PTC04 programmer.

7.5.2 Syntax

Visual Basic:
Sub SelectDevice(nDev as Long)

C++:
HRESULT SelectDevice(/*[in]*/ int nDev);

7.5.3 Parameters

nDev
A Long specifying die A (1) or B (2).

PSF090365AAMLX Library Object Model 2013-09-13 - 39 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.5.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.6 GetSetting Method

7.6.1 Description
Returns the value of a particular setting.

7.6.2 Syntax

Visual Basic:
Function GetSetting(settingID as SettingCodes)

C++:
HRESULT GetSetting(/*[in]*/ SettingCodes settingID, /*[out,retval]*/ TVariant* pVal);

7.6.3 Parameters

settingID
A SettingCodes constant specifying the ID of the setting.

pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.

7.6.4 Return value

Visual Basic:
A Variant containing the value of a setting.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains valid value.
Any other error code The operation failed. *pVal is Empty.

7.7 SetSetting Method

7.7.1 Description
Changes the value of a particular setting. Sets an associated internal variable. The setting is also sent
immediately to PTC04 programmer.

PSF090365AAMLX Library Object Model 2013-09-13 - 40 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

NOTE: If necessary, the changes can be saved in the profile with a subsequent call to SaveProfile or
SaveProfileAs methods.

7.7.2 Syntax

Visual Basic:
Sub SetSetting(settingID as SettingCodes, Value)

C++:
HRESULT SetSetting(/*[in]*/ SettingCodes settingID, /*[in]*/ TVariantInParam Value);

7.7.3 Parameters

settingID
A SettingCodes constant specifying the ID of the setting to modify.

Value
A VARIANT containing new value for the setting.

7.7.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.8 SettingInUse Property

7.8.1 Description
Specifies if the setting will be stored in the profile when SaveProfile or SaveProfileAs methods are called.
These usage flags are also updated by OpenProfile method – a certain setting is marked as “used” if it exists in
the profile being opened, otherwise it is marked as unused and a default value is assigned to the setting itself.

7.8.2 Syntax

Visual Basic:
Property SettingInUse(settingID as SettingCodes) as Boolean

C++:
HRESULT get_SettingInUse(/*[in]*/ SettingCodes settingID, /*[out,retval]*/
VARIANT_BOOL* pValue);
HRESULT set_SettingInUse(/*[in]*/ SettingCodes settingID, /*[in]*/ VARIANT_BOOL Value);

7.8.3 Parameters

PSF090365AAMLX Library Object Model 2013-09-13 - 41 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

settingID
A SettingCodes constant specifying the ID of the setting to get or modify its usage.

pValue
An address of VARIANT_BOOL variable that receives current value of the property.
VARIANT_TRUE means that the associated setting is used, VARIANT_FALSE means unused.

Value
A VARIANT_BOOL specifying new value for the property. VARIANT_TRUE marks the associated
setting as used, VARIANT_FALSE – as unused.

7.8.4 Return value

Visual Basic:
True if the associated setting is in use, False otherwise.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pValue contains valid value.
Any other error code The operation failed.

7.9 GetSolverSetting Method

7.9.1 Description
Returns the value of a particular solver setting.

NOTE: The module is just a container for the solver settings and completely ignores them. This method provides
an interface for higher layers to access the contents of the profile. The higher layers are responsible to read these
settings when necessary and put them at the right places (usually the EEPROM of the selected die) as part of
their solver sequence.
NOTE: The solver targets, kept in the profile, are also accessible with this method.

7.9.2 Syntax

Visual Basic:
Function GetSolverSetting(settingID as SolverSettingCodes)

C++:
HRESULT GetSolverSetting(/*[in]*/ SolverSettingCodes settingID, /*[out,retval]*/ TVariant*
pVal);

7.9.3 Parameters

settingID
A SolverSettingCodes constant specifying the ID of the solver setting.

pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.

PSF090365AAMLX Library Object Model 2013-09-13 - 42 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.9.4 Return value

Visual Basic:
A Variant containing the value of a solver setting.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains valid value.
Any other error code The operation failed. *pVal is Empty.

7.10 SetSolverSetting Method

7.10.1 Description
Changes the value of a particular solver setting.

NOTE: If necessary, the changes can be saved in the profile with a subsequent call to SaveProfile or
SaveProfileAs methods.
NOTE: The module is just a container for the solver settings and completely ignores them. This method provides
an interface for higher layers to change the contents of the profile. The higher layers are responsible to read these
settings when necessary and put them at the right places (usually the EEPROM of the selected die) as part of
their solver sequence.
NOTE: The solver targets, kept in the profile, are also accessible with this method.

7.10.2 Syntax

Visual Basic:
Sub SetSolverSetting(settingID as SolverSettingCodes, Value)

C++:
HRESULT SetSolverSetting(/*[in]*/ SolverSettingCodes settingID, /*[in]*/ TVariantInParam
Value);

7.10.3 Parameters

settingID
A SolverSettingCodes constant specifying the ID of the solver setting to modify.

Value
A VARIANT containing new value for the solver setting.

7.10.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.

PSF090365AAMLX Library Object Model 2013-09-13 - 43 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Any other error code The operation failed.

7.11 SolverSettingInUse Property

7.11.1 Description
Specifies if the solver setting will be stored in the profile when SaveProfile or SaveProfileAs methods are
called. These usage flags are also updated by OpenProfile method – a certain solver setting is marked as “used”
if it exists in the profile being opened, otherwise it is marked as unused and a default value is assigned to the
setting itself.

NOTE: The usage of the solver targets, kept in the profile, is also accessible with this method.

7.11.2 Syntax

Visual Basic:
Property SolverSettingInUse(settingID as SolverSettingCodes) as Boolean

C++:
HRESULT get_SolverSettingInUse(/*[in]*/ SolverSettingCodes settingID, /*[out,retval]*/
VARIANT_BOOL* pValue);
HRESULT set_SolverSettingInUse(/*[in]*/ SolverSettingCodes settingID, /*[in]*/
VARIANT_BOOL Value);

7.11.3 Parameters

settingID
A SolverSettingCodes constant specifying the ID of the solver setting to get or modify its usage.

pValue
An address of VARIANT_BOOL variable that receives current value of the property.
VARIANT_TRUE means that the associated solver setting is used, VARIANT_FALSE means unused.

Value
A VARIANT_BOOL specifying new value for the property. VARIANT_TRUE marks the associated
solver setting as used, VARIANT_FALSE – as unused.

7.11.4 Return value

Visual Basic:
True if the associated solver setting is in use, False otherwise.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pValue contains valid value.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 44 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.12 OpenProfile Method

7.12.1 Description
Opens the specified file and updates the settings.

7.12.2 Syntax

Visual Basic:
Sub OpenProfile(FileName as String)

C++:
HRESULT OpenProfile(/*[in]*/ BSTR FileName);

7.12.3 Parameters

FileName
A String specifying the path of the file to open.

7.12.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.13 SaveProfile Method

7.13.1 Description
Saves the settings into a previously opened profile. This function fails if there is not a profile in use.

7.13.2 Syntax

Visual Basic:
Sub SaveProfile()

C++:
HRESULT SaveProfile();

7.13.3 Parameters

None

PSF090365AAMLX Library Object Model 2013-09-13 - 45 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.13.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.14 SaveProfileAs Method

7.14.1 Description
Saves the settings into the specified file.

7.14.2 Syntax

Visual Basic:
Sub SaveProfileAs(FileName as String)

C++:
HRESULT SaveProfileAs(/*[in]*/ BSTR FileName);

7.14.3 Parameters

FileName
A String specifying the path of the file.

7.14.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.15 ReadFullRAM Method

7.15.1 Description
Reads the whole RAM of MLX90365. Updates the internal RAM cache with values taken from the chip. This
method is provided to speed up the performance because it updates the whole cache with a single command.

7.15.2 Syntax

Visual Basic:
Sub ReadFullRAM()

PSF090365AAMLX Library Object Model 2013-09-13 - 46 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

C++:
HRESULT ReadFullRAM();

7.15.3 Parameters

None

7.15.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.16 ProgramRAM Method

7.16.1 Description
Writes the whole RAM of MLX90365. Takes the values from the internal RAM cache.
Only the variables that are modified will be programmed.

7.16.2 Syntax

Visual Basic:
Sub ProgramRAM()

C++:
HRESULT ProgramRAM();

7.16.3 Parameters

None

7.16.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 47 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.17 GetRAMParameter Method

7.17.1 Description
Returns the code of a particular RAM parameter. It is optimized because it uses the RAM cache maintained by
the library. ReadFullRAM method could be called before calling GetRAMParameter to update the whole
cache. However GetRAMParameter works correctly even if ReadFullRAM is not called.

7.17.2 Syntax

Visual Basic:
Function GetRAMParameter(paramID as ParamCodesRAM)

C++:
HRESULT GetRAMParameter(/*[in]*/ ParamCodesRAM paramID, /*[out,retval]*/ TVariant*
pVal);

7.17.3 Parameters

paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter.

pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.

7.17.4 Return value

Visual Basic:
A Variant containing the value of a RAM parameter.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is Empty.

7.18 SetRAMParameter Method

7.18.1 Description
Changes the code of a particular RAM parameter. The method works with the RAM cache maintained by the
library.
ProgramRAM method must be called in order to update the RAM of the chip with the codes from the cache.

7.18.2 Syntax

Visual Basic:
Sub SetRAMParameter(paramID as ParamCodesRAM, Value)

PSF090365AAMLX Library Object Model 2013-09-13 - 48 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

C++:
HRESULT SetRAMParameter(/*[in]*/ ParamCodesRAM paramID, /*[in]*/ TVariantInParam
Value);

7.18.3 Parameters

paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter to modify.

Value
A VARIANT containing new value for the RAM parameter.

7.18.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.19 GetRAMParameterDirect Method

7.19.1 Description
Returns the code of a particular RAM parameter. In contrast to GetRAMParameter, this method directly reads
data from the device’s RAM.

7.19.2 Syntax

Visual Basic:
Function GetRAMParameterDirect(paramID as ParamCodesRAM)

C++:
HRESULT GetRAMParameterDirect(/*[in]*/ ParamCodesRAM paramID, /*[out,retval]*/
TVariant* pVal);

7.19.3 Parameters

paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter.

pVal
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.

PSF090365AAMLX Library Object Model 2013-09-13 - 49 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.19.4 Return value

Visual Basic:
A Variant containing the value of a RAM parameter.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pVal contains a valid value.
Any other error code The operation failed. *pVal is Empty.

7.20 SetRAMParameterDirect Method

7.20.1 Description
Changes the code of a particular RAM parameter. In contrast to SetRAMParameter, this method directly writes
data to the device’s RAM.

7.20.2 Syntax

Visual Basic:
Sub SetRAMParameterDirect(paramID as ParamCodesRAM, Value)

C++:
HRESULT SetRAMParameterDirect(/*[in]*/ ParamCodesRAM paramID, /*[in]*/
TVariantInParam Value);

7.20.3 Parameters

paramID
A ParamCodesRAM constant specifying the ID of the RAM parameter to modify.

Value
A VARIANT containing new value for the RAM parameter.

7.20.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.21 MemWriteWithCRC Method

7.21.1 Description
Sends MemWriteWithCRC command to PTC04 programmer. Writes 2 bytes into chip’s memory.

PSF090365AAMLX Library Object Model 2013-09-13 - 50 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.21.2 Syntax

Visual Basic:
Sub MemWriteWithCRC(Addr as Long, Data as Long, Ack as Long, Tim as Long, T1 as Long,
T2 as Long, T3 as Long, T4 as Long)

C++:
HRESULT MemWriteWithCRC(/*[in]*/ long Addr, /*[in]*/ long Data, /*[out]*/ int* Ack,
/*[out]*/ int* Tim, /*[out]*/ int* T1, /*[out]*/ int* T2, /*[out]*/ int* T3, /*[out]*/
int* T4);

7.21.3 Parameters

Addr
A Long specifying memory address to modify in the chip. Only the lowest 16 bits are used.

Data
A Long containing new value to write in the chip. Only the lowest 16 bits are used.

Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication. This pointer could be NULL if this value is not needed.

Tim
An address of int variable that will receive the Tim timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

T1
An address of int variable that will receive the T1 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

T2
An address of int variable that will receive the T2 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

T3
An address of int variable that will receive the T3 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

T4
An address of int variable that will receive the T4 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

7.21.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 51 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.22 MemWrite Method

7.22.1 Description
Sends MemWrite command to PTC04 programmer. Writes 2 bytes into chip’s memory.

7.22.2 Syntax

Visual Basic:
Sub MemWrite(Addr as Long, Data as Long, Ack as Long, Tim as Long, T1 as Long, T2 as
Long)

C++:
HRESULT MemWrite(/*[in]*/ long Addr, /*[in]*/ long Data, /*[out]*/ int* Ack, /*[out]*/ int*
Tim, /*[out]*/ int* T1, /*[out]*/ int* T2);

7.22.3 Parameters

Addr
A Long specifying memory address to modify in the chip. Only the lowest 16 bits are used.

Data
A Long containing new value to write in the chip. Only the lowest 16 bits are used.

Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication. This pointer could be NULL if this value is not needed.

Tim
An address of int variable that will receive the Tim timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

T1
An address of int variable that will receive the T1 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

T2
An address of int variable that will receive the T2 timing measured during the communication with the
chip. This pointer could be NULL if this value is not needed.

7.22.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 52 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.23 MemRead Method

7.23.1 Description
Sends MemRead command to PTC04 programmer. Reads 2 bytes from chip’s memory.

7.23.2 Syntax

Visual Basic:
Function MemRead(Addr as Long, CRCrec as Long) as Long

C++:
HRESULT MemRead(/*[in]*/ long Addr, /*[out]*/ int* CRCrec, /*[out,retval]*/ long* pData);

7.23.3 Parameters

Addr
A Long specifying memory address to read from the chip. Only the lowest 16 bits are used.

CRCrec
An address of int variable that will receive the CRC data returned from the chip during the
communication. This pointer could be NULL if this value is not needed.

pData
An address of long variable that will receive the return value of the method. Only the lowest 16 bits are
valid, the highest 16 bits are always zero.

7.23.4 Return value

Visual Basic:
A Long containing the value that is read from the chip’s memory.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pData contains valid value.
Any other error code The operation failed. *pData is zero.

7.24 MemReadSafe Method

7.24.1 Description
The same as MemRead method, but also checks if received CRC is correct. In case of mismatch it returns an
error.

7.24.2 Syntax

Visual Basic:
Function MemReadSafe(Addr as Long) as Long

PSF090365AAMLX Library Object Model 2013-09-13 - 53 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

C++:
HRESULT MemReadSafe(/*[in]*/ long Addr, /*[out,retval]*/ long* pData);

7.24.3 Parameters

Addr
A Long specifying memory address to read from the chip. Only the lowest 16 bits are used.

pData
An address of long variable that will receive the return value of the method. Only the lowest 16 bits are
valid, the highest 16 bits are always zero.

7.24.4 Return value

Visual Basic:
A Long containing the value that is read from the chip’s memory.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pData contains valid value.
Any other error code The operation failed. *pData is zero.

7.25 ReadData Method

7.25.1 Description
Sends ReadData command to PTC04 programmer. Reads a certain number of words from the chip’s memory.

7.25.2 Syntax

Visual Basic:
Function ReadData(Addr as Long, N as Long, Format as Long)

C++:
HRESULT ReadData(/*[in]*/ long Addr, /*[in]*/ long N, /*[in]*/ long Format, /*[out,retval]*/
TVariant* varData);

7.25.3 Parameters

Addr
A Long specifying memory address to start reading from the chip. Only the lowest 16 bits are used.

N
A Long specifying a number of words to be read (up to 125).

Format
A Long specifying the format of the returned data in varData. Possible values are:

PSF090365AAMLX Library Object Model 2013-09-13 - 54 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Value Format
1 Return value is an array of bytes
2 Return value is an ANSI string packed in bstrVal member of *varData. This is the
preferred format for C++ applications because of the best performance. It is a binary
data so the string can contain zeroes and may not be zero terminated. Callers can get its
real length by calling SysStringByteLen API on bstrVal member
4 Return value is an array of words (Integers). This is the preferred format for Visual
Basic applications

varData
An address of VARIANT variable that will receive the return value of the method. The caller is
responsible to call VariantClear on that variable when it is no longer needed.

7.25.4 Return value

Visual Basic:
A Variant containing the data read from the chip.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *varData contains valid value.
Any other error code The operation failed. *varData is Empty.

7.26 WriteData Method

7.26.1 Description
Sends WriteData command to PTC04 programmer. Writes a certain number of words into the chip’s memory.

7.26.2 Syntax

Visual Basic:
Sub WriteData(Format as Long, arr)

C++:
HRESULT WriteData(/*[in]*/ long Format, /*[in]*/ TVariantInParam arr);

7.26.3 Parameters

Format
A Long specifying the format of the data in arr. Possible values are:
Value Format
1 arr is an array of words (Integers) in the following format:

Add0 Word0 Add1 Word1 …

or an array of bytes in the following format:

Add0 L Add0 H Word 0 L Word 0 H …

PSF090365AAMLX Library Object Model 2013-09-13 - 55 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

where Add0 is the first memory address to change and Word0 is the new value for that
memory cell, Add1 is the second memory address and Word1 is the corresponding new
value and so on.

2 arr is an ANSI string packed in bstrVal member. This is the preferred format for C++
applications because of the best performance. It is a binary data so the string can contain
zeroes and may not be zero terminated.

arr
A VARIANT containing the data to be written.

7.26.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.27 SetDBMux Method

7.27.1 Description
Sends SetDBMux command to PTC04 programmer.

7.27.2 Syntax

Visual Basic:
Sub SetDBMux(MUXChanNr as Byte)

C++:
HRESULT SetDBMux(/*[in]*/ unsigned char MUXChanNr);

7.27.3 Parameters

MUXChanNr
A Byte specifying new channel for the mux.

7.27.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 56 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.28 HotReset Method (obsoleted)

7.28.1 Description
Sends HotReset command to PTC04 programmer.

7.28.2 Syntax

Visual Basic:
Function HotReset() As Long

C++:
HRESULT HotReset(/*[out,retval]*/ int* Ack);

7.28.3 Parameters

Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication.

7.28.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *Ack contains valid value.
Any other error code The operation failed. *Ack is zero.

7.29 NopAlive Method

7.29.1 Description
Sends NopAlive command to PTC04 programmer.

7.29.2 Syntax

Visual Basic:
Function NopAlive() As Long

C++:
HRESULT NopAlive(/*[out,retval]*/ int* Ack);

7.29.3 Parameters

Ack
An address of int variable that will receive the acknowledge data returned from the chip during the
communication.

PSF090365AAMLX Library Object Model 2013-09-13 - 57 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

7.29.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *Ack contains valid value.
Any other error code The operation failed. *Ack is zero.

7.30 DisconnectDevice Method

7.30.1 Description
Sends DisconnectUart command to PTC04 programmer. It disconnects the output of the chip from the Uart line
on the daughter board. Such disconnected output can be measured with external equipment.
There is no ConnectUart command. The firmware connects the output automatically when necessary.

7.30.2 Syntax

Visual Basic:
Sub DisconnectDevice()

C++:
HRESULT DisconnectDevice();

7.30.3 Parameters

None

7.30.4 Return value

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

7.31 CheckCRC Method

7.31.1 Description
Checks validity of the EEPROM. It calculates CRC of the EEPROM cells and compares it with corresponding
data in EEPROM.

7.31.2 Syntax

Visual Basic:

PSF090365AAMLX Library Object Model 2013-09-13 - 58 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Function CheckCRC(pCRC As Long) As Boolean

C++:
HRESULT CheckCRC(/*[out]*/ long* pCRC, /*[out,retval]*/ VARIANT_BOOL pbValue);

7.31.3 Parameters

pCRC
An address of long variable that will receive the CRC calculated by the method.

pbValue
An address of Boolean variable that will receive the return value of the method. True means that CRC is
OK, False – CRC is different.

7.31.4 Return value

Visual Basic:
A Boolean containing the return value of the method. True means that CRC is OK, False – CRC is
different.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pCRC and *pbValue contain
valid values.
Any other error code The operation failed. *pCRC and *pbValue are zero.

7.32 Logging Property

7.32.1 Description
Specifies whether the objects (PSF090365AAMLXDevice, PSF090365AAMLXSolver and
PSF090365AAMLXAdvanced) perform logging of their activity.

7.32.2 Syntax

Visual Basic:
Property Logging as Boolean

C++:
HRESULT get_Logging(/*[out,retval]*/ VARIANT_BOOL* pValue);
HRESULT set_Logging(/*[in]*/ VARIANT_BOOL Value);

7.32.3 Parameters

pValue
An address of VARIANT_BOOL variable that receives current value of the property.
VARIANT_TRUE means that logging is active, VARIANT_FALSE means inactive.

PSF090365AAMLX Library Object Model 2013-09-13 - 59 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

Value
A VARIANT_BOOL specifying new value for the property. VARIANT_TRUE activates the logging,
VARIANT_FALSE deactivates it.

7.32.4 Return value

Visual Basic:
True if logging is active, False otherwise.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pValue contains valid value.
Any other error code The operation failed.

7.33 ChipVersion Property

7.33.1 Description
Specifies the version of the connected MLX90365 chip. This value determines the EEPROM map in use and
some settings, specific for each different version of the chip. Normally this property is set once as part of the
initialization of the software.

7.33.2 Syntax

Visual Basic:
Property ChipVersion as Long

C++:
HRESULT get_ChipVersion(/*[out,retval]*/ long* pValue);
HRESULT set_ChipVersion(/*[in]*/ long Value);

7.33.3 Parameters

pValue
An address of Long variable that receives current value of the property.

Value
A Long specifying new value for the property. The possible values are:
1 Chip is MLX90365AAA
2 (default) Chip is MLX90365ABB
4 Chip is MLX90365ABD

7.33.4 Return value

Visual Basic:
A Long, containing current value of the property.

PSF090365AAMLX Library Object Model 2013-09-13 - 60 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully. *pValue contains valid value.
Any other error code The operation failed.

7.34 ReadChipVersion Method

7.34.1 Description
This method recognizes the version of the connected chip.

7.34.2 Syntax

Visual Basic:
Function ReadChipVersion as Long

C++:
HRESULT ReadChipVersion(/*[out,retval]*/long* pValue);

7.34.3 Parameters

pValue
An address of Long variable that will receive a code corresponding to the specific chip version. Here is
the list of the possible codes:
0 Chip is not recognized or not connected properly
1 Chip is MLX90365AAA
2 Chip is MLX90365ABB
4 Chip is MLX90365ABD

7.34.4 Return value

Visual Basic:
A Long containing a code corresponding to the specific chip version. See description of pValue above
for the list of the possible codes.

C++:
The return value obtained from the returned HRESULT is one of the following:
Return value Meaning
S_OK The operation completed successfully.
Any other error code The operation failed.

PSF090365AAMLX Library Object Model 2013-09-13 - 61 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

8 Enumeration constants

8.1 ParamCodesEEPROM enumeration


The following constants refer to parameters in EEPROM. They are used by GetEEParameterCode, SetEEParameterCode, GetEEParameterValue and
SetEEParameterValue methods.
Parameters with translation value ‘-‘ are not supported by GetEEParameterValue and SetEEParameterValue methods.

90365ABD
90365AAA

90365ABB
R/W
Value
Translation

Bits
Constant Description Cluster location
value

CodeANAOUTA 1 R 16 Internal clock / voltage trimming √ √ √


CodeOSCTRIM 2 R 7 Internal clock trimming √ √ √
CodeVANATRIM 3 R 4 Internal voltage trimming √ √ √
CodeIN2GAIN 4 R 4 Internal gain trimming √ √ √
CodePOWERSAVING 5 R 8 Internal settings √ √ √
CodeLINEUP 6 R 8 Internal settings √ √ √
CodeXOFFSET 7 R 16 Residual Offset correction for X @ T35 √ √ √
CodeYOFFSET 8 R 16 Residual Offset correction for Y @ T35 √ √ √
CodeZOFFSET 9 R 16 Residual Offset correction for Z @ T35 √ √ √
CodeXOFSSLOPE 10 R 16 Thermal Residual Offset correction for X √ √ √
CodeXOFSSLOPECOLD 11 R 8 Thermal Residual Offset correction for X < T35 CodeXOFSSLOPE √ √ √
CodeXOFSSLOPEHOT 12 R 8 Thermal Residual Offset correction for X > T35 CodeXOFSSLOPE √ √ √
CodeYOFSSLOPE 13 R 16 Thermal Residual Offset correction for Y √ √ √
CodeYOFSSLOPECOLD 14 R 8 Thermal Residual Offset correction for Y < T35 CodeYOFSSLOPE √ √ √
CodeYOFSSLOPEHOT 15 R 8 Thermal Residual Offset correction for Y > T35 CodeYOFSSLOPE √ √ √
CodeZOFSSLOPE 16 R 16 Thermal Residual Offset correction for Z √ √ √
CodeZOFSSLOPECOLD 17 R 8 Thermal Residual Offset correction for Z < T35 CodeZOFSSLOPE √ √ √
CodeZOFSSLOPEHOT 18 R 8 Thermal Residual Offset correction for z > T35 CodeZOFSSLOPE √ √ √

PSF090365AAMLX Library Object Model 2013-09-13 - 62 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

90365ABD
90365AAA

90365ABB
R/W
Value
Translation

Bits
Constant Description Cluster location
value

CodeT35 19 R 16 Temp Reference value of Sensor at at 35° √ √ √


CodeTM60MSB 20 R 8 Temp Ref point @ HOT √ √ √
CodeT170MSB 21 R 8 Temp Ref point @ COLD √ √ √
CodeORTHXY 22 R 8 Phase correction , X = X – Y * EE_ORTH / 256 √ √ √
CodeORTHZXX 23 R/W 8 Phase correction , X = X – Z * EE_ORTH / 256 √ √ √
CodeORTHYZ 24 R/W 8 Phase correction , Z = Z – Y * EE_ORTH / 256 √ √ √
CodeANAOUTC 25 R 8 Internal voltage trimming √ √ √
CodeITRIM 26 R 5 Internal current trimming √ √ √
CodeVDIGMODE 27 R 2 Internal voltage trimming √ √ √
R/ Sensitivity mismatch compensation Y/X √ √ √
CodeSMISM 28 (W) 16
CodeK 29 R/W 15 float [0.0-1.0] Sensitivity mismatch compensation Z/X , Z/Y √ √ √
CodePWMT 30 R/W 16 PWM Period = osc freq / ( 3 * PWMT) √ √ √
CodeOMOD 31 R/W 8 Cluster( Output stage configuration) √ √ √
CodeOSNORMMODE 32 R/W 3 Output stage configuration for normal mode CodeOMOD √ √ √
CodeOSDIAGMODE 33 R/W 3 Output stage configuration for Diagnostic mode CodeOMOD √ √ √
CodeOSDIAGDIAG 34 R/W 1 Diagnostic reporting level (0= low, 1= high) CodeOMOD √ √ √
CodeMAGTC2ND 35 R/W 8 Magnet TC (2nd order) √ √ √
CodeMLXID0 36 R 8 Melexis ID nr √ √ √
CodeMLXID1 37 R 8 Melexis ID nr √ √ √
CodeMLXID2 38 R 8 Melexis ID nr √ √ √
CodeMLXID3 39 R 8 Melexis ID nr √ √ √
CodeMLXID4 40 R 8 Melexis ID nr √ √ √
CodeMLXID5 41 R 8 Melexis ID nr √ √ √
CodeCALIBMODE 42 R/W 16 Melexis Calibration mode √ √ √
CodeESCALING 43 R/W 1 Enable 2 * Scaling of LNR output range CodeCALIBMODE √ √ √
CodeINCOFFCORR 44 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodeDCURRSWITCH 45 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodeTEMPMONI 46 R/W 1 Internal settings CodeCALIBMODE √ √ √

PSF090365AAMLX Library Object Model 2013-09-13 - 63 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

90365ABD
90365AAA

90365ABB
R/W
Value
Translation

Bits
Constant Description Cluster location
value

CodeADCDACMONI 47 R/W 1 Internal settings CodeCALIBMODE √ √ √


CodeEXDEBOUNCING 48 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodeDFSMODSYS 49 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodeCONNTESTBR 50 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodeROCLIPRANGE 51 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodePROGREFRESH 52 R/W 1 Internal settings CodeCALIBMODE √ √ √
CodeLNRS0 53 R/W 16 float [%Vdd/deg] Slope Before A √ √ √
CodeLNRY0 54 R/W 16 float [%Vdd] Y coordinate point 0/16 √ √ √
CodeLNRAX 55 R/W 16 float [deg] X coordinate point A √ √ √
CodeLNRY1 56 R/W 16 float [%Vdd] Y coordinate point 1/16 √ √ √
CodeLNRAY 57 R/W 16 float [%Vdd] Y coordinate point A √ √ √
CodeLNRY2 58 R/W 16 float [%Vdd] Y coordinate point 2/16 √ √ √
CodeLNRAS 59 R/W 16 float [%Vdd/deg] Slope after A √ √ √
CodeLNRY3 60 R/W 16 float [%Vdd] Y coordinate point 3/16 √ √ √
CodeLNRBX 61 R/W 16 float [deg] X coordinate point B √ √ √
CodeLNRY4 62 R/W 16 float [%Vdd] Y coordinate point 4/16 √ √ √
CodeLNRBY 63 R/W 16 float [%Vdd] Y coordinate point B √ √ √
CodeLNRY5 64 R/W 16 float [%Vdd] Y coordinate point 5/16 √ √ √
CodeLNRBS 65 R/W 16 float [%Vdd/deg] Slope after B √ √ √
CodeLNRY6 66 R/W 16 float [%Vdd] Y coordinate point 6/16 √ √ √
CodeLNRCX 67 R/W 16 float [deg] X coordinate point C √ √ √
CodeLNRY7 68 R/W 16 float [%Vdd] Y coordinate point 7/16 √ √ √
CodeLNRCY 69 R/W 16 float [%Vdd] Y coordinate point C √ √ √
CodeLNRY8 70 R/W 16 float [%Vdd] Y coordinate point 8/16 √ √ √
CodeLNRCS 71 R/W 16 float [%Vdd/deg] Slope after C √ √ √
CodeLNRY9 72 R/W 16 float [%Vdd] Y coordinate point 9/16 √ √ √
CodeLNRDX 73 R/W 16 float [deg] X coordinate point D √ √ √
CodeLNRY10 74 R/W 16 float [%Vdd] Y coordinate point 10/16 √ √ √
CodeLNRDY 75 R/W 16 float [%Vdd] Y coordinate point D √ √ √

PSF090365AAMLX Library Object Model 2013-09-13 - 64 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

90365ABD
90365AAA

90365ABB
R/W
Value
Translation

Bits
Constant Description Cluster location
value

CodeLNRY11 76 R/W 16 float [%Vdd] Y coordinate point 11/16 √ √ √


CodeLNRDS 77 R/W 16 float [%Vdd/deg] Slope after D √ √ √
CodeLNRY12 78 R/W 16 float [%Vdd] Y coordinate point 12/16 √ √ √
CodeLNRY13 79 R/W 16 float [%Vdd] Y coordinate point 13/16 √ √ √
CodeLNRY14 80 R/W 16 float [%Vdd] Y coordinate point 14/16 √ √ √
CodeRPMREADPTR 81 R/W 16 Internal test parameter ( RAM pointer) √ √ √
CodeLNRY15 82 R/W 16 float [%Vdd] Y coordinate point 15/16 √ √ √
CodeRPMNROT 83 R/W 16 Internal test parameter ( RAM pointer) √ √ √
CodeLNRY16 84 R/W 16 float [%Vdd] Y coordinate point 16/16 √ √ √
CodeRPMMASK 85 R/W 16 Internal test parameter ( RAM pointer) √ √ √
CodeCLAMPLOW 86 R/W 16 float [%Vdd] Clamping Low √ √ √
CodeCLAMPHIGH 87 R/W 16 float [%Vdd] Clamping High √ √ √
CodeDP16 88 R/W 16 Discontinuity point + CW √ √ √
CodeCW 89 R/W 1 Enables clockwise rotation direction CodeDP16 √ √ √
CodeDP 90 R/W 15 float [deg] Discontinuity point CodeDP16 √ √ √
CodeUSERCFG0 91 R/W 8 User configurable parameters √ √ √
CodeLPMODE 92 R/W 1 Internal parameter CodeUSERCFG0 √ √ √
CodeLINMODE 93 R/W 1 Internal parameter CodeUSERCFG0 √ √ √
CodePWM 94 R/W 1 Enable PWM CodeUSERCFG0 √ √ √
CodePWMPOL 95 R/W 1 Defines PWM polarity CodeUSERCFG0 √ √ √
CodePWMSLEWRATE 96 R/W 1 Enable Double slew rate CodeUSERCFG0 √ √ √
CodeRAMPROBE 97 R/W 1 Enable RAM probe CodeUSERCFG0 √ √ √
Code4POINTS 98 R/W 1 Select 4 point LNR parameters CodeUSERCFG0 √ √ √
CodeUSERCFG1 99 R/W 8 User configurable parameters √ √ √
CodeMAPXYZ 100 R/W 2 Fields selection components, B1 & B2 CodeUSERCFG1 √ √ √
CodeFILTER 101 R/W 2 FIR filter setting CodeUSERCFG1 √ √ √
CodeW 102 R/W 4 Working Range 16 points CodeUSERCFG1 √ √ √
CodeUSERCFG2 103 R/W 8 User configurable parameters √ √ √
CodeNOMARCH 104 R/W 1 Disable RAM test CodeUSERCFG2 √ √ √

PSF090365AAMLX Library Object Model 2013-09-13 - 65 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

90365ABD
90365AAA

90365ABB
R/W
Value
Translation

Bits
Constant Description Cluster location
value

CodeNOWDBIST 105 R/W 1 Disable WD test CodeUSERCFG2 √ √ √


CodeDELAYEDSTARTUP 106 R/W 1 Enable extra delay at strartup CodeUSERCFG2 √ √ √
CodeGAINSATURATION 107 R/W 1 Enable gain saturation CodeUSERCFG2 √ √ √
CodeDIAGDEBOUNCESTEPDOWN 108 R/W 8 Decr. value for diag debouncing counter √ √ √
CodeGAINMIN 109 R/W 8 Gain min value √ √ √
CodeGAINMAX 110 R/W 8 Gain Max value √ √ √
CodeFHYST 111 R/W 8 Hystersis filter √ √ √
CodeFIELDTHRESHLOW 113 R/W 8 Field min value √ √ √
CodeFIELDTHRESHHIGH 114 R/W 8 Field max value √ √ √
CodeHALLTCHOT 115 R/W 8 Thermal sensitivity drift correction √ √ √
CodeHALLTCCOLD 116 R/W 8 Thermal sensitivity drift correction √ √ √
CodeMAGTCHOT 117 R/W 8 Thermal sensitivity drift correction √ √ √
CodeMAGTCCOLD 118 R/W 8 Thermal sensitivity drift correction √ √ √
CodeDCFAULT 119 R/W 8 DC error message √ √ √
CodeWEAKMAGTHRESH 120 R/W 8 Weak magnet threshold √ √ √
CodeDCFTL 121 R/W 8 No magnet threshold √ √ √
CodeDCWEAK 122 R/W 8 DC weak magnet error message √ √ √
CodeDIAGDEBOUNCETHRESH 123 R/W 8 Threshold for diag debouncing counter √ √ √
CodeDIAGDEBOUNCESTEPUP 124 R/W 8 Incr. value for diag debouncing counter √ √ √
CodeDIAGSETTINGS 125 R/W 16 Enable diagnostics √ √ √
CodeDISGAINOOS 126 R/W 1 Disable gain check CodeDIAGSETTINGS √ √ √
CodeDISFTL 127 R/W 1 Disable field too low check CodeDIAGSETTINGS √ √ √
CodeDISFTH 128 R/W 1 Disable field too high check CodeDIAGSETTINGS √ √ √
CodeDISADCCLIP 129 R/W 1 Disable ADC saturation check CodeDIAGSETTINGS √ √ √
CodeDISADCMONI 130 R/W 1 Disable ADC check CodeDIAGSETTINGS √ √ √
CodeDISMT3VMONI 131 R/W 1 Disable 3V check CodeDIAGSETTINGS √ √ √
CodeDISMT4VMONI 132 R/W 1 Disable 4V check CodeDIAGSETTINGS √ √ √
CodeDISROCLIP 133 R/W 1 Disable offset saturation check CodeDIAGSETTINGS √ √ √
CodeDISTEMPMONI 134 R/W 1 Disable 2 temperature check CodeDIAGSETTINGS √ √ √

PSF090365AAMLX Library Object Model 2013-09-13 - 66 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

90365ABD
90365AAA

90365ABB
R/W
Value
Translation

Bits
Constant Description Cluster location
value

CodeENDCWEAKMAG 135 R/W 1 Enable weak magnet DC reporting CodeDIAGSETTINGS √ √ √


CodeDISROMCHECKSUM 136 R/W 1 Disable ROM CRC check CodeDIAGSETTINGS √ √ √
CodeDISSURAMMARCHTEST 137 R/W 1 Disable RAM CRC check @ startup CodeDIAGSETTINGS √ √ √
CodeDISRTRAMTEST 138 R/W 1 Disable RAM CRC check CodeDIAGSETTINGS √ √ √
CodeDISWDTEST 139 R/W 1 Disable WD check CodeDIAGSETTINGS √ √ √
CodeDISFLOWCTRL 140 R/W 1 Disable flow control check CodeDIAGSETTINGS √ √ √
CodeDISPARTROMCKS 141 R/W 1 Not used CodeDIAGSETTINGS √ √ √
CodeROMCHECKSUM 142 R/W 16 ROM CRC value in case of patch √ √ √
CodePATCHCODE0 143 R/W 16 Internal Patch parameters √ √ √
CodePATCHCODE1 144 R/W 16 Internal Patch parameters √ √ √
CodePATCHCODE2 145 R/W 16 Internal Patch parameters √ √ √
CodePATCHCODE3 146 R/W 16 Internal Patch parameters √ √ √
CodePATCHCODE4 147 R/W 16 Internal Patch parameters √ √ √
CodeUSERID1 148 R/W 16 Free customer identification number √ √ √
CodeUSERID2 149 R/W 16 Free customer identification number √ √ √
CodeUSERID3 150 R/W 16 Free customer identification number √ √ √
CodePATCH1A 151 R/W 16 Internal Patch parameters √ √ √
CodePATCH1I 152 R/W 16 Internal Patch parameters √ √ √
CodeCRC8 153 R/W 8 EEPROM CRC √ √ √
CodeFREE 154 R/W 8 Not used √ √ √
CodeCRCDISABLE 155 R/W 16 0x3131 = Disable EEPROM CRC check √ √ √
CodeSELK 156 R/W 1 Select K correction location ( 0 = K* B1) √ √ √
CodeFREE1 157 R/W 8 Not used √ √ √
CodeMEMLOCK 158 R/W 2 Disables EEPROM update if memlock = 3 CodeUSERCFG2 √

PSF090365AAMLX Library Object Model 2013-09-13 - 67 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

8.2 ParamCodesRAM enumeration


The following constants refer to parameters in RAM. They are used by GetRAMParameter and SetRAMParameter methods

90365ABD
90365AAA

90365ABB
Value

Bytes
Constant Description

CodeERRORFLAGS 1 2 Error flags √ √ √


CodeDIAGRES 2 2 Diagnostic Flags √ √ √
CodeB1 3 B1 field after pre-processing of offset, sens and
2 √ √ √
orth
CodeB2 4 B2 field after pre-processing of offset, sens and
2 √ √ √
orth
CodeTHETAR2P 5 2 Angle w/o post-processing √ √ √
CodeTHETAOUT 6 Post-processed Angle (offset, 4/16pt, filter,
2 √ √ √
clamping)
CodeTEMPSENS1 7 2 Temperature sensor value √ √ √
CodeTEMPSENS2 8 2 Redundant temperature sensor value √ √ √
CodeVIRTUALGAIN 9 2 Actual Virtual Gain √ √ √
CodeFIELDNORM 10 2 Actual field norm √ √ √
CodeFIELDSTRENGTH 11 2 Actual field strength √ √ √
CodeRO_B1 12 2 Rough offset correction Field component B1 √
CodeRO_B2 13 2 Rough offset correction Field component B2 √

PSF090365AAMLX Library Object Model 2013-09-13 - 68 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

8.3 MeasureParameters enumeration


The following constants specify different outputs of MLX90365. They are used by Measure method

Value
Constant Description

MeasOUT1 1 Measure OUT1


MeasVDD 4 Measure VDD

8.4 MeasureTypes enumeration


The following constants specify different types of measurement. They are used by Measure method
Value

Constant Description

MeasPercentVDD 1 Return result in %VDD


MeasVolt 2 Return result in absolute value (measure voltage)
MeasPWM 3 Measure PWM
MeasPWMPeriod 4 Measure PWM period

8.5 SettingCodes enumeration


The following constants specify different settings. They are used by GetSetting and SetSetting methods
and SettingInUse property
In use by
default
Value

Default
Constant Type Description
value

SettingVDDLow 1 float (Single) 0.0 [V] Yes PPS1+2 Level 0


SettingVDDNorm 2 float (Single) 5.0 [V] Yes PPS1+2 Level 1
SettingVDDComm 3 float (Single) 8.0 [V] Yes PPS1+2 Level 2
SettingVBatLow 4 float (Single) 0.0 [V] Yes PPS3 Level 0
SettingVBatNorm 5 float (Single) 6.0 [V] Yes PPS3 Level 1
SettingTpor 6 long (Long) 7000 [µs] Yes Timing 0
SettingTsynchro 7 long (Long) 4200 [µs] Yes Timing 1
SettingTpulsMin 8 long (Long) 7000 [µs] Yes Timing 2
SettingTpulsMax 9 long (Long) 16000 [µs] Yes Timing 3
SettingSynchroDelay 10 long (Long) 200 [µs] Yes Timing 4
SettingBaudrate 11 long (Long) 4800 Yes Communication baudrate
Get/set the load on the outputs
on the daughter board. Possible
values are:
SettingDBLoad 12 byte (Byte) 0 Yes
0 – no load
1 – Resistors 5K6 to PPS3 and
1K47 to VDD (pull-ups selected)

PSF090365AAMLX Library Object Model 2013-09-13 - 69 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

In use by
default
Value
Default
Constant Type Description
value

2 – Resistors 10K to GND (pull-


downs selected)
3 – Both pull-ups and pull-
downs selected
SettingMeasureDelay 13 long (Long) 1000 [µs] Yes Delay before measurement
SettingSampleDelay 14 long (Long) 10 [µs] Yes Sample delay
short
SettingMeasureFilter 15 100 Yes Measure filter
(Integer)
SettingByteDelay 16 long (Long) 200 [µs] Yes Timing 5
short
SettingAngleFilter 17 1 Yes Filter for angle measurements
(Integer)
Number of attempts to read
SettingReadRetries 18 byte 1 Yes
from device’s memory.
Difference (positive or negative)
SettingBaudrateSyncDiff 19 long (Long) 0 [bps] Yes in communication baudrate
during synchronization

8.6 SolverSettingCodes enumeration


The following constants specify different settings. They are used by GetSolverSetting and
SetSolverSetting methods and SolverSettingInUse property
In use by
default
Value

Default
Constant Type Description
value

SolverSettingClampingLow 1 float (Single) 0.0 [%VDD] Yes Clamping low


SolverSettingClampingHigh 2 float (Single) 100.0 [%VDD] Yes Clamping high
SolverSettingPWMFreq 4 float (Single) 100.0 [Hz] Yes PWM frequency
SolverSettingFilter 5 Byte 5 Yes Filter setting
SolverSettingOutput1Mode 6 Byte 2 Yes Output1 mode
Output1DACGain
SolverSettingOutput1DACGain 7 float (Single) 1.0 No*
coefficient
Output1DACOffset
SolverSettingOutput1DACOffset 8 float (Single) 0.0 [%VDD] No*
coefficient
SolverTargetLevelPoint0 9 float (Single) 0.0
[%VDD] Yes Y-coordinate of point 0
SolverTargetLevelPointA 10 float (Single) 0.0
[%VDD] Yes Y-coordinate of point A
SolverTargetLevelPointB 11 float (Single) 0.0
[%VDD] Yes Y-coordinate of point B
SolverTargetLevelPointC 12 float (Single) 0.0
[%VDD] Yes Y-coordinate of point C
SolverTargetLevelPointD 13 float (Single) 0.0
[%VDD] Yes Y-coordinate of point D
SolverTargetLevelPointE 14 float (Single) 0.0
[%VDD] Yes Y-coordinate of point D
0.0
SolverTargetSlopeS0 15 float (Single) No Slope before point A
[%VDD/deg]
0.0
SolverTargetSlopeSA 16 float (Single) No Slope before point B
[%VDD/deg]
0.0
SolverTargetSlopeSB 17 float (Single) No Slope before point C
[%VDD/deg]
SolverTargetSlopeSC 18 float (Single) 0.0 No Slope after point C

PSF090365AAMLX Library Object Model 2013-09-13 - 70 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

In use by
default
Value
Default
Constant Type Description
value

[%VDD/deg]
0.0
SolverTargetSlopeSD 19 float (Single) No Slope after point D
[%VDD/deg]
SolverSettingDP 20 float (Single) 0.0 [deg] Yes DP
SolverSetting4Points 21 Byte 0 Yes 0=17point;1=4points
0 - Atan ( Y / X)
SolverSettingMapXYZ 22 Byte 0 Yes 1 - Atan ( k X / Z )
2 - Atan ( Z / kY)
False (counter-
SolverSettingRotationDirection 23 Boolean Yes Rotation direction
clockwise)
Working range for 17
point mode:
0 - 360°
1 - 320°
2 - 288°
3 - 261.8°
4 - 240°
5 - 221.5°
6 - 205.7°
SolverSettingWorkRange 24 Byte 0 (360°) Yes
7 - 192°
8 - 180°
9 - 144°
10 - 120°
11 - 102.9°
12 - 90°
13 - 80°
14 - 72°
15 - 65.5°
* These settings are never saved to or read from the profile, thus they are constantly marked as unused

PSF090365AAMLX Library Object Model 2013-09-13 - 71 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

9 History records
Version Date Comments
1.14 Sep 10, 2013 Added method Solver.SetPowerSaving
1.13_1 July 24, 2013 Chipversion Corrected
1.13 July 22, 2013 EEPROM /RAM description updated , Hotreset obseleted
1.12 Jun 24, 2013 Added support for MLX90365ABD; Added Solver.Memlock method
1.07 Jun 26, 2012 Added SettingBaudrateSyncDiff and Advanced.MemReadSafe
1.05.02 Feb 28 , 2012 EEPROM description CW corrected, MAPXYZ solversetting corrected
1.05.01 Jan 11 , 2012 EEPROM description added
( was 1.06)
1.05 Dec 23, 2011 Added support of MLX90365ABB
1.03 Sep 17, 2011 Added ReadEEParametersFromIni method
1.01 Jun 2, 2011 Initial release

10 Disclaimer
Devices sold by Melexis are covered by the warranty and patent indemnification provisions appearing in its
Term of Sale. Melexis makes no warranty, express, statutory, implied, or by description regarding the
information set forth herein or regarding the freedom of the described devices from patent infringement.
Melexis reserves the right to change specifications and prices at any time and without notice. Therefore,
prior to designing this product into a system, it is necessary to check with Melexis for current information.
This product is intended for use in normal commercial applications. Applications requiring extended
temperature range, unusual environmental requirements, or high reliability applications, such as military,
medical life-support or life-sustaining equipment are specifically not recommended without additional
processing by Melexis for each application.
The information furnished by Melexis is believed to be correct and accurate. However, Melexis shall not be
liable to recipient or any third party for any damages, including but not limited to personal injury, property
damage, loss of profits, loss of use, interrupt of business or indirect, special incidental or consequential
damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical
data herein. No obligation or liability to recipient or any third party shall arise or flow out of Melexis’ rendering
of technical or other services.
© 2004 Melexis NV. All rights reserved.

PSF090365AAMLX Library Object Model 2013-09-13 - 72 -


Ver.1.14
PTC04 - PSF - MLX90365
Product Specific Function description

website at:
www.melexis.com
Or for additional information contact Melexis Direct:

Europe and Japan: All other locations:


Phone: +32 13 67 04 95 Phone: +1 603 223 2362
E-mail: [email protected] E-mail: [email protected]

QS9000, VDA6.1 and ISO14001 Certified

PSF090365AAMLX Library Object Model 2013-09-13 - 73 -


Ver.1.14

You might also like