variableÚta server api


GE Fanuc Automation

VersaPro! 2.00

Variable Data Server

Public Interface Specification

Version

Date

Page-paragraph

Remarks

0

7-1-99

Original Issue


1 Introduction


The Variable Data Server is an in-process COM server which allows applications outside of VersaPro to read and write variable information from/to a variable data file in a VersaPro folder. Variable information is transferred to and from the Variable Data Server using the Shared Name File (SNF) format.

Please note that only variables in the VersaPro Variable Declaration Table with the Show External attribute set to True are visible to a client of the variable data server.

    1. Definitions

COM Component Object Model

SNF Shared Name File

VDT Variable Declaration Table.

The only interface available for the Variable Data Server is the COM interface. Variable information will be transferred from the client application to/from the server via the SNF format.

    1. COM Interface

      1. Standard Microsoft Interfaces

        1. IPersistFile

The IPersistFile interface provides methods that permit the VDT file to be loaded from or saved to a disk file. The IPersistFile interface inherits its definition from the IPersist interface and so includes the GetClassID method of IPersist.

When to Implement

The client is required to implement this interface prior to setting or getting the variable information.

When to Use

This interface is to be used when the client wants to read/write the variable information from/to a VDT file.

Methods in Vtable Order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments the reference count.

Release

Decrements the reference count.

IPersist Method

Description

GetClassID

Returns the class identifier (CLSID) for the component object.

IPersistFile Methods

Description

IsDirty

Checks an object for changes since it was last saved to its current file.

Load

Opens the specified file and initializes an object from the file contents.

Save

Saves the object into the specified file.

SaveCompleted

Notifies the object that it can revert from NoScribble mode (in which it must not write to its file), to Normal mode.

GetCurFile

Gets the current name of the file associated with the object.

        1. ISupportErrorInfo

The ISupportErrorInfo interface ensures that error information can be propagated up the call chain correctly for Automation objects.

When to Implement

This interface is required for Automation servers by Microsoft.

When to Use

This interface is required for Automation servers by Microsoft.

Methods in Vtable Order

ISupportErrorInfo Methods

Description

InterfaceSupportsErrorInfo

Indicates whether the interface identified by riid supports the IErrorInfo interface.

        1. IDispatchImpl

IDispatchImpl provides a default implementation for the IDispatch portion of any dual interface on your object. A dual interface derives from IDispatch and uses only Automation-compatible types.

When to Implement

An Automation type client (ex. Visual Basic) will implement this interface or a client that wishes to use the Automation interface.

When to Use

This interface should only be used by Automation type clients.

Available Methods

IDispatchImpl Methods

Description

IsDirty

Checks an object for changes since it was last saved to its current file.

Load

Opens the specified file and initializes an object from the file contents.

Save

Saves the object into the specified file.

SaveCompleted

Notifies the object that it can revert from NoScribble mode (in which it must not write to its file), to Normal mode.

GetCurFile

Gets the current name of the file associated with the object.

SetSNFData

Provides the mechanism to transfer information from the client to the server.

GetSNFData

Provides the mechanism to transfer information from the server to the client.

          1. HRESULT IsDirty(BOOL * pbDirtyFlag)

Checks an object for changes since it was last saved to its current file. This method supports the IPersistFile interface.

            1. Parameters

pbDirtyFlag - A pointer to a BOOL which indicates whether the file is modified (dirty).

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

          1. HRESULT Load(BSTR bstrFileName, DWORD dwMode)

Opens the specified file and initializes an object from the file contents. This method supports the IPersistFile interface.

            1. Parameters

bstrFileName - A BSTR containing the absolute path of the file to open.

dwMode - A DWORD containing the access mode from the STGM enumeration values.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

          1. HRESULT Save(BSTR bstrFileName, BOOL fRemember)

Saves the object into the specified file. This method supports the IPersistFile interface.

            1. Parameters

bstrFileName - A BSTR containing the absolute path of where the file is to be saved.

dwMode - A BOOL specifying whether the file is to be the current working file or not.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

          1. HRESULT SaveCompleted(BSTR bstrFileName)

Notifies the object that it can revert from NoScribble mode (in which it must not write to its file), to Normal mode. This method supports the IPersistFile interface.

            1. Parameters

bstrFileName - A BSTR containing the absolute path of where the file was saved.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

          1. HRESULT GetCurFile(BSTR * pbstrFileName)

Gets the current name of the file associated with the object. This method supports the IPersistFile interface.

            1. Parameters

pbstrFileName - A pointer to a BSTR where the absolute path of where the file was saved should be placed.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

          1. HRESULT SetSnfData(BSTR bstrSnfData)

This method provides the mechanism to transfer information from the client to the server. This method supports the IHSnfXfer interface.

            1. Parameters

bstrSnfData - A BSTR containing the variable information in the SNF format.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

          1. HRESULT GetSnfData(BSTR * bstrSnfData)

This method provides the mechanism to transfer information from the client to the server. This method supports the IHSnfXfer interface.

            1. Parameters

bstrSnfData - A pointer to a BSTR where the variable information in the SNF format should be placed.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

      1. Custom Interfaces

        1. IHSnfXfer

The IHSnfXfer interface provides methods that permits the variable information to be transferred to/from a client using the SNF format.

When to Implement

The client is required to implement this interface prior to setting or getting the variable information.

When to Use

This interface is to be used when the client wants to transfer the variable information from/to a VDT file.

Available Methods

IHSnfXfer Methods

Description

SetSNFData

Provides the mechanism to transfer information from the client to the server.

GetSNFData

Provides the mechanism to transfer information from the server to the client.

          1. HRESULT SetSnfData(BSTR bstrSnfData)

This method provides the mechanism to transfer information from the client to the server.

            1. Parameters

bstrSnfData - A BSTR containing the variable information in the SNF format.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

            1. Sequence Diagram

0x08 graphic

          1. HRESULT GetSnfData(BSTR * bstrSnfData)

This method provides the mechanism to transfer information from the server to the client.

            1. Parameters

bstrSnfData - A pointer to a BSTR where the variable information in the SNF format should be placed.

            1. Return Value

An HRESULT containing S_OK if successful otherwise E_FAIL.

            1. 0x08 graphic
              Sequence Diagram

The Shared Name File (or SNF) format is an extension of the industry-standard Comma Separated Variable (CSV) format. SNF files contain two types of information, Comments and Records. Comment lines begin with the Comment Line Sequence ## (i.e., two consecutive pound characters as the first non-blank characters in the line). Records (except for Header Section records (see below)) do not begin with the Comment Line sequence.

    1. General SNF Format Rules