...
To create the Python function:
Enter a valid Python function name in the “def” text box.
In the text box below that, enter the Python code as “ return demo3.<Demo3 register name>.value”.
Notes:
- 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.Select “Test Function” to verify valid code - if it is, “Okay” will be display under the code entry test box.
Select “Finish”.
To display the value in Hex, wrap the return expression in “hex()”:
return hex(demo3.OutputFrameCount.value)
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.
...