long ConnectToOPCHDA (LPCTSTR Node, LPCTSTR CLSID, LPCTSTR ServerName);
Available (from release):
stOCX (V2-02), stPro Automation (V2-02), stTabular History OCX (V3-02), stTabular History Automation (V3-02)
Return Value:
Nonzero if successful otherwise 0.
Parameters:
Name: |
Description: |
Node |
The node upon which the OPC Server is running.
Tip: The Node parameter can be specified as a TCP/IP address or as a host name. |
CLSID |
The DCOM Class ID of the required OPC Server (including the braces '{}').
Tip: If preferred, the OPC Server ProgID can be passed in to this argument instead of the ClassID and the ProgID will then be determined automatically, but only where the Server is locally registered. |
ServerName |
The name that will be displayed within the application to identify the HDA OPC Server.
Note: The value specified for ServerName should also be used for the SDRName parameter in SetSDR and for the DL argument in AddPen. |
Call this function to establish a connection with an Historical Data Access (HDA) OPC Server.
Example:
STOCX1.ConnectToOPCHDA "JEM01PHD01", "{321BE7EF-D601-11D6-994E-00D0B747517C}", "JEM01PHD01(DA)"
Note: The open an close braces {}are required for the Class ID parameter.
Note: The value specified for ServerName should also be used for the SDRName parameter in SetSDR and for the DL argument in AddPen.
Use with OPCFailover:
When using the OCX with OPCFailover - Jemmac's complimentary OPC redundancy solution - the CLSID should be set to {00000000-0000-0000-0000-000000000000} and the ServerName set to the name of the OPCFailover Group. This will force the OCX to revalidate the Class ID of the active OPC Server when reestablishing a connection during a fail over.
STOCX1.ConnectToOPCHDA "BROOKEND", "{00000000-0000-0000-0000-000000000000}", "MYGROUP"
Tip: For more information on OPCFailover, visit: http://www.jemmac.co.uk/index.php?se=prodOPCFailover