Multiplexer Driver Developer’s Guide

2.7 Module Re-initialization

s

2.7Module Re-initialization

If the module is disconnected or powered off during normal operation, the driver detects this and tries to reinitial- ize the module. Because the module state can be changed while disconnected the multiplexer mode has to be completely initialized. The driver checks the following situations:

Invalid frames from the module are received.

Timeout occurs during sending frames.

DSR signal goes to zero, can be turned off with Registry value.

If one of these conditions is detected the driver starts the following actions:

Try to send an MSC command to the module. If the module answers it is assumed that the module is working and no re-initialization is required.

Generate an RTS impulse.

Wait for CTS to ensure that the module has been properly started after re-initialization.

Reinitialize the module.

2.8Power Down

The module switches to Power down mode when the PC enters the suspend mode or shuts down or when the last virtual port is closed. The following sections describe the behavior of the software in these three cases.

The commands sent to the module are taken from the Registry values „PowerDown” for PC suspend, “ClosePort” for closing the last virtual port and “ShutDown” for a shut down of the PC. These values are copied from the “winmux2k.inf file into the Registry during installation of the driver. For further details on the Registry values see below and Section 4.2.

2.8.1Power Down on PC Suspend

When the PC enters the suspend mode, the module stays in multiplexer mode. A virtual channel is activated and used to send the commands from the Registry value “PowerDown” or via the “PowerDownFrame” available from Multiplexer Protocol version 3 onwards. All pending send requests are stopped.

When the PC wakes up the module gets an RTS impulse and the pending send buffers are re-enabled.

2.8.2Power Down after Closing the Last Port

When the last virtual port is closed the module switches from multiplexer mode to “normal AT command mode”. This is accomplished by sending the strings of the Registry value “ClosePort” to the module (AT+IPR=0 and, depending on the product, AT^SMSO).

If the module is switched off with AT^SMSO, the driver waits for the DSR signal to go low after switch-off. Oth- erwise reopening a virtual port may fail because the module hasn’t finished its shutdown procedure. This behav- ior is supported by Multiplexer Protocol version 3 or later and enabled by the Registry value “WaitForDSR” = 1.

Due to different requirements of the supported products the Registry values “ClosePort” and “WaitForDSR” vary with the module type. By default, all modules except for TC45 and XC18 will be switched to autobauding with IPR=0 and then turned off by AT^SMSO, with the “WaitForDSR” feature being enabled. TC45 and XC18, how- ever, will only be set to autobauding and not switched off, and therefore the “WaitForDSR” feature is disabled. As stated in Section 2.3, this default behavior of TC45 and XC18 was implemented for faster access from the PC debug environment.

Mux_Drv_DevGuide_v07

Page 16 of 36

2006-9-27

Confidential / Released

 

 

Page 16
Image 16
Siemens 7 manual Module Re-initialization, Power Down on PC Suspend, Power Down after Closing the Last Port