public final class SecsHost extends SecsConn implements DmhReceiveItf
See the JavaHostApp/SuperGUI class for an example application.
As general comments, you setup the configuration of what you want in the online state - what event reports to configure and enable, etc. Then you call initialize() and let the sequence of getting communication established, getting an online state, and getting properly initialized occur asynchronously. You don't try to force a synchronous sequence of setup calls. The built-in logic manages proper initialization everytime there is a transition from offline to online, and it also manages the retry loop of trying to get the proper online state setup when the equipment is down.
If you want to execute some custom logic when an online control state has been established, use receiving of the AUTO_VIRT_INIT event report as your trigger. Do not code a modal sequence of setup calls.
Modifier and Type | Field and Description |
---|---|
AlarmReportItf |
AlarmReportHandler
Set this field to direct the delivery of alarm reports to your application.
|
Object |
clientData
A value saved in the SecsHost instance for use by your application.
|
EventReportItf |
EventReportHandler
Set this field to direct the delivery of event reports to your application
|
static HashMap<String,SecsHost> |
instances
A table of SecsHost instances with lookup by connection name.
|
TIMEOUT, TRACE_DEFAULT_BITS, TRACE_READ_WRITE_IO, TRACE_RECV_HDR_HEX, TRACE_RECV_HDR_INTERP, TRACE_RECV_MSG_HEXDUMP, TRACE_RECV_MSG_TSN, TRACE_RECV_SF_DESC, TRACE_SEND_HDR_HEX, TRACE_SEND_HDR_INTERP, TRACE_SEND_MSG_HEXDUMP, TRACE_SEND_MSG_TSN, TRACE_SEND_SF_DESC, TRACE_STATE_LOGIC
Constructor and Description |
---|
SecsHost(String name,
String DmhGroupName)
The constructor choice for a developer who chooses not to use the ei_startup
table.
|
SecsHost(String name,
String[] cols,
String[] row)
Construct an instance from startup table data.
|
Modifier and Type | Method and Description |
---|---|
RcResult |
alarmAdd(String ALID,
String ALTX,
String ID_TSN)
alarmAdd() is not commonly used.
|
void |
alarmEnable(String ALID,
boolean isEnabled)
Enable or Disable reporting of an Alarm.
|
boolean |
alarmIsEnabled(String ALID)
see if the reporting of an alarm is enabled
|
boolean |
alarmIsSet(String ALID)
see if an alarm is currently set
|
HubTableModel |
alarmTable()
The table column names can be renamed as the HostGui demonstrates.
|
boolean |
areReportsCleared()
Whether all existing event reports are deleted prior to defining new ones
during initialization.
|
boolean |
areReportsEnabled()
Whether to enable all equipment events during initialization.
|
void |
commDisable()
disable SECS communication
|
RcResult |
commEnable()
enable SECS communication
|
RcResult |
connectTypeSet()
Set the SECS connection type per the current property values.
|
void |
controlStateOffline()
send S1F15R host request for the offline control state
|
int |
controlStateOnline()
send S1F17R host request for the online control state (0 or 2 result mean online)
|
void |
copy(SecsHost dest)
copy our property values to another SecsHost instance
|
String |
copyAll(SecsHost dest)
copy entire configuration to another SecsHost instance
|
void |
delete()
Stop using an instance.
|
void |
dmhReceive(DmhClientItf d,
String Data,
String Dest,
String ReplyBox)
This is a callback for this code to receive messages from the SECS server.
|
RcResult |
eventAdd(String CEID,
String ID_TSN,
String eventName,
String description)
Manually add an event definition.
|
String[] |
eventChoice()
Obtain an array of {CEID VirtualName Description} lists
providing a selection choice of events which do not currently
have an associated event report.
|
int |
eventDiscovery()
Attempt to discover unknown event types
|
boolean |
eventIsHostEnabled(String CEID)
see if the reporting of an event is enabled by the host
|
boolean |
eventIsReported(String CEID)
see if the reporting of an event is currently established with the equipment
|
String[] |
eventReportConfig(String virtualName)
lookup the {CEID virtualName Description VIDs} of an individual event report
|
String[] |
eventReportConfigEx(String virtualName)
lookup the {CEID virtualName Description VIDs RPTID} of an individual event report
|
int |
eventReportDefine(String eventName,
String[] varNames)
Create or update an event report definition.
|
int |
eventReportDefine(String eventName,
String[] varNames,
String secsRptID)
Create or update an event report definition.
|
void |
eventReportDelete(String eventName)
delete an event report definition
|
int |
eventsEnable()
Enable the reporting of all equipment events
|
int |
eventsEnable(String CEIDlist,
boolean isEnabled)
Enable or Disable reporting of one or more Events
|
String |
eventUpdate(String CEID,
String eventName,
String description)
give an event a meaningful name and description
|
String |
getCeidOffline()
The event report CEID that signifies the equipment is transitioning
to an off-line control state
|
String |
getSpoolInit()
Spool Initialization PURGE | IGNORE | UNLOAD
|
static String |
getSupervisorDir() |
String |
gettDATAID()
SECS TSN type code for DATAID items, default U4.
|
String |
gettDATALENGTH()
SECS TSN type code for DATALENGTH items, default U4
|
String |
gettLENGTH()
SECS TSN type code for LENGTH items, default U4
|
String |
gettPPID()
SECS TSN type code for PPID items.
|
String |
gettREPGSZ()
SECS TSN type code for REPGSZ items, default U4
|
String |
gettRPTID()
SECS TSN type code for RPTID items, default U4.
|
String |
gettTOTSMP()
SECS TSN type code for TOTSMP items, default U4
|
String |
gettTRID()
SECS TSN type code for TRID items, default U4
|
int |
initialize()
Perform online initialization which enables communication and sets up event reports.
|
RcResult |
initRcResult()
A version of initialize that also returns explanation text with the return code.
|
boolean |
isAutoInit()
Whether the initialization logic is executed when an online control state is
established or re-established.
|
boolean |
isAutoStart()
Whether to start the interface with communication enabled
when it is constructed using the constructor form that supplies the needed
property settings.
|
boolean |
isMult()
SECS-I parameter whether the equipment can handle owing more than 1 reply at a time.
|
boolean |
isS13InUse()
Enable S13 for data set transfers, default true.
|
boolean |
isS1F11InUse()
query Status Variable values during initialization, default true
|
boolean |
isS1F13InUse()
use S1F13 to initialize communication, default true
|
boolean |
isS1F17InUse()
use S1F17 to request online control state, default true
|
boolean |
isS1F21InUse()
use S1F21 to query DVVAL variables, default false
|
boolean |
isS1F23InUse()
use S1F23 to query Data Collection Events, default false
|
boolean |
isS1F3InUse()
query Status Variable definitions during initialization, default true
|
boolean |
isS2F13InUse()
use S2F13 during initialization to request equipment constant values, default true.
|
boolean |
isS2F29InUse()
Use S2F29 during initialization to determine equipment constants, default true.
|
boolean |
isS2F31InUse()
Use S2F31 during initialization to synchronize the clock, default true.
|
boolean |
isS5F5InUse()
Enable using S5F5 to determine alarm types, default true.
|
boolean |
isS5F7InUse()
Use S5F7 to determine enabled alarm types, default true.
|
static String |
nameCheck(String name,
boolean test)
public name validation
|
static SecsHost |
newSecsHost()
a constructor with defaults, used internally after the supervisor is up
and the server process is running in order to obtain property defaults.
|
RcResult |
parameterAdd(String varID,
String ID_TSN,
String value_TSN,
String varname,
String virtualName,
String description)
manually add a parameter (ECV) definition- rarely used
|
RcResult |
parameterUpdate(String varID,
String newValue)
Update the value of an Equipment Constant parameter
|
RcResult |
processProgramDownload(String pathname)
Download a process program to the equipment using Stream 7 messages.
|
RcResult |
processProgramLargeRequest(String ppid)
Upload a large process program from the equipment
|
RcResult |
processProgramLargeSend(String filename)
Download a large process program to the equipment
|
String[] |
processProgramList()
obtain the current list of process programs (S7F19R)
|
RcResult |
processProgramUpload(String ppid)
Upload a process program from the equipment to our file system
|
void |
setAutoInit(boolean autoInit)
Set whether the initialization logic is executed when an online control state is
established or re-established.
|
void |
setAutoStart(boolean autoStart)
Set whether to start the interface with communication enabled
when it is constructed using the constructor form that supplies the needed
property settings.
|
void |
setCeidOffline(String ceid)
The event report CEID that signifies the equipment is transitioning
to an off-line control state
|
void |
setMult(boolean MULT)
SECS-I parameter whether the equipment can handle owing more than 1 reply at a time.
|
void |
setReportsClear(boolean Clear)
Whether all existing event reports are deleted prior to defining new ones
during initialization.
|
void |
setReportsEnable(boolean Enable)
Whether to enable all equipment events during initialization.
|
void |
setS13InUse(boolean b)
Enable S13 for data set transfers, default true.
|
void |
setS1F11InUse(boolean b)
query Status Variable values during initialization, default true
|
void |
setS1F13InUse(boolean b)
use S1F13 to initialize communication, default true
|
void |
setS1F17InUse(boolean b)
use S1F17 to request online control state, default true
|
void |
setS1F21InUse(boolean b)
use S1F21 to query DVVAL variables, default false
|
void |
setS1F23InUse(boolean b)
use S1F23 to query DVVAL variables, default false
|
void |
setS1F3InUse(boolean b)
query Status Variable definitions during initialization, default true
|
void |
setS2F13InUse(boolean b)
use S2F13 during initialization to request equipment constant values, default true.
|
void |
setS2F29InUse(boolean b)
Use S2F29 during initialization to determine equipment constants, default true.
|
void |
setS2F31InUse(boolean b)
Use S2F31 during initialization to synchronize the clock, default true.
|
void |
setS5F5InUse(boolean b)
Enable using S5F5 to determine alarm types, default true.
|
void |
setS5F7InUse(boolean b)
Use S5F7 to determine enabled alarm types, default true.
|
void |
setSpoolInit(String v)
Spool Initialization PURGE | IGNORE | UNLOAD
|
static void |
setSupervisorDir(String dir)
The default directory for file system saving and loading is where the SecsServer.exe program is found,
or where the Datahub SDK gem2/server directory is found.
|
void |
settDATAID(String tsntype)
SECS TSN type code for DATAID items, default U4.
|
void |
settDATALENGTH(String tsntype)
SECS TSN type code for DATALENGTH items, default U4
|
void |
settLENGTH(String tsntype)
SECS TSN type code for LENGTH items, default U4
|
void |
settPPID(String tsntype)
SECS TSN type code for PPID items.
|
void |
settREPGSZ(String tsntype)
SECS TSN type code for REPGSZ items, default U4
|
void |
settRPTID(String tsntype)
SECS TSN type code for RPTID items, default U4.
|
void |
settTOTSMP(String tsntype)
SECS TSN type code for TOTSMP items, default U4
|
void |
settTRID(String tsntype)
SECS TSN type code for TRID items, default U4
|
void |
startupSync()
Write current property values to the startup table.
|
static int |
superSave()
Save SECS server table data.
|
static int |
superSaveStartup()
called to save the host interface startup records
|
static void |
superStart(String whereClause)
Instantiate SecsHost instances for all or selected startup records.
|
static void |
supervisorStart(String DmhGroup)
initialization logic for the Supervisor - management of multiple host interfaces
|
int |
traceSetup(String trid,
int periodSecs,
int totsmp,
int repgsz,
String SVIDs)
Initiate a series of trace reports.
|
RcResult |
variableAdd(String varID,
String ID_TSN,
String varname,
String virtualName,
String description,
String varClass)
Manually add a variable definition to enable use with event report methods
used if the equipment does not support S1F3 or
for special testing requirements or
if DVVAL variables cannot be discovered.
|
String[] |
variableChoice()
return a list of Variable names which could be used in event reports
|
String |
variableGetId(String virtualNames)
map variable virtual name(s) to ID(s) - (SVID, VID, ECID)
|
String[] |
variableGetId(String[] virtualNames)
map variable virtual name(s) to ID(s), array arguments
|
HostVariableInfo |
variableGetInfo(String varID)
Fetch the configuration information of a variable.
|
String |
variableGetVirtualName(String Ids)
map variable ID(s) to virtual name(s)
|
String[] |
variableGetVirtualName(String[] Ids)
map variable IDs to virtual names, array arguments
|
RcResult |
variableQuery(int varID)
Query the value of a variable using the numeric ID
|
RcResult |
variableQuery(String varname)
Query the value of a variable using the machine given name
Some machines have more than variable with the same given name!
|
RcResult |
variableQuery(String id,
String idType)
Use the server procedure ei_var_query to obtain the value of a variable
identified by varID, varname or virtual name.
|
RcResult |
variableQueryVirtual(String virtname)
Query the value of a variable using the virtual name
|
HubTableModel |
variableTable()
Return a table model for the variables associated with this instance.
|
String |
variableUpdate(String varID,
String virtualName,
String Description)
give a variable a meaningful name and description
|
binToInt, connectTypeHsmsActive, connectTypeHsmsPassive, connectTypeSerial, connectTypeTerminalServer, debugDmhStatus, debugInspect, debugTableWindow, debugTclConsole, debugTraceWindow, getBAUD, getBinDir, getCommState, getConnectionType, getControlState, getDEVID, getDmh, getDmhGroupName, getHsmsHost, getHsmsPassive, getHsmsPort, getJavaServerDir, getName, getProcessProgramDir, getRTY, getSerialPort, getState, getT1, getT2, getT3, getT4, getT5, getT6, getT7, getT8, getTraceBits, getTraceLogMaxWidth, getTraceSaveDir, getTraceSaveMaxDayFiles, getTraceSaveZipCmd, getTracewinMaxWidth, isEquip, isHsms, isHsmsPassive, isPPbodyFileMode, isTraceDataCompressed, isTraceDataSaved, isWindows, linktest, linktestAsync, listElement, listElement, listElement, listJoin, listSplit, messageTypeAdd, messageTypeRemove, onSecsTrace, onServerError, onStateChange, sendAbort, sendReply, sendReply, sendS9, sendSecsMsg, serverLicenseCheck, serverReply, serverSqlCmd, serverSqlReply, serverStart, serverStop, serverTclCmd, serverTclReply, setBAUD, setConnectionType, setDEVID, setHsmsHost, setHsmsPassive, setHsmsPort, setPPbodyFileMode, setProcessProgramDir, setRTY, setSerialPort, setT1, setT2, setT3, setT4, setT5, setT6, setT7, setT8, setTraceBits, setTraceLogMaxWidth, setTraceSaving, setTracewinMaxWidth, tclCmd, tclReply, traceWin, traceWin, traceWinDeleted, tsnTypeIsOk
public AlarmReportItf AlarmReportHandler
public Object clientData
public EventReportItf EventReportHandler
public static final HashMap<String,SecsHost> instances
public SecsHost(String name, String DmhGroupName) throws Exception
name
- the SECS connection name argument needs to be unique for
each connection instance, and not coincide with a keyword or simple variable name
in the Tcl programming language. The name should be a single alphanumeric token.
DmhGroupName
- DMH message groupname such as "GEMHOST".
The dmhGroup argument becomes the DMH message system group name used by the SecsHost and SECS Server process. If you are instantiating more than one SecsHost instance in your process, construct each instance using the same dmhGroup name argument so that the SECS Server process is shared. The groupname chosen needs to be unique among other DMH server instances on the computer where the SecsHost is executing. The example application uses the name GEMHOST which does not conflict with the default value for Hume Datahub instances which is mbx or the value GEM used by the example Java SecsEquip application. The name should be a single alphanumeric token.
Exception
public SecsHost(String name, String[] cols, String[] row) throws Exception
name
- the connection name becomes the name of a global data
item and a Tcl command in the SECS Server process. It needs to be
unique for each SecsHost instance, and not coincide with a keyword
in the Tcl programming language. The default value of Name is similar
to host0. The name should be a single alphanumeric token.cols
- column names of the ei_startup tablerow
- field values corresponding in sequence to the column names.Exception
public RcResult alarmAdd(String ALID, String ALTX, String ID_TSN)
You can manually add alarm definitions for equipment that does not support S5F5. Or, you can define bogus ALID values for testing. In the general case, the alarm ID type may be non-numeric.
ALID
- ALTX
- ID_TSN
- public void alarmEnable(String ALID, boolean isEnabled)
Your setting is cached and applied whenever the equipment comes online.
ALID
- isEnabled
- public boolean alarmIsEnabled(String ALID)
ALID
- public boolean alarmIsSet(String ALID)
ALID
- public HubTableModel alarmTable()
public boolean areReportsCleared()
public boolean areReportsEnabled()
public void commDisable()
commDisable
in class SecsConn
public RcResult commEnable()
commEnable
in class SecsConn
public RcResult connectTypeSet()
See connectTypeHsmsActive
,
connectTypeHsmsPassive
,
and connectTypeSerial
for
preferred means of setting the connection type.
connectTypeSet
in class SecsConn
public void controlStateOffline()
public int controlStateOnline()
public void copy(SecsHost dest)
dest
- public String copyAll(SecsHost dest)
dest
- public void delete()
public void dmhReceive(DmhClientItf d, String Data, String Dest, String ReplyBox) throws Exception
SecsConn
dmhReceive
in interface DmhReceiveItf
dmhReceive
in class SecsConn
d
- the DMH connection instanceData
- message dataDest
- destination mailboxReplyBox
- reply mailboxException
- - If your receiving logic throws an exception,
a stack backtrace is printed to stdout and a warning
message is passed to the DmhTraceItf callback if error tracing is enabled.public RcResult eventAdd(String CEID, String ID_TSN, String eventName, String description)
Any of ID_TSN, eventName, and description may be null or an empty string in which case default values are used: U4 for ID_TSN, and CEID for eventName if it is numeric.
CEID
- the event IDID_TSN
- the data type of the event ID in TSN, eg., U4eventName
- the virtual event namedescription
- public String[] eventChoice()
public int eventDiscovery()
Until recently, the SECS-II standard has not provided a way to discover equipment events. This method is called to attempt event discovery by enabling all events and asking the equipment which events are enabled. This technique requires that the equipment support the underlying message types and implements an EventsEnabled variable that has the expected name. A positive return value indicates the number of new event types discovered. Negative return values indicate various failure modes.
public boolean eventIsHostEnabled(String CEID)
CEID
- public boolean eventIsReported(String CEID)
CEID
- public String[] eventReportConfig(String virtualName)
virtualName
- public String[] eventReportConfigEx(String virtualName)
The RPTID value is an empty string if there is no SECS Report ID associated with the event or if the associated RPTID is the same as the tool CEID.
virtualName
- public int eventReportDefine(String eventName, String[] varNames)
See eventReportDefine
for guidance.
eventName
- the virtual name of the event which can be configured to
be different than the CEID value by using the eventUpdate method.varNames
- an array of the virtual names of the variables whose values
are to be reported when the event occurs. The array may be empty.tRPTID
data type code.public int eventReportDefine(String eventName, String[] varNames, String secsRptID)
An event report is a set of variable values that is sent from the tool using S6F11 or S6F13 when the tool control state is online and a particular event occurs. This method configures SECS server table data that represents a desired report, data that links the specified event to the report, and data that indicates that the event should be enabled for reporting. The desired configuration of event reporting is communicated to the tool using S2F33, S2F35, and S2F37 when the initialize method is called, or whenever the tool enters an online control state and automatic initialization is enabled.
The method variableChoice
provides a
current list of virtual variable names that may be used for the varNames
argument. You can use the
variableUpdate
method to provide your own virtual variable names. The default virtual
variable names are assigned per the conventions of Sematech as explained
in the EventReportItf
comments.
After calling this method, you
may want to call the initialize
method to have your desired event reports
setup immediately and enabled with the equipment. The initialization logic is
executed
automatically whenever an online control state is established if the
AutoInit
property is true.
For a less complex application, you may wish to define a distinct event report for each equipment event type that you wish to receive in the application. With the simplest form of this method call, you do not specify the optional SECS Report ID (RPTID) value, and by default the logic creates a distinct event report using the CEID value as the underlying RPTID value.
It is possible to apply a single call to this method to more than one tool event
by assigning the same virtual event name value to multiple tool events.
The virtual event name value is assigned using the
eventUpdate
method. When this event
naming trick is used and the SECS RPTID value is not specified, the like named events
are configured to have separate and equal report definitions using their CEID
values for RPTID values.
The SECS Report ID (RPTID) value needs to be specified for certain less capable equipment that are not able to use the CEID values for RPTID values. There is at least one tool type that only allows RPTID values from 1 to 255 (type U1) but has CEID values outside of this range. Specifying the RPTID value can also be useful to apply a single event report definition to more than one event type. If this is done, the latest update of the event report definition is applied to all of the events that are associated (linked) to the specified RPTID. So specifying a common RPTID can be used to reduce the editing needed to manage and update a set of similar event types.
A knowledgeable user can skip using this API and use SECS messages directly to fully exploit the ability to re-use event report definitions with multiple tool events and to have more than one event report definition linked to a tool event. This API only configures 1 or 0 event reports per tool event.
eventName
- the virtual name of the event which can be configured to
be different than the CEID value by using the eventUpdate method.varNames
- an array of the virtual names of the variables whose values
are to be reported when the event occurs. The array may be empty.secsRptID
- the SECS Report ID value usually an integer, to be assigned
to the underlying SECS event report definition. This value may be specified
as an empty string to obtain default behavior. There must
be at least one tool-based variable in the varNames array for a specified
secsRptID value to be used and associated with the tool event.tRPTID
data type code.public void eventReportDelete(String eventName)
eventName
- public int eventsEnable()
public int eventsEnable(String CEIDlist, boolean isEnabled)
CEIDlist
- isEnabled
- public String eventUpdate(String CEID, String eventName, String description)
CEID
- eventName
- description
- public String getCeidOffline()
public String getSpoolInit()
public static String getSupervisorDir()
public String gettDATAID()
public String gettDATALENGTH()
public String gettLENGTH()
public String gettPPID()
public String gettREPGSZ()
public String gettRPTID()
public String gettTOTSMP()
public String gettTRID()
public int initialize()
public RcResult initRcResult()
public boolean isAutoInit()
public boolean isAutoStart()
public boolean isMult()
public boolean isS13InUse()
public boolean isS1F11InUse()
public boolean isS1F13InUse()
public boolean isS1F17InUse()
public boolean isS1F21InUse()
public boolean isS1F23InUse()
public boolean isS1F3InUse()
public boolean isS2F13InUse()
public boolean isS2F29InUse()
public boolean isS2F31InUse()
public boolean isS5F5InUse()
public boolean isS5F7InUse()
public static String nameCheck(String name, boolean test)
name
- test
- public static SecsHost newSecsHost() throws Exception
Exception
public RcResult parameterAdd(String varID, String ID_TSN, String value_TSN, String varname, String virtualName, String description)
The equipment should support discovery of parameter variables so this method is only useful as a manual workaround. It can be used to add bogus values for testing.
varID
- ID_TSN
- value_TSN
- varname
- virtualName
- description
- public RcResult parameterUpdate(String varID, String newValue)
varID
- newValue
- public RcResult processProgramDownload(String pathname)
If there is no saved table record in file ei_ppid.tab describing the process program file, the logic assumes that the file format contains both the PPID and PPBODY in text TSN notation which was the upload format used prior to May 2008. The return value of the method call is a two element structure, a return code and text. The return code is 0 for success, in which case the text will be the PPID (the process program name).
pathname
- public RcResult processProgramLargeRequest(String ppid)
This method initiates the upload of a process program to the host using the message types of Stream 13 which are designed for large data set transfers. Using these messages is more complex than the usual Stream 7 transfer messages so they are less commonly supported. The ppid argument value is the process program identifier used by the equipment. The upload logic saves only the data passed as the body of the process program in the uploaded file. The ppid value used to identify the process program may not be a valid filename. The upload logic assigns a unique filename to the uploaded program, using the ppid value if possible. The logic also creates or updates a file of SQL statements, ei_ppid.tab, in the process program directory. The ei_ppid.tab file saves the ppid value to filename mapping, as well as the datatype of the transferred program. The ei_ppid.tab file has to be preserved along with the uploaded process programs in order to download them in the future.
The return value is a two element structure, a return code and text. The return code is 0 if the transfer is initiated successfully as determined by the reply to S7F41. The transfer is not complete when the method returns. The large data set transfer logic receives the file in the subdirectory, dataset_transfer, of the directory set by the ProcessProgramDir property. When the transfer is complete, if there is already an earlier version of the process program file in the process program directory, then there is a StateChange event with the name dataset_delete and the newvalue being the ppid value, which informs you that the earlier version file is being replaced. Next, there is a StateChange event with the name dataset_upload and the newvalue being the ppid value which informs you of the successful upload completion. Proper GEM equipment will also post UploadSuccess or UploadFailure data collection event reports to indicate completion as well.
If the transfer does not complete successfully, there is additional status information is the SECS server table ei_dataset_xfer. It is possible to query this table or subscribe to data changes of this table to better integrate transfer status information.
ppid
- public RcResult processProgramLargeSend(String filename)
This method initiates the download of a process program to the equipment using the message types of Stream 13 which are designed for large data set transfers. Using these messages is more complex than the usual Stream 7 transfer messages so they are less commonly supported. The filename argument value is the file name of a previously uploaded process program in the process program directory. The file is expected to contain only the data of a process program - this transfer method is not compatible with the previously used upload format that saved both the PPID and PPBODY in TSN notation. The filename may not be the same as the process program identifier, ppid. The saved information in the ei_ppid.tab file in the ProcessProgramDir is checked for a possibly different ppid.
The return value is a two element structure, a return code and text. The return code is 0 if the transfer is initiated successfully as determined by the reply to S7F37. The transfer is not complete when the method returns. After the data has been sent to the equipment, per GEM, the equipment is expected to verify the byte count of the download process program file using S7F29. When this verification occurs with the correct byte count, there is a StateChange event with the name dataset_download and the newvalue being the ppid value. If the transfer does not complete successfully, there is additional status information is the SECS server table ei_dataset_xfer.
filename
- public String[] processProgramList()
public RcResult processProgramUpload(String ppid)
Upload a process program from the equipment to our process program directory using Stream 7 messages. The return value is a two element structure, a return code and text. The return code is 0 for success, in which case the text will be the pathname of the saved program. The upload logic saves only the data passed as the PPBODY of the process program in the uploaded file. The PPID value used to identify the process program may not be a valid filename. The upload logic assigns a unique filename to the uploaded program, using the PPID value if possible. The logic also creates or updates a file of SQL statements, ei_ppid.tab, in the process program directory. The ei_ppid.tab file saves the PPID value to filename mapping, as well as the datatype of the transferred program. The ei_ppid.tab file should be preserved along with the uploaded process programs in order to download them in the future.
A successful upload causes a StateChange event with the name recipe_upload and the newvalue being the ppid value. If there is a prior version of the uploaded file in the process program directory, there is a StateChange event with the name recipe_delete and the newvalue being the ppid value which occurs before the recipe_upload event.
ppid
- public void setAutoInit(boolean autoInit)
autoInit
- public void setAutoStart(boolean autoStart)
autoStart
- public void setCeidOffline(String ceid)
ceid
- public void setMult(boolean MULT)
MULT
- public void setReportsClear(boolean Clear)
Clear
- public void setReportsEnable(boolean Enable)
Enable
- public void setS13InUse(boolean b)
b
- public void setS1F11InUse(boolean b)
b
- public void setS1F13InUse(boolean b)
b
- public void setS1F17InUse(boolean b)
b
- public void setS1F21InUse(boolean b)
b
- public void setS1F23InUse(boolean b)
b
- public void setS1F3InUse(boolean b)
b
- public void setS2F13InUse(boolean b)
b
- public void setS2F29InUse(boolean b)
b
- public void setS2F31InUse(boolean b)
b
- public void setS5F5InUse(boolean b)
b
- public void setS5F7InUse(boolean b)
b
- public void setSpoolInit(String v) throws Exception
v
- must be "PURGE", "IGNORE", or "UNLOAD"Exception
public static void setSupervisorDir(String dir) throws Exception
Applications that directly instantiate SecsHost() instances instead of calling SupervisorStart() can also use this property to specify the root working directory for file system writing and reading for all SecsHost instances. The property value must be set before instantiating and SECS connection instances. Here we assume these apps do not use the SecsHost() constructor that uses table rows from the supervisor startup table.
dir
- an absolute directory path or a path that is relative to the
current working directory of the Java program.Exception
public void settDATAID(String tsntype) throws Exception
tsntype
- Exception
public void settDATALENGTH(String tsntype) throws Exception
tsntype
- Exception
public void settLENGTH(String tsntype) throws Exception
tsntype
- Exception
public void settPPID(String tsntype) throws Exception
tsntype
- Exception
public void settREPGSZ(String tsntype) throws Exception
tsntype
- Exception
public void settRPTID(String tsntype) throws Exception
tsntype
- Exception
public void settTOTSMP(String tsntype) throws Exception
tsntype
- Exception
public void settTRID(String tsntype) throws Exception
tsntype
- Exception
public void startupSync()
This code assumes that you want to write the current properties to the startup table. Turning that around, you have to make your current state the desired startup state in order to save your desired startup state. The Tcl Supervisor distinguishes between the current state and the startup configuration, your editing of the startup data is not applied to the current instance. So don't get confused if you work with both applications - they are different.
public static int superSave()
public static int superSaveStartup()
public static void superStart(String whereClause) throws Exception
whereClause
- Exception
public static void supervisorStart(String DmhGroup) throws Exception
DmhGroup
- Exception
public int traceSetup(String trid, int periodSecs, int totsmp, int repgsz, String SVIDs)
trid
- host assigned trace identifierperiodSecs
- sampling period in secondstotsmp
- total samples, 0 to stop tracerepgsz
- reporting group sizeSVIDs
- list of status variable IDspublic RcResult variableAdd(String varID, String ID_TSN, String varname, String virtualName, String description, String varClass)
Any of ID_TSN, varname, virtualName, and description may be null or an empty string in which case default values are used: U4 for ID_TSN, varID.toString() for varname, and a mapping procedure for virtualName.
varID
- the variable ID, usually numeric , eg 501ID_TSN
- the data type of the ID in TSN, eg., U4varname
- a name for the variable usually ASCII text but defaults to the ID as a string, eg. EventLimitvirtualName
- a user defined name for the variable, eg EVENT_LIMITdescription
- optional description for selection listsvarClass
- a string describing the variable type and therefore what SECS messages types may be used with it
SV = status variable, DVVAL = data value variable, ECV= parameter (Equipment configuration value)public String[] variableChoice()
public String variableGetId(String virtualNames)
virtualNames
- public String[] variableGetId(String[] virtualNames)
virtualNames
- public HostVariableInfo variableGetInfo(String varID)
varID
- public String variableGetVirtualName(String Ids)
Ids
- public String[] variableGetVirtualName(String[] Ids)
Ids
- public RcResult variableQuery(int varID)
varID
- public RcResult variableQuery(String varname)
varname
- public RcResult variableQuery(String id, String idType)
id
- idType
- public RcResult variableQueryVirtual(String virtname)
virtname
- public HubTableModel variableTable()
public String variableUpdate(String varID, String virtualName, String Description)
varID
- virtualName
- Description
-