Vai al contenuto

Other Application database implementation

Database configuration interface depends on the database structure implemented on the real target.If your target is not running Axel LLExec runtime database implementation and manage- ment could be quite different.Your application database can be implemented in this way:
  • On the target firmware, one or more datablocks have been dedicated to be used for database definition.
  • A convention between Modbus addresses and data access into these datablocks is estab- lished.
  • With GF_ProjectVX Code you can define a variable and map it on the desired datablock; its value can then be accessed by modbus (using the established convention)
Let see it with an example:
  • The target board has been implemented to publish an array of 1000 WORDs, as a dat- ablock towads GF_ProjectVX Code (this is your database).
  • A Modbus address range from 50000 to 50999 has been reserved and dedicated to the access of the database (this is the established convention).
  • If you map a WORD variable on the first element of the datablock its value can be accessed via Modbus at the address 50000, if you map it on the second element it can be accessed via Modbus at the address 50001, and so on; if you map it on the last element of the datablock it would be accessible at the address 50999.
  • If you use GF_ProjectVX Code resources configurator (click on Parameters or Status variables node) you will be able to choose Modbus addresses, then corresponding variables will be auto- matically mapped onto the right place on the datablock.
In this way you don’t have to take care of where the variable is mapped onto the datablock. You can refer to the variable in the PLC using the name you have chosen anda Master can access to it using the assigned Modbus address.