FR 7851 then FR 808 at Dublin
Cardiff → Dublin → Edinburgh
Timetable, Dublin time
00:50FR 7851 from Cardiff at the gate
20:30FR 808 to Edinburgh leaves the gate
19 h 40 apart on the timetable
FR 808 leaves 19 h 40 after FR 7851 arrives on the timetable: more than half a day, so not a connection we count.