Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with com port, FPD2.6 and XP Pro
Message
 
 
To
22/06/2004 12:54:31
Peter Heinicke
Precision Computer Methods Inc
West Chicago, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00916109
Message ID:
00916121
Views:
8
Hi Peter,

Fpd 2.6 applications don't have dirrect acces to com port under WinXP. We resolved this problem by writing data to the file first and than using COPY command to send it to com port. Here's a piece of code that does it
m.pcLabelStr = ""
..
m.pcLabelStr = m.pcLabelStr + ;
               ...
...
m.pcLabelStr = m.pcLabelStr + ;
                IIF(m.type="",CHR(27)+"Y"+CHR(0),"")+ REPL(CRLF,m.width)+ ;
                 BIGMODE + PADC( m.att_custno, BIGFONTLINEWIDTH )  + CRLF +
                 BIGMODE + PADC( TRAN( m.btn, "@R 999-999-9999" ), BIGFONTLI
             PADC( TRIM( m.swac_cus ), SMALLFONTLINEWIDTH ) + CRLF + CHR(12)

m.pcTempFile = < ... >
m.pcCmd = "RUN cmd /c copy " + m.pcTempFile  + " " + pcComPortString
=_strfile(m.pcTempFile, m.pcLabelStr)
&pcCmd
ERASE (m.pcTempFile)
>I have a FPD2.6 program which prints labels out to a dymo SE300 serial labelwriter. It uses a language called ZPL to communicate with this printer over the serial port. The program works fine from Windows 98, but when I try it in windows XP Pro, it hangs when the first character is sent out to the com port. The code fragment is
>
>SET PRINTER OFF
>SET PRINTER TO COM1,9600,N,8,1,S && Need for DOS
>!MODE COM1 BAUD=9600 PARITY=N DATA=8 STOP=1 XON=ON
>SET PRINTER ON
>
>? "^027*^029t^040^029V1"
>
>
>
>The stuff after the ? is ZPL. The progran hangs on the output to the com port with
>"PRINTER NOT READY" retry or cancel.
>
>I am stuck here. I know the cables and hardware and baud rates are correct because I can
>
>COPY FILE.TXT COM1:
>
>from a command window within XP Pro and it prints fine.
>What is wrong/what would you suggest to make it work?
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform