Author Topic: Numeric format in the basicdatalogger2  (Read 1166 times)

rmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Numeric format in the basicdatalogger2
« on: March 19, 2017, 10:16:47 PM »
Any idea of how to control/change the numeric format for the collection members in the basicdatalogger2?
I'm getting the values from the PLC in floating point format with >5 decimal places, but only want to round/save them in the log file with one or two decimal places.

Thanks.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Numeric format in the basicdatalogger2
« Reply #1 on: March 20, 2017, 10:15:22 AM »
If this is the only BasicDataLogger2 you are using in the project, the easiest would be to modify the code to always use 2 place.

- In Solution Explorer, expand down the AdvancedHMIControls project
- Expand down the \Components folder
- Right click BasicDataLogger.vb and select View Code
- Go to line 229 and edit the code like this:
Code: [Select]
StringToWrite &= "," & CDbl(item.LastValue).ToString("0.00")

rmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Numeric format in the basicdatalogger2
« Reply #2 on: March 20, 2017, 10:43:22 AM »
Thank you for your reply Archie.
I'm using two instances of Basicdatalogger2 to write/update two separate log files.
Will try your suggestion as soon as I can.

rmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Numeric format in the basicdatalogger2
« Reply #3 on: March 20, 2017, 10:52:40 AM »
It does work!
Thank you again for your prompt reply.