dim cnvt
dim temp()
dim obj_s_com
dim soutput
set cnvt = createobject(ads.arrayconvert)
set obj_s_com = screenitems(m_com)
obj_s_com.commport = 1
redim temp(2)
temp(0) = &heb
temp(1) = &h90
temp(2) = &h71
dim v,v1,v2,v3,v4
v = temp
hmiruntime.trace the v is: & vartype(v) & &typename(v) &vbcrlf
obj_s_com.output = v
v1 = cnvt.cvoctetstr2vstr(v)
hmiruntime.trace the v1 is: & vartype(v1) & &typename(v1) & &vbcrlf
obj_s_com.output = v1
v2= cnvt.cvstr2voctetstr(v1)
hmiruntime.trace the v2 is: & vartype(v2) & &typename(v2) & &vbcrlf
obj_s_com.output = v2
v3 = cnvt.cvoctetstr2vhexstr(v)
hmiruntime.trace the v3 is: & vartype(v3) & &typename(v3) & &vbcrlf
obj_s_com.output = v3
v4 = cnvt.cvhexstr2voctetstr(v3)
hmiruntime.trace the v4 is: & vartype(v4) & &typename(v4) & &vbcrlf
obj_s_com.output = v4
可以发现比如>&h7e的ansi字码也可以通过串口正常发送。
vds.dll的下载地址:
http://support.microsoft.com/kb/250344/en-us
----------------------------------------------
此篇文章从博客转发
原文地址: Http://blog.gkong.com/more.asp?id=100310&Name=jczwfy