The newest polarization controllers, like the N7785C and N7786C have a convenient SCPI command set for programming. The functions to generate a sequence of polarization states that can be repeatedly scanned and synchronized with other instruments is very powerful. The N7786C also includes a built-in polarimeter to monitor and stabilize the output polarization in real time. This application note describes several methods to align polarization with device axes, like the TE and TM orientation of chips and wafers, using the new controllers.
An example as python script is attached for the second method using the stabilizer function with the polarimeter. An example for the first method was included at this thread.