original
First we made sure the port was mapped in RDC settings. We also made sure that serial ports were allowed to be mapped on the TS. Once we logged in to TS, we ran the CHANGE PORTS command to display which ports were available and how they were mapped.
In the application, I disabled the initialization of the MSComm object. I then used code I found on Universal Thread to make a file with STRTOFILE() and then used a shell command to RUN PRINT /D:COM:1 test.txt
Here is a code snippet:
#DEFINE SOH CHR(1)
#DEFINE STX CHR(2)
#DEFINE ETX CHR(3)
#DEFINE EOT CHR(4)
lcFR = '11999' && Part number
lcStr = STX + '?:' + lcFR + ETX && Build the configuration string to send to the marker
STRTOFILE(lcStr, "test.txt") && Create file from string
lcStr = STX + ;
ALLTRIM(Block.Serial_Number) + ;
SOH && Get the serial Number
STRTOFILE(lcStr, "test.txt", 1) && Add Serial Number format to text file
STRTOFILE(EOT,"test.txt",1) && Add end of transmission
run print /D:com1 test.txt && Shell out to command window and Print
ERASE test.txt && Delete the file