Samples Silverlight { vUp.Opacity=1.0; vDown.Opacity=0.0; } else if (bool2 == "1") { vUp.Opacity=0.0; vDown.Opacity=1.0; } else { vUp.Opacity=0.0; vDown.Opacity=0.0; } if (speed == "0") { vFast.Opacity=1.0; vSlow.Opacity=0.0; } else { vSlow.Opacity=1.0; vFast.Opacity=0.0; } } } else alert(req.statusText+" "+req.status); //cannot retrieve xml data } } In the last two methods, the PLC variable used to control the speed of the machine is set to zero and one, respectively.
function Fast_MouseLeftButtonDown(sender, eventArgs) { Write(netId, port, '16416', '6', '2', '0', 'int'); } function Slow_MouseLeftButtonDown(sender, eventArgs) { Write(netId, port, '16416', '6', '2', '1', 'int'); } Writing PLC variables Write(netId, port, indexGroup, indexOffset, cbLen, pwrData, type) netId: string that specifies the AMS Net ID on which the PLC can be found nPort: port number of the runtime system indexGroup: IndexGroup of the PLC variable indexOffset: first byte to be written to ncbLen: number of bytes to be written pwrData: array containing the data to be written type:
"bool", "int" or "string" As with the 'Load' function, you need to switch to Expression Blend 2 to make the two methods the 'click event' of their two buttons in the appropriate lines. 5. Testing: First, debug your application. You will find that it does not work as you expect it to. Then go via 'Build → Publish'. TX1000 27 Version: 1.2