AdvancedHMI Software

General Category => Support Questions => Topic started by: rmac on March 19, 2017, 10:16:47 PM

Title: Numeric format in the basicdatalogger2
Post by: rmac 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.
Title: Re: Numeric format in the basicdatalogger2
Post by: Archie 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")
Title: Re: Numeric format in the basicdatalogger2
Post by: rmac 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.
Title: Re: Numeric format in the basicdatalogger2
Post by: rmac on March 20, 2017, 10:52:40 AM
It does work!
Thank you again for your prompt reply.