Siemens 7 manual Module Re-initialization, Power Down on PC Suspend

Page 16

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

 

 

Image 16
Contents User’s Guide General Notes CopyrightContents Multiplexer Driver Developer’s Guide Tables List of TablesFigures List of FiguresDocument History Chapter What is newDocument History Multiplexer Driver Developer’s Guide Introduction IntroductionSupported Product Versions Supported Product VersionsRelated Documents AbbreviationsRelated Documents Abbreviation DescriptionHierarchy Chart in the System ArchitectureUser ArchitectureSignal Description Handling of the Physical Serial PortModule Detection Handling of the Physical Serial PortLimitation of Virtual Ports Handling of Control Lines on Virtual PortsHandling of Control Lines on Virtual Ports Module Initializing Sequence Command Response Function Associated Registry ValueModule Initializing Sequence Power Down Power Down on PC SuspendPower Down after Closing the Last Port Module Re-initializationPower Down on PC Shutdown Power DownInstallation Files Required for WinMux2k Driver InstallationInstalling the WinMux2k Driver InstallationDeinstalling the Driver Deinstalling the DriverWindows Windows XP new desktop, not the classic desktopSettings on the Serial Multiplexer Properties Device Settings and PropertiesDevice Settings and Properties Settings Stored in the Windows Registry Settings Stored in the Windows RegistryValue Data Example Properties TC45, XC18 only Multiplexer Driver Developer’s Guide Values Data Example Properties Settings for Applications Dial-up Network SettingsFax Settings Settings for ApplicationsTranslate Source Code Software RequirementsPreparing the Translation Compiler FlagsInteraction of the Different Driver Objects Additional Source DocumentationAdditional Source Documentation Internal Driver States Internal Driver StatesBuffer Handling Buffer HandlingData Transfer To th e S e rM u x O b je c t a re in d ic a te dMultiplexer Driver Developer’s Guide SerMuxSend Function SerMuxSend and SerMuxSendPort0 FunctionsStart +++-Parser +++-ParserKnown Problems Booting Operating SystemShutdown of the Operating System Standby of the Operating SystemSpecial Environments Operation on Virtual USB PortAutomatic Shutdown in case of Emergency Special Environments