Code for moving and static gratings for multiple screens