How does the cannon move in xiangqi?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws and is regression-tested against the official 110-diagram repetition casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it against the engine before publishing.
Direct answer
It moves like a chariot — any distance along a completely clear rank or file. It captures by jumping exactly one piece, of either colour, and taking the first enemy piece immediately beyond it. The two rules are opposites, which is what makes the cannon unlike anything in chess.
The screen
The piece jumped over is the screen (炮架). Exactly one is required: with none, the cannon cannot capture; with two, it cannot either. The screen may belong to either player, and it may be any piece type.
So a cannon aimed at an undefended piece down an empty file is not attacking it.
Lines that switch on and off
Because adding a piece can enable a capture and removing one can disable it, cannon threats appear and vanish with moves that look unrelated. Two habits follow: before a quiet move, check you are not removing your own screen; and after your opponent moves, recount the pieces on every line where a cannon faces your general.
Related questions
Can a cannon capture the piece it jumps?
No. It captures the first enemy piece beyond the screen, never the screen itself.
Can a cannon jump two pieces?
No — exactly one, or the capture is illegal.