MCC DaqHat and Raspberry Pi Guidance

We are in the process of building a data acquisitoin system using a remote Raspberry Pi, and 2 Daqhats from MCC-DAQ. I am wondering if anyone else has tried this configuration and if so is there any guidance that they would recommend?
-Matlab says that they don't support these modules. I was pretty sure when we purchased it they acted like they did. I have been unable to find any reference to this within Mathlab or the Forums.
-MCC-DAQ acted like it was fairly straightforward. However, since starting this they have made it very difficult to communicate with them. I have not really found any material there either yet.
I apologize for this being a vague post but I don't have many details to share yet.
Sincerely, Paul

 Accepted Answer

Umar
Umar on 2 Jul 2024
Edited: Walter Roberson on 18 Jul 2024
Hi Paul,
I am wondering if anyone else has tried this configuration and if so is there any guidance that they would recommend? -Matlab says that they don't support these modules. I was pretty sure when we purchased it they acted like they did. I have been unable to find any reference to this within Mathlab or the Forums. -MCC-DAQ acted like it was fairly straightforward. However, since starting this they have made it very difficult to communicate with them. I have not really found any material there either yet.
To answer your questions, please see my comments below.
There are alternative ways to interface with these devices using Matlab. One approach is to utilize the MCC-DAQ provided APIs or SDKs to communicate with the Daqhats directly from Matlab. By leveraging these APIs, you can access the functionalities of the Daqhats within your Matlab environment, enabling seamless integration with your data acquisition system.
Here is a simplified example of how you can interact with the Daqhats in Matlab using the MCC-DAQ API:
% Load the MCC-DAQ library
loadlibrary('mccdaq', 'mccdaq.h');
% Initialize the Daq device
boardNum = 0; % Specify the board number
errorCode = calllib('mccdaq', 'mccOpen', boardNum);
if errorCode == 0 disp('Daq device opened successfully'); % Perform data acquisition operations here else disp('Failed to open Daq device'); end
% Unload the library
unloadlibrary('mccdaq');
If you are experiencing difficulties in communicating with MCC-DAQ directly, exploring their documentation, knowledge base, or contacting their technical support team might provide valuable insights and solutions.
While the initial hurdles you are encountering may seem daunting, there are avenues to explore and resources to leverage in order to successfully build your data acquisition system with Raspberry Pi and Daqhats. By combining technical knowledge, community support, and perseverance, you can overcome these challenges and create a robust and efficient data acquisition setup tailored to your needs.

7 Comments

Thank you for the info. I just revisited the forum. We have made a fair bit of progress. Posting for anyone following later.
1- As of 2024a, Matlab does not support the PI5, just Pi3B, Pi3b+, and Pi4B.
2- AS of 2024a, Matlab does not support Bookworm, but supports Bullseye. I am not sure how far back the support goes.
We made both errors which set us back quite a bit.
Once fixed, we were able to install the PI package on Matlab, and onto the PI.
We have been able to communicate with the PI from matlab so that part is working properly. WE have been able to run simple piscripts from matlab. I do not think that we can access the boards directly from Matlab.
We have been able to install the DAQHAT C and python libraries from Github. We have been able to read data using the python library. We still need to do more.
I thought this was either supported or documented when we made the purchase of Matlab. Turns out it is neither.
We were originally told we would not need the data acquistion module. Then upon purchase were told we would need it. We questioned that but were reassured that was correct. That appears to be an error. All data acquistion appears to be done through the Python or C library with MCC Daqhats. Only data files are going to be saved and retrieved. Raspberry Pi applications seem to be a distant 2nd or 3rd thought with Matlab.
Hi Paul,
Thank you for the update on your progress with Matlab and Raspberry Pi. It's great to hear that you have been able to make some headway despite the setbacks you encountered. I understand that it must have been frustrating to discover that Matlab does not support PI5 and Bookworm, which caused a delay in your work. It's unfortunate that this information was not made clear at the time of purchase, and I apologize for any inconvenience this may have caused. It's good to know that you were able to install the PI package on Matlab and communicate with the PI from Matlab. Additionally, it's promising that you have successfully installed the DAQHAT C and Python libraries from Github and have been able to read data using the Python library. I will make sure to pass on your feedback about the lack of support or documentation for data acquisition through Matlab at the time of purchase. At Mathworks, we always strive to provide our customers with accurate information and will take your experience into consideration for future improvements. If there is anything else we can do to assist you further, please do not hesitate to reach out.
Raspberry Pi applications seem to be a distant 2nd or 3rd thought with Matlab.
Would you prefer that Mathworks prioritize Raspberry Pi applications over basic accuracy and speed of MATLAB itself?
@Walter Roberson - I understand your point. However, We explained repeatedly what we wanted to do and how we wanted to do it. No this was never something we could explore and finalize within a trial period while hitting all of our other timeline commitments. We asked repeatedly if this was within its capability and were told yes it was in a manner that acted like it was relatively simple and or common. From where I sit right now, I'd say the correct simple answer may have been somethign like, "Yes you can probably do that, but maybe there are better options out there." Yes we looked into other options. Yes I like the speed and accuracy you mentioned. Yes Ilike the programming language. However,
The point is that you would be lucky if Mathworks considered the Raspberry Pi as a sixth or seventh thought.
Walter reading your first response for th 5th time. I know, I'm a bit dense right now, but this is frustrating. I just realized you said using the 'DAQHAT API.' I was told BY MATLAB just days ago that MATLAB did not have any API's for these products. This sort of thing is where my frustatation lies at this time. I think the people who talked to me up front know what I want to do, however getting someone within Matlab that knows the same stuff is a challenge. Thank you very much. Sorry for being a bit of a jerk.
It was @Umar that said to use the MCC-DAQ API

Sign in to comment.

More Answers (1)

Since we appear to be working in an area with limited documentation I thought I would post what we have learned so far with regard to this post, with hopes it will help get someone else started on the right path later.
1- We found a Support package for MCC equipment. We installed that.
2- we researched it a bit further, and do not see our devices covered under the supported hardware (MCC-172 and MCC-128 cards).
3- It looks like these API's are for equipment directly connected to a computer, while DAQHATS are installed on a raspberry pi.
4- We did install a python library onto the PI. That required a virtual environment. This caused issues when we tried to call 2 scripts in a row from Matlab and the conclusion of the 1st script appeared to close the virtual environment.
5- We did figure out that to call the fuctions properly using the virtual environment, the full path of the python script in the virtual environment is needed. Information found outside of Matlab.
6- with this and the odd examples given in the mcc library we have been able to piece together a simple code that records N-samples at S-Samples/sec.

1 Comment

MCC Staff wrote
It is not possible to read the inputs with simple GPIO control. Our driver uses GPIO and the SPI bus to select and control each board, and how it works is proprietary information.

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!