public class SecsEquip extends SecsConn implements DmhReceiveItf
Modifier and Type | Field and Description |
---|---|
static String[] |
ControlStateText
Use the CS_* control state values as indexes in this array to obtain the state text values
|
static int |
CS_OFFLINE_ATTEMPT_ONLINE
control state "OFF-LINE SeekOnline" - we seek to be online
|
static int |
CS_OFFLINE_EQUIPMENT
control state "OFF-LINE Equipment" - we choose to be off line
|
static int |
CS_OFFLINE_HOST
control state "OFF-LINE Host" - off line because of host action or inaction
|
static int |
CS_ONLINE_LOCAL
control state "ON-LINE LOCAL" - online under operator control
|
static int |
CS_ONLINE_REMOTE
control state "ON-LINE REMOTE" - online under SECS communication control
|
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 |
---|
SecsEquip(String name,
String dmhGroup)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
alarmAdd(int ALID,
String ALTX)
Create an alarm type.
|
void |
alarmAdd(int ALID,
String ALTX,
int alarmSetCEID,
int alarmClearCEID)
Less common method to create an alarm type used if you need to customize the
data collection CEIDs used for the alarm set and alarm clear event reports.
|
void |
alarmEnable(int ALID,
boolean isEnabled)
Enable or Disable reporting of an Alarm.
|
boolean |
alarmIsEnabled(int ALID)
The host can disable or enable reporting of an alarm,
see if the reporting of an alarm is enabled.
|
boolean |
alarmIsSet(int ALID)
See if an alarm is currently set.
|
void |
alarmSet(int ALID,
boolean isSet)
Set or Clear the alarmed state of an alarm.
|
HubTableModel |
alarmTable()
Obtain a table model with current alarm data.
|
void |
close()
Stop using an instance, but leave intact file system data for future use.
|
void |
commDisable()
Disable SECS communication.
|
RcResult |
commEnable()
Enable SECS communication.
|
RcResult |
connectTypeSet()
Set the SECS connection type per the current property values.
|
void |
delete()
Delete an instance and its persisted data with no intention of future use.
|
void |
dmhReceive(DmhClientItf d,
String Data,
String Dest,
String ReplyBox)
This is a callback for this code to receive messages from the SECS server.
|
void |
eventAdd(int CEID,
boolean isReported,
String description)
Define an event type.
|
void |
eventAdd(String eventName,
int CEID,
boolean isReported,
String description)
Define an event type, and provide a unique name.
|
void |
eventDvvals(String eventName,
String[] dvvalNames)
Specify the DVVAL variables associated with an event for S1F24.
|
void |
eventEnable(int CEID,
boolean isEnabled)
Enable or Disable reporting of an Event.
|
boolean |
eventIsEnabled(int CEID)
The host can change the enabled status;
see if the reporting of an event is enabled.
|
void |
eventPost(int CEID)
Announce that a GEM event has occurred which may cause an event report message to be sent.
|
void |
eventPostByName(String eventName)
announce that a GEM event has occurred using the unique event name
|
int |
eventRenumber(String eventName,
int newCEID)
Reassign a different numeric ID to a built-in event.
|
ArrayList<int[]> |
eventReportLinks()
This method returns a list of integer pairs for the current associations of event types and
report definitions.
|
void |
eventUnlink(int CEID)
Unlink (disassociate) all associated reports from an event.
|
int |
getControlStateStartup()
get the configured control state startup value
|
String |
getControlStateStartupText()
get GUI text for the control state startup value
|
String |
getMDLN()
Get the SECS equipment model type
|
String |
getSOFTREV()
returns the currently configured SECS software revision string
|
String |
getSpoolDirectory()
SpoolDirectory property
|
String |
getSpoolingAllow()
return the current Spooling Allow configuration string
|
int |
getVarValueTimeout()
Internal VarValueRequest timeout value in milliseconds.
|
boolean |
isAlarmEventShared() |
boolean |
isControlIntentOnline()
Whether we intend to be in an online control state.
|
boolean |
isControlModeRemote()
Whether remote control is desired when online.
|
boolean |
isIdRangeChecked()
Set this property false to bypass the normal ID range checking on adding alarms,
events, parameters, and variables.
|
boolean |
isParameterSetSaved()
Return the configuration state of ECV parameter saving.
|
boolean |
isPPFilesByRequest()
Query whether process program files are requested/written by the app.
|
boolean |
isProcessProgramTypeBinary()
Return the configured state of whether recipe files are binary and not text.
|
boolean |
isReportConfigSaved()
get the configured state of event report setup saving
|
boolean |
isS13InUse()
test if Stream 13 large process program transfer messages are enabled
|
ParameterChangeItf |
onParameterChange(ParameterChangeItf handler)
The ParameterChange event notifies you of host initiated Equipment Configuration
Variable (ECV) changes.
|
PPFileRequestItf |
onPPFileRequest(PPFileRequestItf handler)
When using the PPFilesByRequest feature, the app is requested
to write process programs as files when needed.
|
SpoolingAlertItf |
onSpoolingAlert(SpoolingAlertItf handler)
The GEM standard describes Spooling events that are to be brought
to the attention of the equipment operator.
|
void |
parameterAdd(int varID,
String varname,
String description,
String valueTsn,
String initialValue,
String minValue,
String maxValue,
String defaultValue,
String units)
Define new Equipment Configuration Variables (ECV) parameters which do not affect processing.
|
void |
parameterAdd(int varID,
String varname,
String description,
String valueTsn,
String initialValue,
String minValue,
String maxValue,
String defaultValue,
String units,
boolean affectsProcessing)
Define new Equipment Configuration Value parameters.
|
String |
parameterGet(int varID)
Get the current value of a Parameter (ECV)
|
String |
parameterGetByName(String varname)
Get the current value of a Parameter (ECV)
|
VariableInfo |
parameterGetInfo(int varID)
Obtains the configuration data of an ECV.
|
VariableInfo |
parameterGetInfoByName(String varname)
Obtains the configuration data of an ECV using its name.
|
void |
parameterSet(int varID,
String newValue)
This call is used to set the value of an ECV parameter.
|
void |
parameterSetByName(String varname,
String newValue)
This call is used to set the value of a named ECV.
|
void |
parametersRestore()
parametersRestore gets called automatically when you first enable communication if property
ParameterSetSaved is true.
|
RcResult |
processProgramDownload(String ppid)
The equipment can initiate the download of a process program from the host using S7F5R.
|
RcResult |
processProgramLargeRequest(String ppid)
The equipment can initiate the download of a process program from the host using Stream 13
which supports the transfer of very large files.
|
RcResult |
processProgramLargeSend(String filename)
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.
|
RcResult |
processProgramUpload(String ppid)
Equipment initiated request to transfer a process program to the host using S7F3R.
|
String |
processStateNames(int[] stateValue,
String[] stateName)
Calling this method during initialization adds a Status Variable
named ProcessStateNames whose value is a list of Process State
values and their names.
|
int |
reportDefine(int rptID,
int[] varIDs)
Support for manually editing the event report configuration.
|
void |
reportDelete(int rptID)
delete an event report definition
|
int[] |
reportGetDef(int rptID)
get the Variable IDs in an event report definition
|
ArrayList<VariableInfo> |
reportGetInfo(int rptID)
returns a list of VariableInfo structures for the variables of a report definition
|
int |
reportLink(int rptID,
int CEID)
Link a report definition to an event type, causing the report to be sent as part of the
event report message.
|
void |
reportsClear()
This method, not commonly used, supports manual editing of the event report configuration.
|
int[] |
reportsList()
returns an array of rptIDs for current report definitions
|
void |
reportsRestore()
ReportsRestore gets called automatically when you first enable communication if property
ReportsAreSaved is true.
|
void |
reportUnlink(int rptID)
remove the association of a report from all events
|
void |
reportUnlink(int rptID,
int CEID)
remove the association of a report from a particular event
|
void |
setAlarmEventShared(boolean b)
set whether alarm set and clear event CEIDs are the same for all alarms
|
void |
setControlIntentOnline(boolean b)
Set whether we intend to be in an online control state.
|
void |
setControlModeRemote(boolean b)
When in online control, do we intend to be in REMOTE control?
|
void |
setControlStateStartup(int stateIndex)
You can set the control state startup using the index (enumerated constants)
CS_OFFLINE_EQUIPMENT=0, CS_OFFLINE_ATTEMPT_ONLINE=1, CS_OFFLINE_HOST=2, CS_ONLINE_LOCAL=3, CS_ONLINE_REMOTE=4. |
void |
setIdRangeChecked(boolean b)
Set this property false to bypass the normal ID range checking on adding alarms,
events, parameters, and variables.
|
void |
setMDLN(String MDLN)
Set the SECS equipment model type, 20 chars max.
|
void |
setParameterSetSaved(boolean b)
This property controls whether the parameter values are saved at the
program exit and restored during the next session.
|
void |
setPPFilesByRequest(boolean isByRequest)
Set whether process program files are written by the app triggered by
PPFileRequest callbacks.
|
void |
setProcessProgramTypeBinary(boolean isBinary)
Specify if process programs (recipes) are treated as binary instead of text.
|
void |
setReportConfigSaved(boolean save)
This optionally set property controls whether the state of event reporting is saved
at the program exit and restored during the next session.
|
void |
setS13InUse(boolean enable)
Enable S13 for large process program transfers, default is disabled (false).
|
void |
setSOFTREV(String SOFTREV)
Set the SECS Software revision - limited to no more than 20 characters.
|
void |
setSpoolDirectory(String spoolDirectory)
SpoolDirectory property
|
void |
setSpoolingAllow(String StreamList)
This property is optionally set to specify the streams which the host is allowed
to specify for spooling in message type S2F43.
|
void |
setVarValueTimeout(int millisecs)
Rarely used feature to override default internal VarValueRequest timeout
of 20000 milliseconds.
|
void |
spoolPurge()
Purge any Spooled Messages
|
void |
spoolStop()
Stop Spooling any more messages
|
void |
spoolStreamFns()
Enable all allowed spooling per the property setting of SpoolingAllow
|
void |
spoolStreamFns(String StreamFns)
Configure Streams (Ss) and or SsFf message types for spooling -
bypasses SpoolingAllow property
|
static EquipStartupData |
startupLoad(String name)
Retrieve a startup data record from persistent storage.
|
void |
startupRestore(EquipStartupData esd)
Apply the provided startup data to the instance, configuring
properties according to the data and calling ConnectTypeSet().
|
static RcResult |
startupSave(EquipStartupData esd)
Save startup data to the file system.
|
void |
terminalDisplayAck()
The tool GUI calls this method to Acknowledge a Terminal Display
|
String |
tsnI8Value(long int64)
!Obsolete! Hex notation is no longer needed to pass 8 byte integers to the SECS
interface.
|
void |
varGroupSet(int[] varIDs,
String[] values)
A more efficient alternative to calling variableSet() multiple times, the
method sends the updated values to the SECS Server in one message.
|
void |
varGroupSetEventPost(int[] varIDs,
String[] values,
int CEID)
A more efficient alternative to calling variableSet() multiple times
and then posting a Data Collection event.
|
void |
variableAdd(int varID,
String varname,
String description,
String varClass,
String valueTsn,
String initialValue,
String units)
Define a Status Variable (SV) or a Data Value (DVVAL).
|
String |
variableGet(int varID)
Get the current value of a Variable, possibly using the callback mechanism.
|
String |
variableGetByName(String varname)
Get the current value of a Variable, possibly using the callback mechanism.
|
VariableInfo |
variableGetInfo(int varID)
Fetch the configuration information of a variable.
|
VariableInfo |
variableGetInfoByName(String varname)
Fetch the configuration information of a variable by name
|
void |
variableMethodSet(int varID,
VarValueRequestItf callback)
Set a variable's evaluation method to be done using a callback
you code a class that implements the VarValueRequestItf interface
|
int |
variableRenumber(String varname,
int newVarID)
Reassign a different numeric ID to a built-in variable or parameter.
|
void |
variableSet(int varID,
String newValue)
This call is used to set the value for a variable whose value is
stored directly in the ei_variable table instead of being evaluated by a callback.
|
void |
variableSetByName(String varname,
String newValue)
This call is used to set the value for a variable whose value is
stored directly in the ei_variable table instead of being evaluated by a callback
|
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 static final String[] ControlStateText
public static final int CS_OFFLINE_ATTEMPT_ONLINE
public static final int CS_OFFLINE_EQUIPMENT
public static final int CS_OFFLINE_HOST
public static final int CS_ONLINE_LOCAL
public static final int CS_ONLINE_REMOTE
public SecsEquip(String name, String dmhGroup) throws Exception
name
- The SECS interface name argument needs to be unique for
each SecsEquip instance, and not coincide with a keyword or simple variable name
in the Tcl programming language. The example application uses the Name value of eqsim.
The name should be a single alphanumeric token.
dmhGroup
- DMH message groupname such as "GEM".
The dmhGroup argument becomes the DMH message system group name used by the SecsEquip and SECS Server process. If you are instantiating more than one SecsEquip 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 SecsEquip is executing. The example application uses the name GEM which does not conflict with the default value for Hume Datahub instances which is mbx or the value GEMHOST used by the example Java Host application. The name should be a single alphanumeric token.
Exception
public void alarmAdd(int ALID, String ALTX) throws Exception
ALID
- alarm ID, use even numbers 1000..3998 unless IdRangeChecked is falseALTX
- alarm description, up to 120 ASCII charactersException
public void alarmAdd(int ALID, String ALTX, int alarmSetCEID, int alarmClearCEID) throws Exception
Call setAlarmEventShared() before adding alarms, and do not use this method if AlarmEventShared is true.
The set and clear event types are created if they do not already exist.
ALID
- used numbers between 1000..3998 unless IdRangeChecked is falseALTX
- alarm description up to 40 ASCII charactersalarmSetCEID
- the CEID for the alarm detected event - not range checkedalarmClearCEID
- the CEID for the alarm clear event - not range checkedException
public void alarmEnable(int ALID, boolean isEnabled)
ALID
- isEnabled
- public boolean alarmIsEnabled(int ALID)
ALID
- public boolean alarmIsSet(int ALID)
ALID
- public void alarmSet(int ALID, boolean isSet)
ALID
- isSet
- public HubTableModel alarmTable()
public void close()
public void commDisable()
commDisable
in class SecsConn
public RcResult commEnable()
If there is an error setting up the connection, the return code value will be non-zero, and the result field will be an error message.
Your application should use StateChange events to know and display the connection status. When your equipment is configured for the Active HSMS role, field personnel will want to display the trace window (traceWin(true)) with the 0x0002 TRACE property bit set in order to see detailed information on the status of communication attempts.
commEnable
in class SecsConn
public RcResult connectTypeSet()
connectTypeSet
in class SecsConn
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 void eventAdd(int CEID, boolean isReported, String description) throws Exception
CEID
- event identifier, use values 5000..9999 with the default range checking of
ID values.isReported
- whether the event is initialized as enabled. You usually specify true
since most events are of general interest to your host side customers. The host can enable or disable
the event reports that it actually wants.description
- limited to 120 ASCII characters. Hume has extended the SECS
standards to provide event descriptions using the variable EventDescriptions.Exception
public void eventAdd(String eventName, int CEID, boolean isReported, String description) throws Exception
eventName
- your defined name for the event, up to 256 chars, unique per instance.
The name consists of alphanumeric characters and/or the hyphen or underscore. These
event names are visible to the host in the S1F24 reply message to S1F23R.CEID
- the numeric SECS data collection event ID.isReported
- whether the event report is enabled, almost always leave truedescription
- a description of the event that is passed to the hostException
public void eventDvvals(String eventName, String[] dvvalNames)
eventName
- - the event type namedvvalNames
- - the varname values of DVVAL variablespublic void eventEnable(int CEID, boolean isEnabled)
CEID
- isEnabled
- public boolean eventIsEnabled(int CEID)
CEID
- public void eventPost(int CEID)
If you are using variableSet() to manage variable values instead of variableMethodSet() with VarValueRequest evaluations, then make sure that the variable values that the host might want in event reports are set to current values before posting an event.
You should post events without testing to see if reporting of the event is enabled and without other testing of the communication or control states. For an event report to be seen by the host, an online control state must be established and reporting of the event type must be enabled.
You use the method eventAdd() during initialization to define your own event types which are in addition to the standard built-in types.
CEID
- public void eventPostByName(String eventName)
eventName
- public int eventRenumber(String eventName, int newCEID) throws Exception
eventName
- the unique name for the event typenewCEID
- the unsigned integer to be used as the IDException
- is thrown for an unknown event name or unexpected errorpublic ArrayList<int[]> eventReportLinks()
public void eventUnlink(int CEID)
CEID
- public int getControlStateStartup()
public String getControlStateStartupText()
public String getMDLN()
public String getSOFTREV()
public String getSpoolDirectory()
public String getSpoolingAllow()
public int getVarValueTimeout()
public boolean isAlarmEventShared()
public boolean isControlIntentOnline()
public boolean isControlModeRemote()
public boolean isIdRangeChecked()
public boolean isParameterSetSaved()
public boolean isPPFilesByRequest()
public boolean isProcessProgramTypeBinary()
public boolean isReportConfigSaved()
public boolean isS13InUse()
public ParameterChangeItf onParameterChange(ParameterChangeItf handler)
handler
- your receiving instancepublic PPFileRequestItf onPPFileRequest(PPFileRequestItf handler)
handler
- your receiving app instancepublic SpoolingAlertItf onSpoolingAlert(SpoolingAlertItf handler)
handler
- your receiving objectpublic void parameterAdd(int varID, String varname, String description, String valueTsn, String initialValue, String minValue, String maxValue, String defaultValue, String units) throws Exception
varID
- the variable identifier (SECS ECID). With the default range checking active,
use varID values that are between 1000 to 2999. Use a unique value for each parameter.
varname
- a single token PascalCase name for the EC parameter, such as AnnotateEventReports (up to 32 chars)
description
- parameter description (up to 200 chars)
valueTsn
- the Tcl SECS notation type code for the ECV value such as
F4 for floating point, or A:80 for an ASCII string up to 80 characters long.
With ASCII types, indicate the maximum number of characters, n,
that you wish to allow the host to set, by using a type code of the
form A:n. The value of n can be as large as 60000.
The standard disallows use of List values for ECVs.
initialValue
- initial value
minValue
- (ECMIN) use an empty string if not applicable
maxValue
- (ECMAX) use an empty string if not applicable
defaultValue
- (ECDEF)
units
- an empty string for pure numbers - SEMI defines standard unit
abbreviations
EC's have min, max, default values (S2F30). Use empty strings for both min and
max if not applicable. You will get a ParameterChange event when the host changes
the value. Use PascalCase (eg AnnotateEventReports) for varname values.Exception
public void parameterAdd(int varID, String varname, String description, String valueTsn, String initialValue, String minValue, String maxValue, String defaultValue, String units, boolean affectsProcessing) throws Exception
varID
- the variable identifier (SECS ECID). With the default range checking active,
use varID values that are between 1000 to 2999. Use a unique value for each parameter.
varname
- a single token PascalCase name for the EC parameter, such as AnnotateEventReports (up to 32 chars)
description
- parameter description (up to 200 chars)
valueTsn
- the Tcl SECS notation type code for the ECV value such as
F4 for floating point, or A:80 for an ASCII string up to 80 characters long.
With ASCII types, indicate the maximum number of characters, n,
that you wish to allow the host to set, by using a type code of the
form A:n. The value of n can be as large as 60000.
The standard disallows use of List values for ECVs.
initialValue
- initial value
minValue
- (ECMIN) use an empty string if not applicable
maxValue
- (ECMAX) use an empty string if not applicable
defaultValue
- (ECDEF)
units
- an empty string for pure numbers - SEMI defines standard unit
abbreviations
affectsProcessing
- whether changes to the parameter by the host are disallowed
when in LOCAL controlException
public String parameterGet(int varID)
varID
- public String parameterGetByName(String varname)
varname
- public VariableInfo parameterGetInfo(int varID)
varID
- public VariableInfo parameterGetInfoByName(String varname)
varname
- public void parameterSet(int varID, String newValue)
varID
- newValue
- public void parameterSetByName(String varname, String newValue)
varname
- newValue
- public void parametersRestore()
It is unusual to make this call. It is useful if you want to force the restore action to occur before communication is enabled. For example, it could support letting the operator edit the configuration of parameter values before communication is enabled.
Initialize a Connection type and define your parameters before making this call.
public RcResult processProgramDownload(String ppid)
There is no
standard SECS command for the equipment to know what process programs are available for
download. If the return code value is 0 meaning success, the result string is the full
pathname to the recipe file. Negative values are used for error conditions as described with
SendSecsMsg. In addition, the following error return codes are also possible:
-10 file system error
-11 improper data
-12 request denied
ppid
- process program ID, same as the process program filenamepublic RcResult processProgramLargeRequest(String ppid)
The large data set transfer logic receives the downloaded file in the subdirectory, dataset_transfer, of the directory set by the ProcessProgramDir property. When the transfer is complete, there is a StateChange event with the name dataset_download and the newvalue being a two element list consisting of the ppid value and the full pathname to the newly received file.
To fully comply with the large process program transfer scenarios specified by GEM E30, your application should react to the StateChange event by verifying the newly received process program and sending the S7F27 Process Program Verification message to the host using sendSecsMsg. The S7F27 message is sent with replyIsWanted true, but there is no reason to wait for the host's reply. After verification, your application can move the file into the ProcessProgramDir for use, possibly overwriting an earlier version.
ppid
- process program ID, same as the process program filename
Possible error results include values of the ACKC7 reply to S7F41 and the following:
1 permission not granted
4 PPID not found
6 other error
-6 error when sending S7F41 or receiving the S7F42 reply
-13 PP transfers are disabled when spooling is active
-14 A large PP receive is already in progress for ppid
-15 Stream 13 transfers are disabled either from configuration or initialization failure
-16 PPID is not usable as a restricted filename
-17 error when parsing the S7F42 reply
public RcResult processProgramLargeSend(String filename)
Using these messages is more complex than the usual Stream 7 transfer messages so they are less commonly supported. The transfer is not complete when the method returns. The large data set transfer logic makes a temporary copy of the file for transfer in the subdirectory, dataset_transfer, of the directory set by the ProcessProgramDir property. This allows your application to change or access the process program while the copy is being transferred. When the transfer is complete, there is a StateChange event with the name dataset_upload and the newvalue being the filename value. If the transfer does not complete successfully, there is additional status information is the SECS server table ei_dataset_xfer. The SECS Server also posts UploadSuccess, UploadTimeout, and UploadFailure data collection events that can be monitored as StateChange events with the name event.
filename
- process program ID, same as the process program filename
Possible error results include values of the ACKC7 reply to S7F37 and the following:
1 permission not granted
6 other error
-4 PPID filename not found
-6 error when sending S7F37 or receiving the S7F37 reply
-13 PP transfers are disabled when spooling is active
-14 A large PP receive is already in progress for ppid
-15 Stream 13 transfers are disabled either from configuration or initialization failure
-16 error copying the PPID for large send
-17 error when parsing the S7F38 reply
public RcResult processProgramUpload(String ppid)
ppid
- process program ID (same as the filename)public String processStateNames(int[] stateValue, String[] stateName) throws Exception
stateValue
- array of process state integer valuesstateName
- matched array of process state namesException
public int reportDefine(int rptID, int[] varIDs)
This method can update, create, or delete an event report definition. A null or empty array of variables causes deletion.
rptID
- report identifiervarIDs
- array of variable IDspublic void reportDelete(int rptID)
rptID
- public int[] reportGetDef(int rptID)
rptID
- public ArrayList<VariableInfo> reportGetInfo(int rptID)
rptID
- public int reportLink(int rptID, int CEID)
rptID
- CEID
- public void reportsClear()
public int[] reportsList()
public void reportsRestore()
public void reportUnlink(int rptID)
rptID
- public void reportUnlink(int rptID, int CEID)
rptID
- CEID
- public void setAlarmEventShared(boolean b)
b
- public void setControlIntentOnline(boolean b)
b
- public void setControlModeRemote(boolean b)
b
- remote (host) control is desiredpublic void setControlStateStartup(int stateIndex) throws Exception
stateIndex
- CS_* control state valueException
public void setIdRangeChecked(boolean b)
b
- public void setMDLN(String MDLN) throws Exception
MDLN
- Exception
public void setParameterSetSaved(boolean b)
If the value is true, the saved value data is restored the first time that commEnable is called, unless it has been already restored by calling the method parametersRestore. In other words, you can use the method parametersRestore to force loading of the saved parameter values before commEnable is called.
The value data is saved as a file of SQL statements in the subdirectory spooldata. The filename used is "EcvParms_" + Name + ".sql".
b
- public void setPPFilesByRequest(boolean isByRequest)
isByRequest
- public void setProcessProgramTypeBinary(boolean isBinary)
isBinary
- public void setReportConfigSaved(boolean save)
If the value is true, the saved event reporting configuration is restored the first time that commEnable is called, unless it has been already restored by calling the method reportsRestore. In other words, you can use the method reportsRestore to force loading of the saved reporting configuration before commEnable is called.
The report configuration data is saved as a file of SQL statements in the subdirectory spooldata. The filename used is "reportdata_" + Name + ".sql".
save
- public void setS13InUse(boolean enable)
enable
- public void setSOFTREV(String SOFTREV) throws Exception
SOFTREV
- typically a pattern of major.minor.patchlevel such as "1.0.0".Exception
public void setSpoolDirectory(String spoolDirectory) throws Exception
The file system directory for spooling, report configuration, and parameter (ECV) persistence files. The default TraceSaving logging directory is also underneath the spooling directory. The directory value may be set early in the initialization before startupRestore() or connectTypeSet() is called.
spoolDirectory
- Exception
- if the directory is not valid or the method call is after
connectTypeSet is called.public void setSpoolingAllow(String StreamList) throws Exception
The standard does not allow Stream 1 to be spooled. The default value is "S5 S6" which allows for spooling alarm messages and event reports. An empty string value disallows any spooling. The value only affects the handling of S2F43 messages from the host. Your software is able to change at any time which message types are being spooled using the method, SpoolStreamFns.
StreamList
- formatted as a
space separated list of Sn tokens where the n value is stream number,
eg., "S5 F6".Exception
- for improper argumentpublic void setVarValueTimeout(int millisecs)
millisecs
- public void spoolPurge()
public void spoolStop()
public void spoolStreamFns()
public void spoolStreamFns(String StreamFns)
StreamFns
- public static EquipStartupData startupLoad(String name)
name
- the SECS connection namepublic void startupRestore(EquipStartupData esd) throws Exception
CommEnable() is NOT called so that you can fully configure the interface before going online.
The name field in the record is ignored as the instance has already been constructed and given a name.
esd
- Exception
public static RcResult startupSave(EquipStartupData esd) throws Exception
If you use this method, you also need to use startupLoad() during initialization so the table gets created in the next session.
esd
- Exception
public void terminalDisplayAck()
public String tsnI8Value(long int64)
int64
- public void varGroupSet(int[] varIDs, String[] values)
varIDs
- values
- public void varGroupSetEventPost(int[] varIDs, String[] values, int CEID)
varIDs
- array of variable identifiersvalues
- array of variable values corresponding to the varIDsCEID
- Data Collection Event identifierpublic void variableAdd(int varID, String varname, String description, String varClass, String valueTsn, String initialValue, String units) throws Exception
With a relatively static variable, you keep the current value in the ei_variable table record. You keep the table value current by calling VariableSet() when the value changes. This is the default.
With variables that change value frequently, make the VariableMethodSet call to specify an evaluation callback that the software should executed when the current value is needed.
varID
- With the default checking of Id values, use varID values between
3000 and 9999.varname
- The variable name value, varname, should start with an
alphanumeric character or the underscore and not have trailing spaces.
The length limit is 256 alphanumeric ASCII characters including the
underscore, hyphen, and internal spaces. We suggest you use a single token
PascalCase name, limit yourself to 32 characters, and make each name unique.description
- varClass
- "SV" or "DVVAL"valueTsn
- TSN data type of value such as F4 for floating point, I4 for signed integer,
or A for ASCII text. With ASCII data, specifying a maximum length using A:n is optional.initialValue
- units
- SEMI has standard abbreviations for units. An empty string is used for pure
numbers.Exception
public String variableGet(int varID)
varID
- public String variableGetByName(String varname)
varname
- public VariableInfo variableGetInfo(int varID)
varID
- public VariableInfo variableGetInfoByName(String varname)
varname
- public void variableMethodSet(int varID, VarValueRequestItf callback)
Warning- the evaluation request is executed by a different thread than the main GUI thread.
varID
- callback
- public int variableRenumber(String varname, int newVarID) throws Exception
An exception is thrown if the varname is not recognized. Revised 3/2007 to be forgiving of order-of-use, and unlikely error situations of multiple table rows per item.
Return values- 0 == successful renumbering or variable
already has the desired ID value,
1 == the newID was in use so the conflicting
variable was moved to a temporary ID,
2 or more == more than one variable of this
name was found and the extras were deleted, the survivor has the desired ID or
was renumbered ok,
SECS server procedure return values -1 and -2 become exceptions.
varname
- the variable or parameter namenewVarID
- the unsigned integer to be used as the IDException
public void variableSet(int varID, String newValue)
varID
- newValue
- public void variableSetByName(String varname, String newValue)
varname
- newValue
-