To run a loop test, connect A->Y, B->Z. Connect USB-TTL bridge for example PL2303TA, TXD to RXD, RXD to TXD, 5V-5V, GND-GND.
Legacy Wiki
https://w.electrodragon.com/w/RS-422