Don't remember where I googled this but to work with Python3:
replace binascii.a2b_hex(b) with: binascii.unhexlify(b)
and maybe your issue is in the example add: ,encoding='latin1'
like this:
SocketSend(s,"C1:WVDT WVNM,wave1,FREQ,2000.0,AMPL,3.0,OFST,0.0,PHASE,0.0,WAVEDATA,%s"%(data),encoding='latin1')