AKD BASIC User Guide | 3 AKDBASICLanguage
This dead-code elimination also applies to functions whose only point of reference lies in elim-
inated code. The functions themselves become dead-code and no code is generated for their
definitions.
The compiler does not eliminate the print statement from the following program:
dim DEBUGGING as integer
Main
dim i, sum as integer
DEBUGGING = FALSE
for i = 1 to 10
sum = sum + i
if DEBUGGING print “partial sum is ”;sum
next i
End Main
In this case, the print statement never executes, but the code to implement is generated
because the value of the integer DEBUGGING could be changed by the AKD’s Integrated
Development Environment Debugger at runtime, causing the print statement to be executed!
3.10 ModBus TCP/IP
Modbus TCP/IP, or Modbus TCP, is a Modbus variant used for communications over TCP/IP
networks, connecting over port 502. A max of 3 masters can be connected to one drive at any
time. Modbus standard limits one master to 256 slaves. Modbus and Workbench (telnet) can be
connected to the same drive at the same time. Because Modbus and Telnet are processed in
the AKD’s background task, 5~10mS delay between messages will prevent over running the
back ground task stack limits.
3.10.1 ModBus Parameter Table
For a list of parameters and their Modbus addresses, visit the Modbus Parameter Table.
For 64 bit to 32 bit mapping, visit Modbus 64-bit Parameters to 32-bit Mapping.
3.10.2 ModBus Register and Data Types
All predefined AKD parameters are Modbus 32 bit or 64 bit (some with and some without sign).
Because most HMI products don’t support 64 bit numbers, the AKD also has a series of match-
ing 32 bit parameters. Ex: PL.FB is a signed 64 bit integer with address number 588. There is
also PL.FB_32 as a signed 32 bit integer with address number 2072. PL.FB_32 is the lower two
16 bit registers of PL.FB.
Typical HMI tag addressing will need the additional “40000” be added to the Modbus address
number. Ex: To create a tag in an HMI to read PL.FB_32, the address number 42072 should be
used.
All AKD command parameter will require writing a “1” to trigger the command. Ex: DRV.EN is
used to enable the drive. To trigger the command, send “1” as a 32 bit integer to address 254.
3.10.3 User Created Variables with Assigned Modbus Address Numbers
User variables can be assigned an Modbus address number. The range of available numbers is
from 5000 to 5999. An example program:
Dim int2 as integer
Dimflt1 as float
Dim long1 as long
41 Kollmorgen™ | March 30, 2012