A clamping mechanism for clamping an industrial input/output device on a DIN rail, comprising: a shell member, comprising a mechanism assembly receiving space formed at a rear side thereof, a first clamping rod disposed in the mechanism assembly receiving space, and comprising a first driving part, an elastic element mounting part, a first clamping part and a second driving part, and a part of the first clamping part is exposed out of the shell member; an elastic element secured in the mechanism assembly receiving space through the elastic element mounting part; a rotary rod pivotally disposed in the mechanism assembly receiving space, and comprising a first rotary driving part and a second rotary driving part, wherein the second driving part is assembled with the first rotary driving part; and a second clamping rod disposed in the mechanism assembly receiving space, and comprising a third driving part and a second clamping part, wherein the third driving part is assembled with the second rotary driving part, and a part of the second clamping part is exposed out of the shell member, characterized in that the shell member further comprises a sliding track disposed at a top side thereof, the sliding track comprising a first sliding track end and a second sliding track end; an operating link comprising a pivot pin, a rod sliding slot, a first operating part and a second operating part, and slidably and rotatably disposed on the sliding track through the pivot pin, wherein the first operating part and the second operating part are exposed out of the shell member, and the rod sliding slot comprises a first sliding slot end and a second sliding slot end; wherein the first driving part of the first clamping rod is disposed in the rod sliding slot and slidable relative to the rod sliding slot. a shell member, comprising a mechanism assembly receiving space formed at a rear side thereof, a first clamping rod disposed in the mechanism assembly receiving space, and comprising a first driving part, an elastic element mounting part, a first clamping part and a second driving part, and a part of the first clamping part is exposed out of the shell member; an elastic element secured in the mechanism assembly receiving space through the elastic element mounting part; a rotary rod pivotally disposed in the mechanism assembly receiving space, and comprising a first rotary driving part and a second rotary driving part, wherein the second driving part is assembled with the first rotary driving part; and a second clamping rod disposed in the mechanism assembly receiving space, and comprising a third driving part and a second clamping part, wherein the third driving part is assembled with the second rotary driving part, and a part of the second clamping part is exposed out of the shell member, characterized in that the shell member further comprises a sliding track disposed at a top side thereof, the sliding track comprising a first sliding track end and a second sliding track end; an operating link comprising a pivot pin, a rod sliding slot, a first operating part and a second operating part, and slidably and rotatably disposed on the sliding track through the pivot pin, wherein the first operating part and the second operating part are exposed out of the shell member, and the rod sliding slot comprises a first sliding slot end and a second sliding slot end; wherein the first driving part of the first clamping rod is disposed in the rod sliding slot and slidable relative to the rod sliding slot.