gos7
gos7 copied to clipboard
Best practice: Should change 'dbIndex' in 'DBX' format
@robinson , Thanks for your project 'gos7', it is very useful in my project. I found some use tips for develpers in MultiItems write:
- if use
DBXformat, changedbIndex, for example:DB1.DBX12.5, thestartaddressshould bedbIndex + dbBit (DBX12.5 = 12<<3 + 5 = 96+5 = 101 = 0x65), in my case:
dbBit, _ := strconv.ParseInt(string(string(dbArray[2])), 10, 16)
dbIndex = dbIndex<<3 + dbBit
- and, I want to use
20items in oneAGReadMulti, PDU error, so I use16-18, it works. - and I have a question: what is the mean
S7DataItem.Amout, could you tell me some details?
@jiekechoo thanks for you tip as well. Regarding S7DataItem.Amount, it is the amount of address that you want to read from or write to. For example, from AGWriteMulti depend on the Amount it should be converted to to calculate the data_size, whether that is a bit, a timer... Hope that helps. //R