A computer-implemented method for automatic generation of a program for a controller-based device (102-N) in a group of controller-based devices , comprising: receiving, at a code virtualization server , CVS, from a user device , for a controller-based device from a plurality of controller-based devices displayed on a graphical user interface , GUI, on the user device, a selection comprising: a controller type of the controller-based device, a communication protocol to be used by the controller-based device for communicating with another controller-based device in a group of controller-based devices, the group comprising the plurality of controller-based devices, and a function to be performed on the CVS based on a remote call from the controller-based device to the CVS; automatically generating , on the CVS, a first code, for execution on the controller-based device, the first code based on the controller type, the communication protocol, and the function, wherein the first code comprises the remote call for performing the function on the CVS, and capable of routing the remote call from the controller-based device to the CVS, dispatching the first code to the controller-based device for installation on the controller-based device, receiving the remote call from the first code installed on the controller-based device, and executing a second code including one or more predefined processes on the CVS based on receiving the remote call, wherein each of the user device, the CVS and the controller-based device is remote from each other. receiving, at a code virtualization server , CVS, from a user device , for a controller-based device from a plurality of controller-based devices displayed on a graphical user interface , GUI, on the user device, a selection comprising: a controller type of the controller-based device, a communication protocol to be used by the controller-based device for communicating with another controller-based device in a group of controller-based devices, the group comprising the plurality of controller-based devices, and a function to be performed on the CVS based on a remote call from the controller-based device to the CVS; a controller type of the controller-based device, a communication protocol to be used by the controller-based device for communicating with another controller-based device in a group of controller-based devices, the group comprising the plurality of controller-based devices, and a function to be performed on the CVS based on a remote call from the controller-based device to the CVS; automatically generating , on the CVS, a first code, for execution on the controller-based device, the first code based on the controller type, the communication protocol, and the function, wherein the first code comprises the remote call for performing the function on the CVS, and capable of routing the remote call from the controller-based device to the CVS, dispatching the first code to the controller-based device for installation on the controller-based device, receiving the remote call from the first code installed on the controller-based device, and executing a second code including one or more predefined processes on the CVS based on receiving the remote call, wherein each of the user device, the CVS and the controller-based device is remote from each other. <EOS>