How to move a rigid wall in lammps

thanks for your response and help, i have tried this variable way, and this did not work.
I believe that wiggle could be alternative method for me to compress the single particle, but I then face another problem about the force of wall. I wish to obtain the relationship between “generated force” and “displacement". I checked the doucmentation, i cited “If the contacts option is used, this fix generates a per-atom array with 8 columns as output”
but this command seems did not work well:

fix 3 all wall/gran hooke/history 200000000.0 NULL 50.0 NULL 0.5 0 zplane 0 NULL contacts
fix 4 all wall/gran hooke/history 200000000.0 NULL 50.0 NULL 0.5 0 zplane NULL 0.01 wiggle z 1 1 contacts

as suggested, I used wiggle in z direction to order to compress the single particle. but then i tried to get the force of the top wall by this

variable        wall_force_x_t equal -f_4[2] # x component of top wall
variable        wall_force_y_t equal -f_4[3] # y component of top wall
variable        wall_force_z_t equal -f_4[4] # z component of top wall
fix             5 all print 100 " ${wall_force_z_t} " file thermo_output.txt screen no

but i got the ERROR: Variable wall_force_z_t: Per-atom fix in equal-style variable formula (…/variable.cpp:1820).

if you are happy, would you mind share any idea for this siutation, how should i can the force and position of the wall ?

thanks for your time and help, hope you have a nice day