The binary equivalent of '45' is: 0010 1101. Whenever data is transmitted between processors, it is always done as binary. It is important to understand the format required at the robot. If it needs the data to be 8 bits wide (1 byte), then they variable in the S7 CPU should be in byte word format (MBXX). Your approach should work as long as you get the data you want in the variable you configured.