I believe the problem is you need to declare your variables inside Sub Main but outside of the main loop function. Also Im not positive, but you may need to have... /declare tankname global /varset tankname "@Param0" inside Sub Main also, but since you didn't say that was a problem I'll le...