Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practice: Should change 'dbIndex' in 'DBX' format #58

Closed
jiekechoo opened this issue Apr 11, 2023 · 1 comment
Closed

Best practice: Should change 'dbIndex' in 'DBX' format #58

jiekechoo opened this issue Apr 11, 2023 · 1 comment

Comments

@jiekechoo
Copy link
Contributor

@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 DBX format, change dbIndex, for example: DB1.DBX12.5, the startaddress should be dbIndex + 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 20 items in one AGReadMulti, PDU error, so I use 16-18, it works.
  • and I have a question: what is the mean S7DataItem.Amout, could you tell me some details?
@robinson
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants