Normally you need two cables into two expression inputs, if you want use the integrated switch of a pedal. With a virtual switch, switching operations can be carried out with only one cable into one expression pedal input. The prerequisite for this is an expression pedal with a switch or an extra pedal travel to trigger a virtual switch (e.g. Yamaha FC7).
How it works:
Total pedal travel with the toe switch depressed: Midi value 127
Normal pedal travel: midi values 0-124 (estimated) calibrated to 0-100%
If you press the switch, the value rises above 124 and you can use it to trigger a virtual switch. It would also be nice to set it to latching or momentary and the possibility to give that switch a value (e.g. change the value of gain, reverb amount and so on).
During the calibration, the entire pedal travel would then have to be measured with the switch depressed and then the pedal travel without the switch depressed. The mean value of the difference serves as a trigger, e.g. 125 - 127 → mean value = 126.