WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Serial
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

pSendFile bad port handle

Keywords:   comport pSendFile bad port handle

Question:

I am trying to use the pSendFile function. I keep getting a "bad port handle" error. Here is my code:
Addextender("wwser34I.dll")
a = RegqueryValue(@Regmachine, "Software\ISI\NCRCOMM[Comm_Port]")
Spanner = "COM%a%" 

Command1 = "~" 
Command2 = "Wrenchman_Dev"
Command3 = "WX00"
Command4 = "FE"

port = pComOpen(Spanner, 0, 38400, "8N1", "NONXON") 

pPutLine(port, Command1)
pPutline(port, Command2)
pPutline(port, Command3)
pPutline(port, Command4)


;pcomopen("COM%a%" , 0, 38400, "8N1", "NONXON")
psendfile(Spanner , "XMODEM" ,
"d:\Kyrus\Upgradespring2000\scripts\Kyrus.hex", 0, 1)
pcomclose(Spanner, 0)

What am I doing wrong?

Answer:

pSendFile wants the port handle variable returned by pComOpen, not the raw port number.
pSendFile(Port ,"XMODEM","d:\Kyrus\Upgradespring2000\scripts\Kyrus.hex", 0, 1



Article ID:   W14438
Filename:   pSendFile bad port handle.txt
File Created: 2001:03:01:15:26:16
Last Updated: 2001:03:01:15:26:16