Engineering question about sliding lock.?

I m designing a project and have run into a bit of a speed-bump. I need a system that allows a piece to slide left to right linearly, but need the/a system to lock it in place, stopping it from sliding. The locking mechanism should not be technological preferably, and can not be a friction based lock. Open to all suggestions! Thanks
Answers

Joe

Anything wrong with a classic "barrel bolt latch"? (Google will get you pictures.)

John

Barrel bolt is good. You could, on the cheap, just put a hook that goes into a hole and holds it closed - a hook-and-eye idea. If you need it to actually lock there are many cabinet locks that act in that way.

lee26loo,異域秦後人

USING A STEP MOTOR TO DO THIS TASK.

Starrysky

Magnets. Those might lock a metal latch in place until removed. There are a lot of high strength magnets that will actually injure you if you get caught between them. If one is or is part of the metal latch, and a brass or non-magnetic case holds it, another magnet moved into position could stop the sliding. Moving the locking magnet to one side could release the latch bar. Cheaper would be a single magnet locking an iron latch bar.