Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
TracePro_User_Manual_5.0.pdf
Источник:
Скачиваний:
281
Добавлен:
03.05.2015
Размер:
6.09 Mб
Скачать

Using the Macro Language

action to be taken by the server in an execute transaction or the data being passed to the server in a poke transaction.

It is also possible to use the item part of the name as the data itself, with the topic name indicating the context in which the data is to be used.

The Service Name

Every application that can be a DDE server has a unique service name. The service name is usually the application's executable filename without any extension. Service names are not case sensitive. Here are some commonly used service names:

The service name for TracePro is TracePro.

The service name for OSLO is OSLODDE.

The service name for MATLAB is Matlab.

The service name for Microsoft Word for Windows is WinWord.

The service name for Microsoft Excel is Excel.

The Topic

The topic defines the subject of a DDE conversation and is usually meaningful to both the client and server applications. Topic names are not case sensitive. TracePro topics are System and Scheme and are described below.

The Item

Each topic supports one or more items. An item identifies the data being passed during the DDE conversation. TracePro items are not case sensitivity. The scheme items are simply TracePro macro commands passed to the Server for execution. The command results may be retrieved by the client using a REQUEST transaction or simply sent to TracePro via a EXECUTE transaction.

Clipboard Formats

DDE uses the Windows clipboard formats for formatting data sent between applications. TracePro supports only Text format for its Server mode.

TracePro DDE Server

If you request "SysItems" on the System topic, you get a list of items available on that topic:

SysItems - returns a tab separated list of items.

Topics - returns "System" and "scheme" topics.

Formats - returns the available formats for data transfer. The Text format is the only supported format for TracePro.

TopicItemList - returns a tab separated list of items for the current Topic.

The format Text (CF_TEXT) must be used for all requests on the System topic.

8.12

TracePro 5.0 User’s Manual

TracePro DDE Interface

Establishing a Conversation

When you access TracePro as a server, you must specify its service name and one or more topics to establish a CHANNEL. TracePro can support multiple channels from one or more applications. Generally the System topic is used to obtain information on the topics and items supported for a particular server. The Scheme topic does not provide any specific Items but will attempt to execute the text sent to the server as an TracePro macro command. If the Request transaction is used, the result of the TracePro command will be returned as a text string.

Excel 97/2000 Example

The following example illustrates a DDE conversation between MS Excel and TracePro. The DDEInitiate command is used to open Channels for the Scheme topic. A DDEExecute is used to open a new model by sending a command to TracePro with no return value. The Conversation is ended with the DDETerminate commands.

Public Sub DDEtoTracePro()

Dim strApp As String

Dim strTopic As String

strApp = "TracePro" strTopic = "scheme"

channelNumber = Application.DDEInitiate(strApp, strTopic)

Application.DDEExecute channelNumber, "(file:new)"

Application.DDETerminate channelNumber

End Sub

TracePro 5.0 User’s Manual

8.13

Using the Macro Language

8.14

TracePro 5.0 User’s Manual

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]