Here is the page from the manual :-
SwapAxis
Sub SwapAxis(FirstAxis As Integer, SecondAxis As Integer)
This function swaps the STEP and DIR pins for the two specified axes. This has
precisely the same effect as changing the pin settings in Config->Ports&Pins. Note that
no other axis parameters or settings are changed. If the two specified axes have different
acceleration and velocity settings, unreliable operation will likely result. Note also that if
you exit Mach3 while the swap is in effect, the swapped pins will be written to the XML
configuration file, and the swap will still be in effect the next time you start Mach3. It is
illegal to perform two consecutive swaps, without first executing a ResetAxisSwap().
Doing so will likely result in incorrect operation.
Arguments:
FirstAxis in an Integer value that specifies the first axis to swap. 0=X, 1=Y, 2=Z,
etc.
SecondAxis in an Integer value that specifies the second axis to swap. 0=X, 1=Y,
2=Z, etc.
Return Value:
None