Syntax |
Example |
Description/Remarks |
OPC_INIT server_number, channel_number, item name, |
OPC_INIT 1, 1,
See OPC Server Support for a sample template showing how the OPC commands work together.
Note: Typically the OPC_INIT command is used to set up channels before the OPC_CONNECT command is used. However, you can initialize new channels (OPC_INIT) after the connection has been made (OPC_CONNECT) if the channel is not in receive mode. |
This command initializes a channel for an OPC Server connection. Returns a 1 if successful. Returns -997 if a blank item name was given. Returns -994 if it is already connected. Returns -992 if no items set up or invalid server number Server_number is an integer from 1 to 10 assigning a number to the OPC server connection. It should be the same server_number that will be used by the OPC_CONNECT command to connect to this OPC server. Channel_number is any positive integer. Item name (also called a tag) is usually case-sensitive! Example: "d1.c1.Register23" For update rate, use -1 for the default value, which is 100 milliseconds. Or, send in a number between zero and 2 billion For dead band, use -1 for the default, which is zero. Or, send in a number between zero and 100. Receive mode can be either "Y" or "N". "N" is the default. Setting receive mode to "Y" turns on receive mode for this channel. Other terms to describe receive mode are asynchronous or subscription mode.
See MYSVAR and DE_OPT for information about potential popup error messages. |