Sensor from engine spark plug: only collecting data for a few seconds.

Provide a complete wiring diagram. This is probably a hardware issue and not a software issue, otherwise it wouldn't work with the signal generator too.