Its function is to detect sensations, for example pain, at sensory receptors. An action potential then travels across the nerve, passing along the myelinated axon, and then the electrical signal is converted into a chemical signal to cross the synapse.