求助各位大神:端口虚拟怎样写入CE

yue_ss 2017-02-02 09:31:27
用了虚拟端口工具(SPLITTIR3.2)软件,上机测试手动设置好虚拟端口,端口一切正常能搜到星,可关掉车机电源后虚拟端口就消失了,好像不能保存注册表什么之类的?需要制作一个脚本文件,每次自动执行。
思路是:现在利用REG脚本方式,预写出REG脚本内容来实现自动设置虚拟端口的方法,
#关联注册表编辑器
ExtRegEdit "\ResidentFlash\SPLITTER32\RegEdit.exe"
#导入注册表
RegEdit "\ResidentFlash\SPLITTER32\SPLITTER.reg"
#启动虚拟串口驱动程序(注意卡名/文件夹名/)
Run "\ResidentFlash\SPLITTER32\vspd_starter.exe"
#退出
Exit
用虚拟端口工具(SPLITTIR3.2)软件在电脑上模拟能写入注册表虚拟出端口,可上机测试一点没反应,不知道什么原因?就能手动设置可又不能保存注册表,那位大师 有时间能否指点一下谢谢了?.
...全文
1144 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yue_ss 2017-05-01
  • 打赏
  • 举报
回复
谢谢楼上大师的指点,非常谢谢:终于遇到热心人了,现在就是这个语句:RegWriteBinary('HKLM','Drivers\BuiltIn\VSPD1','DevConfig','hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00')二进制值写不了注册表,其他的用注册表编辑工具查看都写进去了,用模拟器测试可以虚拟出端口了,真的太兴奋了,证明我的判断是正确,太谢谢楼上大侠热心的指点了。 If(NOT RegKeyExists("HKLM","\Drivers\BuiltIn\VSPD1")) RegWriteBinary('HKLM','Drivers\BuiltIn\VSPD1','DevConfig','hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00') RegWriteString('HKLM','Drivers\BuiltIn\VSPD1','FriendlyName','Virtual port COM'&VPD&'') RegWriteString('HKLM','Drivers\BuiltIn\VSPD1','Tsp','Unimodem.dll') RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','DeviceType','dword:00000000') RegWriteString('HKLM','Drivers\BuiltIn\VSPD1','Dll', ''&x&'\SPLITTER\vspd.dll') RegWriteString('HKLM','Drivers\BuiltIn\VSPD1','Prefix','COM') RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','Index",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','Is_DynamicSettings",dword:00000001) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','Is_Main",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','InOut",dword:00000001) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','BUndleIndex",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','PortIsRO",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','PortIsshared",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','DeviceArrayIndex",dword:00000001) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD1','Priority",dword:00000000) Endif If(NOT RegKeyExists("HKLM','\Drivers\BuiltIn\VSPD2")) RegWriteBinary("HKLM','\Drivers\BuiltIn\VSPD2","DevConfig","hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00") RegWriteString('HKLM','Drivers\BuiltIn\VSPD2','FriendlyName','Virtual port COM'&VPC&'') RegWriteString('HKLM','Drivers\BuiltIn\VSPD2','Tsp','Unimodem.dll') RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','DeviceType','dword:00000000') RegWriteString('HKLM','Drivers\BuiltIn\VSPD2','Dll', ''&x&'\SPLITTER\vspd.dll') RegWriteString('HKLM','Drivers\BuiltIn\VSPD2','Prefix','COM') RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','Index",dword:00000006) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','Is_DynamicSettings",dword:00000001) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','Is_Main",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','InOut",dword:00000001) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','BUndleIndex",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','PortIsRO",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','PortIsshared",dword:00000000) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','DeviceArrayIndex",dword:00000002) RegWriteDWord('HKLM','Drivers\BuiltIn\VSPD2','Priority",dword:00000001) Endif 恳请楼上大师能否再指点指点;先谢谢了。通讯端口语句上真机测试会不会有影响?
myGlife 2017-03-11
  • 打赏
  • 举报
回复
#1-读取路径信息: path=SystemPath("ScriptExe") p=find(path,"\",2) SD=substr(path,1,p-1) #2-注册处理: #物理端口COM1 If(NOT RegKeyExists("HKLM","\Drivers\BuiltIn\VSPD0")) RegWriteString("HKLM","\Drivers\BuiltIn\VSPD0","Tsp","Unimodem.dll") #"dword:00000000"中的双引号,待测试是否要保留。...如下同规则类推。 RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","DeviceType","dword:00000000") #vspd.dll所在路径,注意据实修改 RegWriteString("HKLM","\Drivers\BuiltIn\VSPD0","Dll",SD & "\VSPD\vspd.dll") RegWriteString("HKLM","\Drivers\BuiltIn\VSPD0","Prefix","SEC") RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","Index",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","Is_DynamicSettings",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","Is_Main",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","InOut",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","BUndleIndex",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","PortIsRO",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","PortIsshared",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","DeviceArrayIndex",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD0","Priority",dword:00000000) Endif #配置虚拟端口COM9 If(NOT RegKeyExists("HKLM","\Drivers\BuiltIn\VSPD1")) RegWriteBinary("HKLM","\Drivers\BuiltIn\VSPD1","DevConfig","hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00") RegWriteString("HKLM","\Drivers\BuiltIn\VSPD1","Tsp","Unimodem.dll") RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","DeviceType","dword:00000000") #vspd.dll所在路径,注意据实修改 RegWriteString("HKLM","\Drivers\BuiltIn\VSPD1","Dll",SD & "\VSPD\vspd.dll") RegWriteString("HKLM","\Drivers\BuiltIn\VSPD1","Prefix","COM") RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","Index",dword:00000009) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","Is_DynamicSettings",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","Is_Main",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","InOut",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","BUndleIndex",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","PortIsRO",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","PortIsshared",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","DeviceArrayIndex",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD1","Priority",dword:00000000) #RegWriteString("HKLM","\Drivers\BuiltIn\VSPD1","FriendlyName","Virtual port COM9") Endif #配置虚拟端口COM8 If(NOT RegKeyExists("HKLM","\Drivers\BuiltIn\VSPD2")) RegWriteBinary("HKLM","\Drivers\BuiltIn\VSPD2","DevConfig","hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00") RegWriteString("HKLM","\Drivers\BuiltIn\VSPD2","Tsp","Unimodem.dll") RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","DeviceType","dword:00000000") #vspd.dll所在路径,注意据实修改 RegWriteString("HKLM","\Drivers\BuiltIn\VSPD2","Dll",SD & "\VSPD\vspd.dll") RegWriteString("HKLM","\Drivers\BuiltIn\VSPD2","Prefix","COM") RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","Index",dword:00000008) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","Is_DynamicSettings",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","Is_Main",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","InOut",dword:00000001) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","BUndleIndex",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","PortIsRO",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","PortIsshared",dword:00000000) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","DeviceArrayIndex",dword:00000002) RegWriteDWord("HKLM","\Drivers\BuiltIn\VSPD2","Priority",dword:00000000) #RegWriteString("HKLM","\Drivers\BuiltIn\VSPD2","FriendlyName","Virtual port COM8") Endif #3-退出程序: Exit
yue_ss 2017-02-04
  • 打赏
  • 举报
回复
这是多图导航里面的主程序: http://pan.baidu.com/s/1slHC4tZ
yue_ss 2017-02-04
  • 打赏
  • 举报
回复
mscr自动程序写注册表类似于: If(NOT RegKeyExists("HKCU","\Software\Franson\GpsGate")) RegWriteDWord("HKCU","\Software\Franson\GpsGate","OutputGroup",1) RegWriteDWord("HKCU","\Software\Franson\GpsGate","NoTrayIcon",1) RegWriteString("HKCU","\Software\Franson\GpsGate\TcpOutput","","") RegWriteString("HKCU","\Software\Franson\GpsGate\PhysicalOutput","","") #输出端口(虚拟端口,可共享)。若要虚拟多个端口,只需将下面那行复制,修改COM2 RegWriteString("HKCU","\Software\Franson\GpsGate\Output","COM6","virtual") RegWriteDWord("HKCU","\Software\Franson\GpsGate\Log","RecordOnStart",0) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Intervals","GSV",5) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Intervals","GSA",5) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Intervals","GGA",1) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Intervals","RMC",1) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","VirtualPort",1) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","TcpPort",20175) RegWriteString("HKCU","\Software\Franson\GpsGate\Input","TcpHostname","hostname") RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","UdpPort",20175) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","RetryConnect",3) #输入端口(物理端口),1代表COM1,2代表COM2,如此类推 RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","Port",1) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","BaudRate",4800) RegWriteDWord("HKCU","\Software\Franson\GpsGate\Input","Source",2) RegWriteString("HKLM","\Software\Franson\GpsGate","InstallPath","%InstallDir%\\") RegWriteDWord("HKCU","\Software\Microsoft\Internet Explorer\Main","Window_Proxin",1) RegWriteDWord("HKCU","\Software\Microsoft\Internet Explorer\Main","Window_Border",1) RegWriteDWord("HKCU","\Software\Microsoft\Internet Explorer\Main","Save_Lock0",732822) Copy(SystemPath("ScriptExe") & "\bizVSerialCE.dll","\Windows\bizVSerialCE.dll") Endif If(NOT ProcExists("gpsgatece.exe")) Run(SystemPath("ScriptExe") & "\gpsgatece.exe") Endif 以上写发。注:GpsGate不适合CE6又缺少DLL
yue_ss 2017-02-04
  • 打赏
  • 举报
回复
您好:刚才在网上转了一圈你说的修改(定制)WinCE OS和编写代码技术含量太高了,有没有比较简单地的?这是在网上下的SPLITTER端口软件: http://pan.baidu.com/s/1mi2T2zA 恳请版主帮忙分析指点一下? 目前理解的多图导航是MortScript编写的CE下启动导航程序。一体机出厂时的导航程序进程被MortScript杀死,继尔启动你事先编写好的进程。大致就是这个意思吧? 现在我的思路是: 能否把REG文件利用MortScript写注册表的方法编入多图主程序?有主程序启动时自动执行写入注册表虚拟出端口。具体该怎么写?我目前反复试着写了几次都提示报错?呵呵:还是能力太有限了,恨自己当初没有好好学习。 能否请版主帮忙写个酷似懒人包的MSCR? 真心希望能得到版主的指点!!!!!!
yue_ss 2017-02-03
  • 打赏
  • 举报
回复
您好版主:你说的方法能在具体地吗?对于CE我刚研究不久,才略懂一点小皮毛。我想能不能把SPLITTER的端口涵数像WolfComAgent软件一样编入主程序,实现有多图主程序去自动执行他。
yue_ss 2017-02-03
  • 打赏
  • 举报
回复
之前还使用过多图主程序加载WolfComAgent虚拟端口软件写入注册表上机测试可以用,可跟网上说的一样不稳定,还掉线,之后在各大论坛里都评论SPLITTIR软件在虚拟端口这一块非常好,于是再继续折腾。 x=(SystemPath('ScriptPath')) y='\'&Part(x,'\',2)&'\'&Part(x,'\',3) Drive='\'&Part(x,'\',2) IniWrite(y&'\GPSPORT.txt','config','sound',0) DSDAY=SubStr(FormatTime('d'),-1,1) WEEKDAY=FormatTime('w') IF (iniRead(y&'\GPSPORT.txt','config','DSTS') > 0) IF (iniRead(y&'\GPSPORT.txt','config','DSTS') = 1) IF (DSDAY = 1 or DSDAY = 3 or DSDAY = 5 or DSDAY = 7 or DSDAY = 9) MouseClick(232,202) EndIf ElseIF (iniRead(y&'\GPSPORT.txt','config','DSTS') = 2) IF (DSDAY = 2 or DSDAY = 4 or DSDAY = 6 or DSDAY = 8 or DSDAY = 0) MouseClick(232,202) EndIf EndIf ElseIF (iniRead(y&'\GPSPORT.txt','config','WEEK') > 0) IF (iniRead(y&'\GPSPORT.txt','config','WEEK') = WEEKDAY) MouseClick(232,202) EndIf EndIf PT=iniRead(y&'\GPSPORT.txt','config','PORT') RT=iniRead(y&'\GPSPORT.txt','config','RATE') FreVP=iniRead(y&'\GPSPORT.txt','config','VPORT') VPA=SubStr(FreVP,-1,1) VPB=SubStr(FreVP,-2,1) VPC=SubStr(FreVP,-3,1) VPD=0 if (not iniRead(x&'\GPSPORT.txt','config','first') = 1) IniWrite(x&'\GPS\SPLITTER\start.ini','Main','ComPort','COM'&PT&':') IniWrite(x&'\GPS\SPLITTER\start.ini','Main','ComBaud',RT) IniWrite(x&'\GPS\SPLITTER\start.ini','CommPort'&VPD,'Enable','Y') IniWrite(x&'\GPS\SPLITTER\start.ini','CommPort'&VPC,'Enable','Y') IniWrite(x&'\GPS\SPLITTER\start.ini','CommPort'&VPB,'Enable','Y') IniWrite(x&'\GPS\SPLITTER\start.ini','CommPort'&VPA,'Enable','Y') DelTree(Drive&'\UPdate\*') EndIf RegWriteString('HKCR','MortScript','', 'MortScript') RegWriteString('HKCR','MortScript\Shell\Open\Command','', '"'&x&'\MortScript.exe" "%1"') RegWriteString('HKCR', '.mscr','','MortScript') If (not FileExists(Drive&'\NAVICONFIG.txt')) WriteFile(Drive & "\NAVICONFIG.txt",'PORT=' & PT & '^NL^RATE=' & RT & '^NL^FreCOMPot=' & FreVP & '^NL^') EndIf If (not FileExists(Drive&'\NAVICONFIG.ini')) Contents="OSVersion=" & SystemVersion("platform")&" "&SystemVersion("major")&"."&SystemVersion("minor") & "^NL^"&\ "SYSMemory=" & TotalMemory(MB)&"MB" & "^NL^" &\ "FreMemory=" & FreeMemory(MB)&"MB" & "^NL^" &\ "ScreenSiz=" & ScreenWidth()&"x"&ScreenHeight() & "^NL^" &\ "SD=" & Drive & "^NL^Toolhelp=^NL^Explorer=^NL^CLD=^NL^DDT=^NL^GD=^NL^TB=^NL^" WriteFile(Drive & "\NAVICONFIG.ini",Contents) EndIf If (iniRead(Drive&'\NAVICONFIG.txt','','PORT') ne PT) IniWrite(Drive&'\NAVICONFIG.txt','','PORT',PT) IniWrite(Drive&'\NAVICONFIG.txt','','RATE',RT) IniWrite(Drive&'\NAVICONFIG.txt','','FreCOMPot',FreVP) EndIf if (iniRead(y&'\GPSPORT.txt','config','first') = 0) old='\Storage Card\MobileNavigator' PLATE=iniRead(y&'\GPSPORT.txt','config','PLATE') IniWrite(y&'\DSA\CONFIG.INI','','plate_number',PLATE) If (DirExists('\UDisk\RtNavi\')) DelTree('\UDisk\RtNavi\*') EndIf XCopy(x&'\0\SKIN.ini',x&'\1\',true) WriteFile(y&'\DSA\PortConfig.txt','comport='&VPC&'^NL^baundrate='&RT&'^NL^virtualport=','','ANSI') IniWrite(y&'\LUKE\CONFIG.INI','','comport',VPC) IniWrite(y&'\LUKE\CONFIG.INI','','baundrate',RT) 这是多图主程序当时加载WolfComAgent的端口软件
91program 2017-02-03
  • 打赏
  • 举报
回复
引用 3 楼 yue_ss 的回复:
您好版主:我想问下能不能让多图主程序加载SPLITTIR软件写入注册表?
多图是什么东东,偶不懂。
yue_ss 2017-02-03
  • 打赏
  • 举报
回复
您好版主:我想问下能不能让多图主程序加载SPLITTIR软件写入注册表?
91program 2017-02-02
  • 打赏
  • 举报
回复
当然,如果无法定制系统,你也可能无法自动运行(开机后自动运行)程序。 如果可以,通过编写代码可以完成将 SPLITTER.reg 的内容写入注册表,方法与 PC 上注册表编程类似。这样实现与上述 LZ 你提供的方法的效果类似。
91program 2017-02-02
  • 打赏
  • 举报
回复
建议你如果能修改(定制)WinCE OS 的话,从这方面入手。 你上面给的方法,是 PC 上的,在 WinCE 下不适用。

19,502

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧