The registration command (MSG_MOD_REG) sends the information necessary for the module to identify itself to the server and allows the server to return configuration information.
The registration command is pretty complicated. When necessary OpenDAX packs the binary data that it sends between the server and the modules in an architecture independent manner. The registration command is the when the server works out whether or not the modules need to pack the data. Since the decision has not been made yet, all of the data in the registration command is sent in packed format. So far this is all 32 bit data that is packed into network byte order with the ntohl() and htonl() functions.
To determine whether data packing will be necessary the server will send a set of predefined values to the module. There are a set of precompiler definitions that represent different data types that may have architecture issues. The constants are defined in libcommon.h. The server sends these test points in the same order that they are stored in the server's memory. Then the module unpacks them in the same order that they were sent. Then it compares these numbers to the same precompiler definitions and if all of them are equal then no reformatting needs to be done. Otherwise the module will have to reformat the incoming and outgoing data to match the server. It is up to the module to determine how the data needs to be reformatted.
Since the vast majority of the modules will likely be either local or on the same type of machine it doesn't make sense to use up all the clock cycles packaging and unpacking the data on identical machines.
The server may also rename the module.
The response from the server is...
data[0] = 2 bytes for REG_TEST_INT
data[2] = 4 bytes for REG_TEST_DINT
data[6] = 8 bytes for REG_TEST_LINT
data[14] = 4 bytes for REG_TEST_REAL
data[18] = 8 bytes for REG_TEST_LREAL
data[26] = module name - NULL terminated string
<<<<FINISH THIS>>>>>