Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The Watch dialog assumes register addresses refer to the sensor.

To do a Watch of a Demo3 register, you can use its ability to add a Python function as a watch item.

In the Watch dialog, select “Non-Register …”, then “Python Function”, and then “Next”.
You’ll see this dialog;

To create the Python function:

  1. Enter a valid Python function name in the “def” text box.

  2. In the text box below that, enter the Python code as “ return demo3.<Demo3 register name>.value”.
    Notes:E
    - Ensure you have 4 leading spaces before the “return”.
    - The correct value for <Demo3 register name> is the one without spaces.
    Use the Register dialog and select the “Display Name” header to display the names without spaces.

  3. Select “Test Function” to see if the code - if it is, “Okay” will be display under the code entry test box.

  4. Select “Finish”.

In the example above, the function named “demo3_display” has been created.
It contains a single line of a return of the Demo3 register “OutputFrameCount”.
The “Test Function” button has been pressed, and the results of “Okay, return 18130” shows that code works.

The functions are saved upon DevWareX exit. You can also use the Watch dialog’s “Save/Load…”.

To Edit an Existing function:

In in Watch dialog, right-click the function and select “Edit”. The Python Function dialog reappears.

  • No labels