beckhoff TX1000 — 4.1 Sample Machine with Microsoft Expression Blend (C#)

Samples WPF { tcClient.WriteAny(hSwitchWrite, true); } catch (Exception ex) { MessageBox.Show(ex.Message); } } //------------------------------------------------------// wird aufgerufen, wenn das Feld 'langsam' markiert wird// is activated when the 'slow' field is marked//-------------------------------------- ----------------private void optSpeedSlow_Click(object sender, EventArgs e) { try { tcClient.WriteAny(hSwitchWrite, false); } catch (Exception ex) { MessageBox.Show(ex.Message); } } 8. Deleting notifications and handles: In the Close event of the window the links are enabled again with the method DeleteDeviceNotification() .

//------------------------------------------------------// wird beim Beenden des Programms aufgerufe n// is activated when ending the program//------------------------------------------------------ private void Close(object sender, EventArgs e) { try { // Lцschen der Notifications und Handles// Deleting of the notification and handles tcClient.DeleteDeviceNotification(hEngine); tcClient.DeleteDeviceNotification(hDeviceUp); tcClient.DeleteDeviceNotification(hDeviceDown); tcClient.DeleteDeviceNotification(hSteps); tcClient.DeleteDeviceNotification(hCount); tcClient.DeleteDeviceNotification(hSwitchNotify); tcClient.DeleteVariableHandle(hSwitchWrite); } catch (Exception ex) { MessageBox.Show(ex.Message); } tcClient.Dispose(); } Last but not least we need to ensure that the methods are called for the right event.

To do this, go to Expression Blend, select Page, switch to Events in Properties and enter 'Load' for 'Loaded' and 'Close' for 'Unloaded'. The same must also be done with the two RadioButtons, only that here the event 'Click' is selected, as well as the method 'optSpeedFast_Click' or 'optSpeedSlow_Click'. The PLC machine program Machine_Final.pro must run on runtime system 1 and the program can be tested in Internet Explorer 7. 9. Integration in Vista Media Center If you have tested your project sufficiently and found no errors, you can now include it in the Media Center. Call up the project properties again in Visual Studio, but then go to 'Publish'. Click on 'Publish Now'.

This creates an xbap file which you subsequently call up in the Media Center. This step is always required whenever the program has been modified and the change is to be transferred to the Media Center. TX1000 35 Version: 1.2