For DM1 and DM2 messages, function blocks for receiving (in the case of remote ECUs) and also for sending (in the case of local ECUs) are available in the IoDrvJ1939 library.
IoDrvJ1939
DM1_Read
DM2_Read
DM1_Write
DM2_Write