Hi, I am trying out a MCC 172 on a Raspberry Pi 4 with 64Bit. The programming language is Python for compatibility with other applications. It works quite well so far and records all data.
Now I am writing an application to be able to display the data graphically even temporarily. There are already similar tools, so I want the data to be available as a numpy array.
The plan is to turn the graph on and off as needed. The data could be continuously available in the background, but it doesn't have to be. Probably better to turn it off and only enable it when needed.
However, I'm not getting anywhere because I don't understand how to understand the flow from the various has.a_...
To understand it, I created a minimal example, the core of which looks like this. The data_dict is a dictionary. The data is written to a deque.
However, identical values are always written to the dict, even if you stop and do a cleanup. I don't understand this at all.
Unfortunately you can't use your own numpy syntax because it doesn't get along with the library.
Question
brit
Hi, I am trying out a MCC 172 on a Raspberry Pi 4 with 64Bit. The programming language is Python for compatibility with other applications. It works quite well so far and records all data.
Now I am writing an application to be able to display the data graphically even temporarily. There are already similar tools, so I want the data to be available as a numpy array.
The plan is to turn the graph on and off as needed. The data could be continuously available in the background, but it doesn't have to be. Probably better to turn it off and only enable it when needed.
However, I'm not getting anywhere because I don't understand how to understand the flow from the various has.a_...
To understand it, I created a minimal example, the core of which looks like this. The data_dict is a dictionary. The data is written to a deque.
while True:
data_dict = data_dict
hat.a_in_scan_start(3, 100, OptionFlags.CONTINUOUS)
read_result = hat.a_in_scan_read_numpy(100, RETURN_IMMEDIATELY)
read_data = read_result.data.reshape((len(channels), -1), order='F')
for channel in channels:
data_dict['data'][channel].extend(read_data[channels.index(channel)])
print(data_dict['data'][channel])
# print(data_dict['data'][channel][0][0])
hat.a_in_scan_stop()
hat.a_in_scan_cleanup()
sleep(0.5)
However, identical values are always written to the dict, even if you stop and do a cleanup. I don't understand this at all.
Unfortunately you can't use your own numpy syntax because it doesn't get along with the library.
Where is the error?
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now