I am developing a program with GRC where I want to take N samples. (The hardware is a HackRF-one). I want to take N samples because I want to measure at certain points with a H-field probe.
The way I have thought to solve it is to develop a custom block, "sampling counter" (in python), to count the number of samples that have passed and after N samples it changes its value from 1 to 0 and a "selector" block is directing other samples to /dev/null. This works with a "check box" where a user can set/unset and change where the stream goes, either into a file or to /dev/null. See attached flowgraph.png.
Q: How to implement the ID of a custom block so that it can be used as a variable as from a checkbox, slider etc. Both in python an xml, that is what is needed to be added in the .xml file and in the .py file to use the ID as a variable?