In freemaster software i am unable to overwrite a virtual variable in the watch variabe section from the dashboard input for that variable.
Kindly Clarify!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PWM Dashboard</title>
</head>
<body onload="main()">
<object id="pcm" height="0" width="0" classid="clsid:48A185F1-FFDB-11D3-80E3-00C04F176153"></object>
<h1>PWM Dashboard</h1>
var01inc: <input id="input_var01inc" value="1" type="text" size="10">
<input type="button" value="Write!" onclick="writevar()">
<span id="span_status" type="text"></span><br><br>
<div class="footer">
Copyright 2020 NXP
</div>
<script language="Javascript">
var i_var01inc;
var s_status;
function main() {
i_var01inc = document.getElementById("input_var01inc");
s_status = document.getElementById("span_status");
// Check if FreeMASTER is available
if (!pcm) {
s_status.innerText = "ERROR: FreeMASTER not initialized!";
return;
}
// Display a message that FreeMASTER has initialized correctly
console.log("FreeMASTER initialized. Ready to write variable.");
}
function writevar() {
var v = i_var01inc.value; // Get the input value for var01inc
// Attempt to write to FreeMASTER's virtual variable
if (pcm.WriteVariable("var01inc", v)) {
s_status.innerText = "Written: " + v;
} else {
s_status.innerText = "ERROR: " + pcm.LastRetMsg;
}
console.log("Attempting to write value: ", v);
}
</script>
<script type="text/javascript" src="/js/simple-jsonrpc-js.js"></script>
<script type="text/javascript" src="/js/freemaster-client.js"></script>
</body>
</html>