Understanding the difference between CAN IDs and PIDS on OBD-II
UDS is a closed standard, but essential parts of it are available online. What you most probably want is UDS service $22: Read Data By Identifier. UDS support different CAN frame structure, the simplest and most used being "single frame":


(image taken from hackaday)

So, you will essentially need to send

0x7E0: 03 22 05 00 00 00 00 00
  |     |  |  \-/------------- DID (two bytes)
  |     |  \------------------ SID
  |     \--------------------- data lenght
  \--------------------------- CAN ID


and wait for a reply with CAN ID 0x7E8. However, reality is usually harder than that: many ECUs will require you to send a Diagnostic Session Control request first, or even reply to Security Access challenge. Others will require a checksum to be present in the last data byte. You may have to experiment quite a bit to get this working on the ECU you have at hand.