One manure heap extension can be connected to two cows barns, these manure heap extension's have fairly long range so you don't have to physically connect them to the building you want extract manure from. The range connectivity is calculated on the fly, savegame XML config files has no index etc referrals from barns to manure heap or liquidmanure tank (slurry), they just need to be close enough and during game run-time they get connected to any closeby barns. Most likely the range is defined in either in manure heaps / liquidmanure tanks or in the barns XML configs, or it could be just hardcoded engine value "close enough" and connection happens. You can see this distance on SHIFT-P build mode when you move for example manure heap extension or liquidmanure tank extension around a barn.
HOWTO pickup manure from manure heap extension? Take a trailer with capable of transporting manure, then simply drive next to the manure heap and refill when "Start Refilling" appears in F1 menu. Or you could use wheel loader etc with bucket/fork tool to pick manure up.