Abstract-We present a general stochastic optimization framework for periodic systems and apply it to PLC networks with linear and time varying (LPTV) channels. Our method of solution operates online and does not assume prior knowledge about the distribution of channel states, but rather samples the LPTV channel to learn the information necessary to compute optimal control policies. We apply this framework to compute optimal bit allocations (rates) and transmit powers for each transmit period over an AC cycle, subject to requirements on average bit error rates and finite buffer sizes. The resultant policies find bit loadings that maximize throughput, while meeting BER requirements and preventing buffer overflow.