Hello everyone,
Hello everyone,
I'm having a strange problem with a CR10X. I'm trying a program that only logs data when a condition is met, for example, when the average temperature of two thermocouples is greater or equal to 40°C.
I'm using PC400 to monitor the logger, and I have noticed that when the condition to start logging is met, the logger disconnects from the PC, and I can't connect to it again, unless the condition is not met anymore. It is a strange behavior that I haven't seen before. I use a LED connected to C6 to check when the program enters the if statement but, it never blinks, so I think that the logger crashes when tries to log the data.
Any idea of what could be happening?
Next is my code in EDLOG:
Execution interval 1s
; CJC for thermocouples
1:  Internal Temperature (P17)
 1: 1        Loc [ TempRef   ]
; Measuring thermocouples
2:  Thermocouple Temp (DIFF) (P14)
 1: 2        Reps
 2: 22       7.5 mV 60 Hz Rejection Range
 3: 1        DIFF Channel
 4: 4        Type J (Iron-Constantan)
 5: 1        Ref Temp (Deg. C) Loc [ TempRef   ]
 6: 2        Loc [ Temp1     ]
 7: 1.0      Multiplier
 8: 0.0      Offset
 
; Measuring relative humidity
3:  Volt (SE) (P1)
 1: 1        Reps
 2: 25       2500 mV 60 Hz Rejection Range
 3: 11       SE Channel
 4: 4        Loc [ RH        ]
 5: 0.1      Multiplier
 6: 0.0      Offset
; Measuring Temp with MCP9700A
4:  Volt (SE) (P1)
 1: 1        Reps
 2: 25       2500 mV 60 Hz Rejection Range
 3: 5        SE Channel
 4: 5        Loc [ Temp3     ]
 5: 0.1      Multiplier
 6: -50      Offset
; Averaging the two thermocouple measurements
5:  Spatial Average (P51)
 1: 2        Swath
 2: 2        First Loc [ Temp1     ]
 3: 6        Avg Loc [ TempProm  ]
; if TempProm >= 40°C
6:  If (X<=>F) (P89)
 1: 6        X Loc [ TempProm  ]
 2: 3        >=
 3: 40.0     F
 4: 30       Then Do
     ; Enable writing to FSL
     7:  Do (P86)
      1: 10       Set Output Flag High (Flag 0)
     
     8:  Real Time (P77)^27687
      1: 1220     Year,Day,Hour/Minute (midnight = 2400)
     
     ; Write TempProm in FSL
     9:  Sample (P70)^32425
      1: 1        Reps
      2: 6        Loc [ TempProm  ]
      
     ; Toggle LED as an indicator
     10:  Do (P86)
      1: 66       Toggle Port 6
11: End (P95)
Thanks in advance.