
telisaths (Customer) asked a question.
The configuration I want to use (0-39mV) only prints 0.00 regardless of how many mV get inputted to the module. When I configure it to a J type thermocouple input, everything works fine so the wiring and hardware is verified that it is working. When I use the 0-39mV configuration the same thermocouple shows 0 before any mapping is done. When I print THMmodstatus it prints out 0 in all cases. Below is a snippet of the non working code:
const char P1_04THM_CONFIG[] = { 0x40, 0x03, 0x60, 0x01, 0x21, 0x09, 0x22, 0x09, 0x23, 0x09, 0x24, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
bool THMmodstatus = P1.configureModule(P1_04THM_CONFIG, card4);
PT711_raw = P1.readTemperature(card4, 1);
Serial.print("PT-711: ");
Serial.println(PT711_raw, 2);
Are you configuring the module before every reading like below? If so, that is likely the cause of your issue. Usually the module would be configured in setup() and then just read in the loop.
Hi Adam,
Thank you for your response. I did have the Array and P1.configureModule function in the loop but when I pulled them out the problem persists. Here is my current entire code, most of it is for other modules but maybe somewhat relevant:
When the modules initialize they print this:
TT-711: 273.15
TT-722: 273.15
TT-794: 273.15
TT-721: 273.15
TT-712: 273.15
VG-781: -24.93
PT-791: 0.00000000
PT-711: 0.00000000
THMmodstatus:
0
RTD1modstatus:
0
When I connect RTD (PT100) TT-711 and TT-721, as well as a thermocouple on PT-711 only to see if there is any mV reading I get the following:
TT-711: 295.10
TT-722: 73.15
TT-794: 73.15
TT-721: 293.41
TT-712: 73.15
VG-781: -24.93
PT-791: 0.12799999
PT-711: 0.00000000
THMmodstatus:
0
RTD1modstatus:
0
PLC_code
I ran your code on a comparable setup on my desk and was seeing proper readings on the P1-04THM.
Could you try the following:
On my setup, this is printing out ~0.027V to the monitor.