Summary
This document provides troubleshooting steps to follow for configuring an application and its device to use Citrix’s COM port redirection technology.
Caution! This procedure requires you to edit the registry. Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Back up the registry before you edit it.
For information about how to edit the registry, view the “Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe.
Procedure
- From the server console, verify that the application works properly when the COM port device is physically attached to the COM port of the Citrix server.
Note: It is possible that the application and device will work properly, outside the Citrix client, when installed on a Windows 9x, Windows 2000, Windows NT 4.0, and later workstation, but not on the server console. Microsoft’s Terminal Services kernel is different from the standard Windows kernel. Therefore, the application vendor needs to resolve the server console issue with Microsoft. Note any needed changes to baud rate, stop bits, data bits, or parity with respect to the server COM port. Ensure that the application does not install a service on the server. Because the service runs in the context of the console winstation, no COM ports are associated with the service. Therefore, COM port redirection fails inside a session.
- Test with a RDP session with COM Port Mapping Enabled. See the 5.2.3790.0 Client Help for more information.
- After you verify that the application and device function properly at the server console, make a server desktop connection from the Citrix Client. The connection can be a server connection to the name or IP address, or a published application to the server desktop.
- From a command prompt inside the Citrix desktop session, type net use, and then press ENTER. The output will be similar to this:
NOTE: Citrix does not automatically map client COM ports.
C:Documents and SettingsAdministrator.COLORS>net use
New connections will not be remembered.
Status Local Remote Network
A: \ClientA$
Client Network F: \ClientF$
Client Network LPT1 \ClientLPT1:
Client Network LPT2 \ClientLPT2:
Client Network U: \ClientD$
Client Network V: \ClientC$
Client Network
- Type net use comx: \clientcomz:, where x is the server COM port and z is the client COM port. Also, client, is the word client and not the client workstation name. For NFuse implementations, it might be necessary to edit the template.ica file from COMAllowed=NO to COMAllowed=Yes.
- Type net use then press ENTER. The output will be similar to the one below:
C:Documents and SettingsAdministrator.COLORS>net use
New connections will not be remembered.
Status Local Remote Network
A: \ClientA$
Client Network COM1 \ClientCOM1:
Client Network F: \ClientF$
Client Network LPT1 \ClientLPT1:
Client Network LPT2 \ClientLPT2:
Client Network U: \ClientD$
Client Network V: \ClientC$
Client Network
- See CTX110289 – Client COM Port Cannot be Mapped Using the Net Use Command.
- For NFuse /Web Interface: Page 117 of CTX102298 – Customizing the Web Interface for MetaFrame XP
Not supported by minimum Web Client.
Not supported by the Java Client.
COMAllowed Enables or disables client COM port mapping. Specify Yes to enable, No to disable. This should be written in the application server section of the Template.ica file.
For example:
COMAllowed=yes
-Or-
COMAllowed=No
- CTX111411 – Wfica32.exe Causes 100 Percent CPU Usage When COM Port Mappings are Used Through an ICA Session
- CTX113159 – How to Select the Appropriate IMA Modules When Obtaining a Citrix Diagnostic Facility Trace for a COM Port Redirection Issue
- CTX113334 – Error: Error while trying to access COM port
- CTX112154 – A High-latency Connection has a Slow Transfer Rate Though a Mapped COM Port
- Verify Client Drives can be mapped. If not, refer to CTX238200 – Troubleshooting Client Drive Mapping. The resolution is probably Step 7.
- CTX115001 – System/Context switches/sec and Processor/%Interrupt time show Error status in the Presentation Server Console
Notes:
COM port mapping is not TAPI-compatible. TAPI devices cannot be mapped to client COM ports.
On the client side, the Win32 Client can map nine ports (COM1-COM9) and the DOS32 Client can map four ports (COM1-COM4). This is the design of the Client Operating System .COM ports on the client side must be physically available. MetaFrame XP Service Pack 2 could not map to client com9. This was addressed in SP3 for MetaFrame XP in conjunction with the 7.0 Version Win32 client.
If you map COM1 on the client to COM5 on the server, install your COM port device on COM5 during the session on the server. Use this mapped COM port as you would a COM port on the client computer.
If the following error messages are received:
"System error 55 has occurred"
– Or –
"The Specified Network Resource or Device is no Longer Available"
Check the transport protocol under Citrix Connection Configuration in MetaFrame 1.8 or Terminal Server Connection Configuration in MetaFrame 1.0.
a. Double-click the transport protocol connection in question.
b. Go to Client Settings.
c. Clear the Disable Client COM Port Mapping box.
d. Log all users off and back on.
e. The net use command now functions as intended.
f. Verify the port being mapped on the client side is a physical port.
g. Make any MODE changes from Step 1 inside the client session. Type Mode |more to determine the existing session settings. An example of the output is below:
Status for device COM1: Baud: 115200
Parity: None
Data Bits: 8
Stop Bits: 1
Timeout: ON
XON/XOFF: OFF
CTS handshaking: ON
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit: ON
RTS circuit: HANDSHAKE
Type mode /? to configure any needed settings. The MODE command configures system devices.
Serial port: MODE COMm[:] [BAUD=b]
[PARITY=p]
[DATA=d]
[STOP=s]
[to=on|off]
[xon=on|off]
[odsr=on|off]
[octs=on|off]
[dtr=on|off|hs]
[rts=on|off|hs|tg]
[idsr=on|off
]Device Status: MODE [device]
[/STATUS]
Redirect printing: MODE LPTn[:]=COMm[:]
Select code page:
MODE CON[:]
CP SELECT=yyy
Code page status: MODE CON[:] CP [/STATUS]
Display mode: MODE CON[:] [COLS=c] [LINES=n]
Typematic rate: MODE CON[:] [RATE=r DELAY=d]
Additional Notes
Mode settings for Windows 95/98 and Windows Me must be set after each logon. This behavior does not happen with DOS, Windows 3.1, Windows NT or Windows 2000 workstations. In addition, the only Mode setting for WIN9X and Windows ME that can be changed inside an ICA session is Baud. Parity, Data bits, or Stop bits, can not be changed, inside an ICA session, for WIN9X and Windows ME.
Additional COM Ports Created After Installing Citrix Service Pack 1 or its equivalent: On the server side, a limit of nine COM ports can be mapped from the server because the server does not recognize COM ports with two-digit names. When installing Service Pack 1 for MetaFrame 1.8, 7 more COM ports (numbers 3 to 9) are created by default. The extra COM ports were added to provide support for those customers who map those ports to the client. They are recreated by default at reboot if deleted.
This is by design. However (from Hotfix ME182T003 Readme for MetaFrame 1.8 for Windows Terminal Server), The number of COM ports created by Cdmsvc.exe was raised to 9 by changes in MetaFrame 1.8, Service Pack 1, and this value was hard coded. This change caused an existing customer configuration to fail because their modem redirection software would not work with a COM port higher than 9. This hotfix can be applied only to a Windows Terminal Server with MetaFrame 1.8 and Service Pack 2 installed. This fix is included in SP3 for MetaFrame. The default remains 9 but it can be modified by defining/creating the following registry key:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesCdmServiceParameters
Then Add "DefaultComPorts" as a REG_DWORD value in the range of 0 to 99.
Note: For Citrix XenApp 6 for Windows Server 2008 R2, release the new location for the registry key is HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicespicaserParameters and the maximum supported ports are until 32.
When this value is set, you must manually remove the already defined COM port keys from the following registry key:
HKEY_LOCAL_MACHINEHARDWAREDEVICEMAPSERIALCOMM
Reboot the system once these changes are made.
In Terminal Server Edition 4.0, it is possible to access a clients Com port from an NT Service running at the console using the following path: \.DeviceCdmRedirectorCOM1:1CLIENTPORT:COM1:
Windows 2000 code does not support this functionality.
Sharing data across processes running in MultiWin sessions is documented in MSDN – Search on "Programming Guidelines for Terminal Services."
Additional Tuning COM Port Redirection Tips
Ensure that the following lines are in the Wfclient.ini file:
[ClientComm]
CommPollSize=On
CommPollWaitMin=0
CommPollWaitMax=500
CommPollWaitInc=1
CommPollWaitIncTime=100
The "CommPollSize=On" statement enables polling. The CommPollWaitMin value is the time in milliseconds (ms) the poll loop delays before reading the port after data is retrieved. The CommPollWaitMax value is the maximum polling interval. The CommPollWaitIncTime value specifies how long the poll loop polls at its current poll rate before slowing the rate by CommPollWaitInc milliseconds.
Using the above defaults, after a successful read, the poll loop checks the port as often as possible for 100 milliseconds. After the 100 milliseconds, the poll loop waits at least 1 millisecond before checking the port. After 500*100 milliseconds, or 50 seconds, the poll loop checks the COM port for data only twice a second, every 500 milliseconds.
For ICA client 10.x and later, many of the Module.ini settings were moved under Client Lockdown in the Registry.
Set the value to “Off” in the following Registry location, as it is “On” by default:
HKLMSOFTWARECitrixICA ClientEngineConfigurationAdvancedModulesClientComm
Com Port polling cause excessive client side CPU utilization in wfica32.exe
The default behavior for the 6.2.910 – 6.2.931 Win32 Clients is for COM port polling enabled. Note: Disabling COM Port polling can affect the reliability of data being transferred.
To resolve the problem, update to the latest Citrix ICA Client or change CommPollSize to Off in the Module.ini file in the client’s Install directory. When the change is made, the file will look like the example below.
;***********************************************************************
;**
;** Client COM Mapping Virtual Driver
;**
;** This virtual driver is responsible for providing client COMM
;** port access to supplement the ICA 3.0 driver.
;**
;***********************************************************************
[ClientComm]
DriverName = VDCOM30.DDL
DriverNameWin16 = VDCOM30W.DLL
DriverNameWin32 = VDCOM30N.DLL
WindowSize = 1024
CommPollSize = Off
CommPollWaitMin = 0
CommPollWaitMax = 500
CommPollWaitInc = 1
CommPollWaitIncTime = 20
Symbol Handheld Barcode Scanner
Symbol Handheld Barcode Scanner might become slow after applying Service Pack 3 or Service Pack 4 for Windows 2000.
This issue has been reported while using a server side application that uses the sendhex.exe file to communicate with the Symbol Scanner. It is most noticeable when attempting to program the Scanner through the client redirected COM port, sending data from the scanner to the server works as expected.
Resolution
Refer to Microsoft Knowledgebase article 827652 for a resolution.
Printing/Copying to a mapped COM port takes three minutes to complete
This issue was seen on a Microsoft Windows NT Server version 4.0, Terminal Server Edition, Citrix MetaFrame 1.8 SP1 server. A change to cdm.sys was incorporated into HotFix ME181T012, now part of MetaFrame 1.8 Service Pack 3.
Workaround:
The default registry setting for HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesCDMParameters value for RequestTimeout: REG_DWORD: 0x3c is 60 seconds. Depending on your environment, increase or decrease this value to help troubleshoot this issue; however, modifying this value below 6 seconds causes the com port to fail. This requires a reboot to take effect.
Note: From XenApp 6 and later, the new registry setting is under HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicespicaserParameters
Syncing PSION REVO with Com Port Polling
Unofficially tested configuration
Possible Solution:
- Download latest software (version 2.3.2) from www.psion.com and install it.
- Set the baud rate to 9600 on Revo and on sync manager.
- Map a client com port:
net use com1: \clientcom1: - Disable com port polling. In Module.ini: CommPollSize=Off
This document applies to:
- MetaFrame 1.8
- MetaFrame Presentation Server 3.0 for Microsoft Windows 2000
- MetaFrame Presentation Server 3.0 for Microsoft Windows 2003
- MetaFrame XP 1.0 for Micro
soft NT 4.0 Server Terminal Server Edition - MetaFrame XP 1.0 for Microsoft Windows 2000
- MetaFrame XP 1.0 for Microsoft Windows 2003
- Presentation Server 4.0 for Microsoft Windows 2000
- Presentation Server 4.0 for Microsoft Windows 2003
- Presentation Server 4.0 x64 Edition
- Presentation Server 4.5 for Windows Server 2003
- Presentation Server 4.5 for Windows Server 2003 x64 Edition