Jump to content
  • 0

MCC 134 Continous read problems


daved

Question

Hi,

I'm using several of your mcc134 boards to read thermocouples and i wanted it to run continuously for around a week. I have the system system working but it only runs for a couple hours before i get a to many files open error when i started digging into this it looks like every time i call the hat it reads the eeproms but does not close after reading creating a file open instance this builds over the course of time until the system crashes do you have any suggestions on how to fix this?

Thanks,

Dave

thermal_daq_del.py

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello,

It's not recommended to create board objects each time a single temperature value is needed. Instead, create them once as a global object. Take a look at the MCC118 example called "mult_hat_synchronous_scan.py". It has a function called "select_hat_devices(filter_by_id, number_of_devices" and it returns a list of daqhat objects. Copy the function to your program and call it once to establish a list of MCC134 objects. Here's an example of how you would use it:

DEVICE_COUNT = 4

hats = slect_hat_devices(HatIDs.MCC_134, DEVICE_COUNT) 

The hats list now contains the four mcc134 objects.

Right after this function call, you could configure the thermocouple types too. Then all that is need in your Rec_Data() function is to iterate the object list reading the four channels from each board.

Regards,

John

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...