Why do they have DYN2 and DYN4 drives on the same schematic?
This diagram does the job of two by showing the connections for either type drive. The DYN2 drive can be replaced with another DYN4 wired in a fashion similar to the first DYN4.
The SP1 and DR1 pairs would be connected to the second drive like the SP0 and DR0 are connected to the drive pictured.
The +24 and COM pins on the DNY4 are not power pins for the DNY4 logic. They are the common terminals for groups of opto-isolated input and outputs. +24 is used with inputs, COM is used with outputs. However the wiring is done in a way that only allows one circuit from each group to be used, think of it a a hack to allow two slightly different systems to be connected.
I have replaced the DYN2 on the diagram with a DYN4. The wire from the second DYN4 COM pin 5 could be connected to either INP8 or INP9 depending on whether you want to share.
+24Vin is the drive enable. It could be moved to OUT1 if separate control is needed.
Again, it does sound strange that the +24Vin is an input and COM pin 5 is an output but that's how this circuit works.