I want to analyse the impact of each layer of CNN. I have trained the CNN model with a dataset. After that, weights of first convolutional layer are fixed and remaining layers are initialise to zero to get the exact impact of first layer. Then test the model with same data. is it correct way?
I don't think this makes much sense. You can't set other layers of the CNN to 0 and expect any meaningful output. As an analogy, suppose you try to analyze what each organ of a human body does by shutting down the rest and testing how the human performs -- likely nothing good will happen and you won't gain any insight. All parts of the system need to function for the whole thing to function.
Now there may be special cases where this is more reasonable -- you might be able to disable some later residual blocks of a resnet without too much trouble. But in general it's not a good idea.