Panasonic HMWIN User Manual page 274

Touch
Hide thumbs Also See for HMWIN:
Table of Contents

Advertisement

- the tag to read with getTag is not in page (so not subscribed by the runtime) >> the tag is read from device
irrespective of forceRefresh flag.
- the tag to read with getTag is present in page (so tag subscribed) & forceRefresh == True >> the tag is
read from device
- the tag to read with getTag is present in page (so tag subscribed) & forceRefresh == False >> the tag is
read from the tags cache at UI side.
forceRefresh parameter is working in both sync and async (with callback) mode.
The value read from getTag when forceRefresh parameter is not set could be obsolete.
NOTE
var state = new State();
var value = project.getTag("Tag1", state, 0);
//
//for non array type
//tags index is not considered, so can be left as 0
//
if (value!=undefined) {
//...do something with s
}
var state = new State();
project.getTag("Tag1", state, -1, "fnTagReady");
function fnTagReady(tagName, tagState) {
if (tagName=="Tag1") {
var myValue = tagState.getValue();
}
}
setTag
number setTag( tagName, tagValue, [index], [forceWrite] )
Sets the given Tag in the project. Name and value are in a string.
Parameters
tagName
A string of the tag name.
tagValue
An object containing the value to write.
index
An index if tag is array type. Set -1 to pass complete array. Default is 0.
forceWrite
A boolean value for enabling force write of tags, the function will wait for the value to be
written before it returns back. Default is false.
Return value
Interger value for denoting success and failure of action when forceWrite is true. A 0 means success and -1
means failure. If forceWrite is false, returned value will be undefined.
var val = [1,2,3,4,5];
var status = project.setTag("Tag1", val, -1, true);
if (status == 0) {
// Success
} else {
// Failure
}
var val = "value";
project.setTag("Tag1", val);
ACGM0195V1EN
HMWIN Studio User Manual
274

Advertisement

Table of Contents
loading

Table of Contents