Mode change detection is necessary to find the moment when the user changes from one mode to the next one.
It is particularly of interest because the program should play the Batman theme once only and at the very moment the user enters the Batman mode as the batman sign is displayed on the oscilloscope immediately upon entering that mode.
By comparing the current program mode to the positive edge of a Batman mode, the LabView program can detect the very moment when the user enters the Batman mode. A pulse is then fed into the sound playing system to start playing the batman theme.
The LabView implementation looks as seen below.