  In this work, we consider a wireless networked control system (WNCS)
consisting of a plant, a battery-operated sensor, a controller, and an
actuator. The battery in the sensor harvests energy from the environment. The
sensor then uses this energy for packet transmissions. There are two types of
wireless communication channels, (i) sensor--controller channel (also called
uplink channel), and (ii) controller--actuator channel (also called downlink
channel). The controller is \emph{half-duplex}, and this prevents it from
simultaneously receiving an update from the sensor, and also transmitting a
control packet to the actuator. Though frequent transmissions via uplink
channel improve controller's estimate of the plant state, but this also reduces
the timely control of the plant. Hence, in order to strike a balance between
these two, we consider the problem of designing an optimal scheduling policy
that minimizes the expected cumulative infinite horizon discounted cost, where
the instantaneous cost is equal to the square of the plant state. At each time
$t$, the scheduler at the sensor has to decide whether it should activate the
uplink channel, or downlink. We pose this dynamic optimization problem as a
Markov decision process (MDP), in which the state at time $t$ is composed of
(i) the plant state $x(t)$, (ii) the age of the data packet available at the
controller, denoted by $\tau(t)$, (iii) a binary variable $y(t)$ which
indicates the availability of a control packet at the controller, and (iv) the
energy level of the battery at the sensor $b(t)$. We show that there exists an
optimal scheduling policy that exhibits a threshold structure, meaning that for
each time $t$, if there is a control packet available with the controller, then
the sensor activates the downlink channel in case $|x(t)|$ exceeds a threshold
$x\ust(\tau(t),b(t))$.
