The potentiometer dial or electronic control of power on the machine is the hard limit, no matter what software tells the laser to do.
It is attenuating the 0-5v signal that is coming from the software, it is not possible to overdrive your laser this way. 18ma seems like it might be high for a K40 should be more like 12ma I think.
So, another way to think of this is the software is always going to output 0-5V based on what power level you set between 0%-100%.
The attenuation of the dial scales that voltage down, so if your dial is set to max out at 12ma, then the 100% 5 volt signal from the software is going to be reduced to the voltage that tells the laser to fire at 12ma.
It’s like a brick under your gas pedal in a car, change where the brick is and you can only push it that far.