Using a 4-wire machine with a 3-wire receptacle?
Cordage is the wire used in cords.  In cordage, the numbering includes the ground wire (unlike in-wall building cables).  So 12/3 cordage is black white ground. If you are running 240V then it is incapable of supporting a neutral wire, since the white must be used for the second hot.  Feel free to mark the white wire with red tape.  When connecting it to a NEMA 6, hook it up straight.  When hooking it to NEMA 14, don't connect anything to the neutral lug. 

If your equipment is using 12/3 in-wall building cable (e.g. Romex, NM, UF, etc.) then remove it and go to the local electrical supply and get proper cordage.  You can also buy cordage with the plug you want already premolded onto the end. Or obtain an extension cord whose cable has correct ratings for cordage, and lop off the bits you don't need. 

As far as I know, it's legal to put a 30A plug on a 15A device, and on this forum we've visited that question a few times and nobody's come up with a code cite saying it's not allowed.  Just the same if building it from scratch, I would've gone NEMA 6-20 simply because the parts are significantly less expensive. Given where you are now, you could price it both ways and see: 


6-30 plug vs 
6-20 plug, 6-20 receptacle and 20A breaker.