21.12.2020, 15:10
(08.12.2020, 12:06)Daniel. Wrote: If somebody struggle to play directly with json file here is Excel file where you can just fill it in and generate the profile.
The json file will be created in the same folder where the Profile generator is and it will have the same name, you can change the name as you want.
Make sure to enable Macros in Excel!
For custom values just create new sheet and create a table for enumeration, Put the sheet name in the value_custom cell.
If you need additional parameters just rename spare column name to needed parameter name and start filling it in.
Modbus documentation is here https://openrb.com/docs/modbus.htm
Hi Daniel
Great tool!
I have one problem though. I have added addresses for a device where there are several custom values. I have added one sheet for each table of enumeration and entered the sheet name in the cell of respective address.
When I run the macro I get an error in the subfunction, saying the subscript is out of range and highlighting the line number 3 in the below code.
Any good idea of what I do wrong?
Code:
Function customValues2Dict(WorksheetName As String)
Dim jsonCustomValues As New Dictionary
Worksheets(WorksheetName).Activate
NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count
For Row = 1 To NumRows
jsonCustomValues(Cells(Row, 1)) = Cells(Row, 2)
Next Row
Set customValues2Dict = jsonCustomValues
End Function
There are 10 kinds of people in the world; those who can read binary and those who don't