hexagon logo

Reading temperature through automation

Hello!

Looking into extracting axis sensor temperatures, Curtemp did not seem to update automatically, and was not in the registerary at all when I looked on a 2022-installation. Anyone who knows how? Slight smile

Regards
  • A user was kind enough to let me check some things on his PC-Dmis computer and I learn some things. As it turns out, it looks like we can access temp compensation information without using PC-Dmis Automation. After parsing through the Windows registry, it appears that PC-Dmis stores the temp compensation information in the registry. A stand-alone C#/VB console application would be all you need to extract the temp compensation information. That being said, accessing the registry programmatically is not for the novice. For one, C#/VB code for accessing the registry is a little complicated. You also will need to know the internal PC-Dmis version number in order to find the right registries. Finding the internal version number is a little easier with later versions, for the most part it's the external version number (i.e., 2021) with the MR number appended as a decimal (i.e. Version 2022 MR 1 would be 2022.1).

    If there is still an interest on this issue, I think I have some code for when I wrote a PC-Dmis Automation application that allowed the user to switch between multiple PC-Dmis versions installed on the same computer, which required code to access the registry. If I can find it, I'll see if I can put together a simple console application that can access the temp data in the registry and post it here. It will be a read only application so as to not inadvertently screw up your registry.
  • A user was kind enough to let me check some things on his PC-Dmis computer and I learn some things. As it turns out, it looks like we can access temp compensation information without using PC-Dmis Automation. After parsing through the Windows registry, it appears that PC-Dmis stores the temp compensation information in the registry. A stand-alone C#/VB console application would be all you need to extract the temp compensation information. That being said, accessing the registry programmatically is not for the novice. For one, C#/VB code for accessing the registry is a little complicated. You also will need to know the internal PC-Dmis version number in order to find the right registries. Finding the internal version number is a little easier with later versions, for the most part it's the external version number (i.e., 2021) with the MR number appended as a decimal (i.e. Version 2022 MR 1 would be 2022.1).

    If there is still an interest on this issue, I think I have some code for when I wrote a PC-Dmis Automation application that allowed the user to switch between multiple PC-Dmis versions installed on the same computer, which required code to access the registry. If I can find it, I'll see if I can put together a simple console application that can access the temp data in the registry and post it here. It will be a read only application so as to not inadvertently screw up your registry.


    Hats off to the person who shared their PcDmis!
  • Hello!

    Looking into extracting axis sensor temperatures, Curtemp did not seem to update automatically, and was not in the registerary at all when I looked on a 2022-installation. Anyone who knows how? Slight smile

    Regards


    It should be in the registry somewhere, have you executed PC-Dmis at least once with Administrator privileges after installing PC-Dmis? PC-Dmis needs admin privileges at least once to create and write its registries. Afterwards, admin privileges are not needed. This issue may be specific to the protection level related to how the PC was setup with the Windows OS.

    In any case, on the system I looked at, the current, prior temp as well as the date and time the temps were taken were found in the following registry path:

    Computer\HKEY_CURRENT_USER\SOFTWARE\WAI\PC-DMIS\2015.1\Option

    Here are a few of the registers in the above path:

    CurTemp# - where the # is the sensor number.
    PriorTemp# - ditto
    DateCurrentTemps - In 00:00 format.
    DatePriorTemps - ditto
    TimecurrentTemps - also in 00:00 format

    Another path is:

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\W AI\PC-DMIS\2015.1\USER_TempComp

    In this part are registers that indicate whether or not TempComp is turned on, is it using Celsius and so on. It is here that the registries SensorNumberP, SensorNumberX, SensorNumberY and SensorNumberZ have the number(s) of the sensors used for the Part and the three primary axis. Of course, you may already have the sensor numbers for when you set up the TempComp PC-Dmis command.

  • Hello,

    I am using v2021.2 with a DEA Global

    I found the entry in the registry. But at least for me this value is never updated.
    "DateCurrentTemps" is set to 12/06/2020. CurTemp1 does not match what is displayed in pcDMIS.

    Whether or not I have the temperature compensation command in the measurement routine does not change these registy values for me.
    registry "USER_TempComp" is set to (1) true, but does not change the other values.


    Now the big question is what do I have to press where so that it is updated correctly again?​ Slight smile
  • ...are you absolutely sure that you are looking at the correct registrykey (for your version and OS)?
  • Just a heads up.

    I am currently using the json file to get the last probe and recall directories for the offline seat from my start application. I haven't had a chance to add the Temp comp to the application yet for testing purposes.
    Below is the link to the help files.

    From the help file:
    Link: https://www.pcdmisforum.com/forum/pc-dmis-enterprise-metrology-software/pc-dmis-code-samples/532636-reading-temperature-through-automation#post534058

    Beginning with version 2022.1, PC-DMIS no longer stores its settings inside the Windows registry. PC-DMIS stores its settings in JSON files. PC-DMIS reads the entries each time it starts.
    UserSettings.json

    Beginnning with version 2022.1, PC-DMIS stores its user settings in the UserSettings.json file. The file is available in this folder:

    C:\Users\<username>\AppData\Local\Hexagon\PC-DMIS\2022.1

    Before 2022.1, PC-DMIS used to store its User settings in the Windows registry in this key (for example, 2021.2):

    Computer\HKEY_CURRENT_USER\SOFTWARE\Hexagon\PC-DMIS\2021.2

    SystemSettings.json

    Beginnning with version 2022.1, PC-DMIS stores its system settings in the SystemSettings.json file. The file is available in this folder:

    C:\Users\<username>\AppData\Local\Hexagon\PC-DMIS\2022.1

    Before 2022.1, PC-DMIS used to store its System settings in the Windows registry in this key (for example, 2021.2):

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Hexagon\PC-DMIS\2021.2
  • Thanks for the heads up, the latest version I have access to is 2017. Now I'm wondering if there are any changes made to the PC-Dmis Automation API or the implementation thereof that I need to be aware.
  • I checked the registry in an earlier version, but values don’t seem to update.
  • Same issue, though I didn’t try to add a temp comp object to the program.
  • Thought so, is the file updated continuously?