Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

watchdog error problem


masdarmech May 22, 2011 04:40 AM

I am using CR1000 (OS ver 21) to control a valve and also take measurements of different analog and pulse sensors installed in my system.

i am getting "watchdog error". i have checked grounding and hardware and tried my program on another cr1000 logger. the program works fine when i don't have any slow sequence (remove lines 344-347) but i have skipped scans. however, i get watchdog error when i use slow sequence. I need the valve control sequence needs to be fast i.e. scan time of at least 2-3 sec while the measurements can occur over an interval of 1-2min.

kindly find the attached program. i'll be grateful for suggestion:
'Declare Reference Variables
Public CR1000Temp, AM25Temp, AM25Temp0, batt_volt, sdmstat, serialstat, es,
Public comp_voltage,comp_current, comp_current_limit=5.7, failmode, suction_timer=0, timer_flag=0,suction_timer_set=60, zone_timer=0, zone_flag=0,zone_timer_set=5, delay_timer=200, delay_flag=0, delay_timer_set=120'failsafe
Public Qe,Tz,f,rpm,TxK,TzK 'model based speed control
Public log_result, water_flow, pump_power, slab_temp(20), room_temp(19), Ptemp, Iload '+++++
Public rpm_sensor
Public GHI_South, GHI_West, Tsouth, Twest
Public PambairkPa, RelativeHumidity, room_temp_NW, Tdew, Tglobe, SpecificHumidity, Tdew1

Public PdisPSIG, PcondoutPSIG, PevapinPSIG, PsucPSIG
Public RTdischarge, RTcondin, RTcondout, RTdrierin, RTdrierout 'high side temp
Public RTpostLEV, RTsuction, RTsuction1 'low side temp
Public RTHXin, RTHXout, CHWTin, CHWTout 'HX inlet and outlet
'Public RTcondout1,RTcondoutlevhigh1small,RTcondoutlevhigh2big,RTcondoutlevlow1small,RTcondoutlevlow2big 'tcondout error check
Public ATcondenserin, ATdelTcondenser, delta_mV, Tref, dTresult, mV_TdT 'condenser thermopile

Public fan_totpower,fan_angle,fan_power,VFDpowerin,comp_totpower,comp_angle,comp_power
Public ref_mass_flow

Public Psat, Tsat 'for saturation temperature
Public Tsatcond, Tsubcool, Tsubcool_set=5 'subcool control
Public Tsatsuc,Tsuperheat,Tsuperheat_set=2,Tsatdis,Tsuperheatdis 'superheat control
Public refrigerant_level,refrigerant_level_set=95 'refrigerant level control

Public frequency_set_old As Long,frequency_set As Long,VFD_control_old As Long,VFD_control As Long, VFD_relay_old 'VFD control
Public fan_speed_set, fan_speed_max=1000,volt_signal(4) 'fan speed control
Public LEV_Kp,LEV_Ki,LEV_Kd,errvarLEV_old,errvarLEV=0,intgrlLEV=0,LEVcorr_0,LEVcorr,LEV_Kpold, LEV_Kiold, LEV_Kdold,LEVpos=0,del As Long,LEV_operation(16) 'LEVcontrol
Public speed_Kp,speed_Ki,speed_Kd,errvarspeed_old,errvarspeed=0,intgrlspeed=0,speedcorr_0,speedcorr,speed_Kpold, speed_Kiold, speed_Kdold 'speed control

Public cntrlvarLEV,cntrlvarLEV_set,cntrlvarLEV_set_old,cntrlvarspeed,cntrlvarspeed_set,cntrlvarspeed_set_old,Tz_set=24,dead_band_speed=.5 'control variables

Alias RTdrierout=RTpreLEV
Alias ATcondenserin=Tx

Alias LEV_operation(1)=LEV_open
Alias LEV_operation(2)=LEV_close
Alias LEV_operation(3)=VFD_relay

Dim i=1

Const LEVmax_pos=965 'millisec
Const ct = 2 'number of times in a sec scan time/control time for LEV
Const ctspeed = 60 'number of times in a sec scan time/control time for speeds
Const dtt=20 'sec data table time
Const C0= -30.27 'from honeywell PT chart for R410a quadratic polynomial with ln(P) Genetron-Pressure-Temperature-Chart in papers folder
Const C1= -14.71
Const C2= 4.61

'Define Data Tables
DataTable (test_stand1,1,-1)
DataInterval (0,2,Min,10)
Minimum (1,batt_volt,IEEE4,0,False)
'Average (1,CR1000Temp,IEEE4,)
Average (1,AM25Temp,IEEE4,False)

Average (1,PambairkPa,IEEE4,False)
Average (1,RelativeHumidity,IEEE4,False)
Average (1,Tz,IEEE4,False)
Average (1,Tdew,IEEE4,False)
Average (1,SpecificHumidity,IEEE4,False)
' Average (1,Tglobe,IEEE4,False)

Average (1,PdisPSIG,IEEE4,False)
Average (1,PcondoutPSIG,IEEE4,False)
Average (1,PevapinPSIG,IEEE4,False)

Average (1,RTdischarge,IEEE4,False)
Average (1,RTcondin,IEEE4,False)
Average (1,RTcondout,IEEE4,False)
Average (1,RTpreLEV,IEEE4,False)
Average (1,RTpostLEV,IEEE4,False)
Average (1,RTHXin,IEEE4,False)
Average (1,RTHXout,IEEE4,False)

Average (1,CHWTin,IEEE4,False)
Average (1,CHWTout,IEEE4,False)

Average (1,Tx,IEEE4,False)
Average (1,ATdelTcondenser,IEEE4,False)

' Average (1,VFDpowerin,IEEE4,False)
Average (1,comp_power,IEEE4,False)
Average (1,fan_Power,IEEE4,False)

Average (1,GHI_South,IEEE4,False)
Average (1,GHI_West,IEEE4,False)
Average (1,Tsouth,IEEE4,False)
Average (1,Twest,IEEE4,False)

' Average (1,refrigerant_level,FP2,False)
Average (1,Tsubcool,IEEE4,False)
Average (1,comp_current,IEEE4,False)
Average (1,comp_voltage,IEEE4,False)
Average (1,comp_angle,IEEE4,False)
Average (1,Tsuperheatdis,IEEE4,False)

EndTable

DataTable (test_stand0,1,-1)
DataInterval (0,2,Min,10)
Average (1,PsucPSIG,IEEE4,False)
Average (1,RTsuction,IEEE4,False)
Average (1,Tsuperheat,IEEE4,False)

Average (1,fan_speed_set,IEEE4,False)
Average (1,frequency_set_old,IEEE4,False)

Average (1,ref_mass_flow,IEEE4,False)
Average (1,rpm_sensor,IEEE4,False)

EndTable
Sub actLEV(cntrlvarLEV)
Call LEVcontrol(cntrlvarLEV)
If i<>0 'for zero excitation when valve is fully closed or open
If LEVcorr>0'cntrlvar<cntrlvar_set 'open valve red light C2
del=ABS(LEVcorr)

'If del>LEVmax_pos*1000 Then 'for crash prevention (from NANs) not working
'Else
If del>3 '3msec is the delay of microcontroller
'WriteIO(&B00100000,&B00100000) 'C6
LEV_open=1
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
Delay (1,del,mSec)'LEVcorr is the amount of time excitation remains there
LEV_open=0
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
'WriteIO(&B00100000,&B00000000)

LEVpos=LEVpos+LEVcorr
EndIf
'EndIf
ElseIf LEVcorr<0'cntrlvar>cntrlvar_set 'close valve green light C3
del=ABS(LEVcorr)
'If del>LEVmax_pos*1000 Then
'Else
If del>3
'WriteIO(&B01000000,&B01000000) 'C7
LEV_close=1
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
Delay (1,del,mSec)'LEVcorr is the amount of time excitation remains there
LEV_close=0
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
'WriteIO(&B01000000,&B00000000)

LEVpos=LEVpos+LEVcorr
EndIf
'EndIf
EndIf
If LEVpos>LEVmax_pos
LEVpos=LEVmax_pos
ElseIf LEVpos<0
LEVpos=0 'can't be less than 0
EndIf
EndIf

EndSub

Sub LEVcontrol(cntrlvarLEV)
errvarLEV=cntrlvarLEV_set-cntrlvarLEV
If (ABS(cntrlvarLEV_set-cntrlvarLEV_set_old)+ABS(LEV_Kp-LEV_Kpold)+ABS(LEV_Ki-LEV_Kiold)+ABS(LEV_Kd-LEV_Kdold))>0 OR LEVpos>LEVmax_pos OR LEVpos<=0 Then
intgrlLEV=0 'Resset Intergal term if the setpoint or gains are changed or valve is at saturation
EndIf
LEVcorr_0=LEV_Kp*errvarLEV+LEV_Kp*(intgrlLEV+1/ct*errvarLEV)/LEV_Ki+LEV_Kp*LEV_Kd*(errvarLEV-errvarLEV_old)*ct 'control line
LEVcorr=Round(LEVcorr_0,0)
If (cntrlvarLEV_set<cntrlvarLEV AND LEVcorr>0) Then 'correct for incorrect valve operation and wrong correction (have encountered)
LEVcorr=-LEVcorr
ElseIf (cntrlvarLEV_set>cntrlvarLEV AND LEVcorr<0) Then
LEVcorr=LEVcorr
EndIf
'If (LEVcorr-LEV_pos) > LEVmax_del Then 'limit for positive extreme of pulses (correction that CR1000 can handle w/o skipping scans) depends on scan time (not needed for 1 sec)
' LEVcorr=LEVmax_pos+LEV_pos
'ElseIf (LEVcorr-LEV_pos) < -LEVmax_del Then 'limit for negative extreme of pulses
' LEVcorr =-LEVmax_pos+LEV_pos
'EndIf
'integral routine
If LEVcorr>LEVmax_pos Then 'for max time limit/valve position
LEVcorr=LEVmax_pos
If errvarLEV > 0 Then
intgrlLEV=intgrlLEV+errvarLEV*1/ct 's(k-1) integral summing
EndIf
ElseIf LEVcorr<-LEVmax_pos Then 'for max time limit/valve position
LEVcorr =-LEVmax_pos
If errvarLEV < 0 Then
intgrlLEV=intgrlLEV+errvarLEV*1/ct 's(k-1) integral summing
EndIf
Else
intgrlLEV=intgrlLEV+errvarLEV*1/ct 's(k-1) integral summing
EndIf
'LEVcorr_a=LEVcorr-LEV_pos
'refrigrant_level_set_old=refrigerant_level_set

errvarLEV_old=errvarLEV
cntrlvarLEV_set_old=cntrlvarLEV_set
LEV_Kpold=LEV_Kp
LEV_Kiold=LEV_Ki
LEV_Kdold=LEV_Kd
If (LEVpos>=LEVmax_pos AND LEVcorr>0) Then ' not to operate valve if already fully open or closed
LEVcorr=0
intgrlLEV=0
i=0
ElseIf (LEVpos<=0 AND LEVcorr<0) Then
LEVcorr=0
intgrlLEV=0
i=0
EndIf
EndSub

Sub Failsafe

If CHWTin<5 OR CHWTout<5 OR Tz<10 OR RTdischarge>85 OR Tsatdis>50 OR comp_current>=7 OR comp_current=Nan
frequency_set=0
VFD_control=0
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,9,1,3,10) 'change VFD operation status start (2)/stop(0 or 1)
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'change running VFD frequency
ModBusMaster(serialstat,Com3,19200,1,3,frequency_set_old,14,1,3,10) 'read running VFD frequency
failmode=1
delay_timer=Timer(3,Sec,2) 'reset and start delay_timer
delay_flag=1
EndIf
If RTsuction1<-2 AND timer_flag=0
suction_timer=Timer(1,Sec,2) 'reset and start suction_timer
timer_flag=1
EndIf
suction_timer=Timer(1,Sec,4)
If RTsuction1<-2 AND suction_timer>suction_timer_set 'if Tsuction remains at -2 for 1 minute
frequency_set=0
VFD_control=0
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,9,1,3,10) 'change VFD operation status start (2)/stop(0 or 1)
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'change running VFD frequency
ModBusMaster(serialstat,Com3,19200,1,3,frequency_set_old,14,1,3,10) 'read running VFD frequency
failmode=2
delay_timer=Timer(3,Sec,2) 'reset and start delay_timer
suction_timer=Timer(1,Sec,3) 'stop and reset suction_timer
timer_flag=0
ElseIf suction_timer>suction_timer_set
suction_timer=Timer(1,Sec,3) 'reset and stop suction_timer
timer_flag=0
EndIf
EndSub

'Main Program
BeginProg
'for LEV control with Tsuperheat
LEV_Kp=5
LEV_Kpold=LEV_Kp
LEV_Ki= 45
LEV_Kiold=LEV_Ki
LEV_Kd= 11.25
LEV_Kdold=LEV_Kd

'for speed control with Tz
speed_Kp=5000
speed_Kpold=speed_Kp
speed_Ki= 100000
speed_Kiold=speed_Ki
speed_Kd= 0
speed_Kdold=speed_Kd

'initialization
frequency_set=10000
frequency_set_old=frequency_set

fan_speed_set=1000

VFD_control=0
VFD_control_old=VFD_control

VFD_relay=0
VFD_relay_old=VFD_relay

cntrlvarLEV_set_old=cntrlvarLEV_set
cntrlvarspeed_set_old=cntrlvarspeed_set
f=63
rpm=0
AM25T (room_temp_NW,1,mV2_5,13,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
Tz=room_temp_NW

SDMIO16(LEV_operation,sdmstat,0,89,0,0,0,0,0111,0) 'don't know why it doesn't work sometimes with 94 if restart cr1000

'initialization for controls
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,2,1,3,10) 'for resetting VFD .1msec delay
'SW12(1) '12V power for control circuit
'WriteIO(&B10000000,&B00000000) 'relay on (currently off)
'WriteIO(&B00100000,&B00100000) 'to bring the valve to its fully close position green light C4
LEV_close=1
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
Delay (1,3,Sec)'LEVcorr is the amount of time excitation remains there
LEV_close=0
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
'WriteIO(&B00100000,&B00000000)
'SDMIO16(LEV_close,sdmstat,0,89,9999,9999,9999,9990,1,0)
ModBusMaster(serialstat,Com3,19200,1,3,VFD_control_old,9,1,3,10) 'read VFD operation status
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'set VFD frequency = 0Hz

volt_signal(1)=0 '1rpm=2.857mV
SDMAO4(volt_signal(1),1,1)

Scan (ct,Sec,0,0)
AM25T (AM25Temp0,0,mV2_5,1,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
VoltDiff (PsucPSIG,1,mV250C,6,True ,0,_50Hz,4.945,-6.467) 'calibrated transducer number 1
AM25T (RTsuction,1,mV2_5,8,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
'to calculate superheat
Tsatsuc=C2*(LN(PsucPSIG+14.5))^2+C1*(LN(PsucPSIG+14.5))+C0
Tsuperheat=RTsuction-Tsatsuc

i=1
cntrlvarLEV=-Tsuperheat 'can make any variable control varaiable as long as error (set-actual) follows for > valve open for < valve close
'parameter s>a s<a actual increase actual decrease
'ref. level open close open close
'Tsubcool open close open close
'Tsuperheat close open close open (if multiply by -1 both set and actual then s>a open s<a close)
'Tsuperheatcond close open close open (if multiply by -1 both set and actual then s>a open s<a close)
'Q decrease increase speed decrease speed increase
cntrlvarLEV_set=-Tsuperheat_set

Call actLEV(cntrlvarLEV)

' mass flow rate
PulseCount (ref_mass_flow,1,2,0,1,3e-6,0) 'Refrigerant
'10000Hz=.03 kg/sec so for 1 Hz 3e-6

' rpm sensor
PulseCount(rpm_sensor,1,1,2,1,60,0)

If VFD_relay<>VFD_relay_old
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
VFD_relay_old=VFD_relay
EndIf

If frequency_set<>frequency_set_old
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'change running VFD frequency
ModBusMaster(serialstat,Com3,19200,1,3,frequency_set_old,14,1,3,10) 'read running VFD frequency
EndIf

volt_signal(1)=fan_speed_set*(2.857+.0857)+1.9 '1rpm=2.857mV
SDMAO4(volt_signal(1),1,1)

If VFD_control<>VFD_control_old
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,9,1,3,10) 'change VFD operation status start (2)/stop(0 or 1)
VFD_control_old=VFD_control
EndIf

NextScan

SlowSequence
Scan(dtt,Sec,0,0)

'Panel Temperatures and references
AM25T (AM25Temp,0,mV2_5,1,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
PanelTemp (CR1000Temp,_50Hz)
Battery (Batt_volt)

' Air pressure
VoltDiff (PambairkPa,1,mv5000,8,True,0,_50Hz,3.939e-3,-3.75)
'238 ohm, 4-20 mA output, 4760 mV = 15 psia, 952 mV = 0 psia
PambairkPa=PambairkPa*6.89476

'zone relative humidity
VoltSe (RelativeHumidity, 1,mv5000,3,True,0,_50Hz,0.032258,-25.80645)

'zone temperature
AM25T (room_temp_NW,1,mV2_5,13,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
' AM25T (Tglobe,1,mV2_5,14,1,TypeT,AM25Temp,4,6,Vx1,True ,0,_50Hz,1.0,0)
es=6.1121*EXP((18.678-Tz/234.5)*Tz/(257.14+Tz)) 'arden buck equation 1996
Tdew1=(237.7*LOG10(es*RelativeHumidity/611))/(7.5-LOG10(es*RelativeHumidity/611))
SpecificHumidity=.62197*(es*RelativeHumidity/100)/(PambairkPa*10+(es*RelativeHumidity/100)*(.62197-1))
DewPoint(Tdew,room_temp_NW,RelativeHumidity)
If Tdew>room_temp_NW OR Tdew=NAN Then Tdew=room_temp_NW

' Refrigerant pressures
VoltDiff (PdisPSIG,1,mV250C,5,True ,0,_50Hz,4.977,1.55) 'calibrated transducer number 3
VoltSe (PcondoutPSIG,1,mv5000,13,True,0,_50Hz,123.9e-3,-63.1) 'calibrated transducer number 5
VoltSe (PevapinPSIG,1,mv5000,14,True,0,_50Hz,124.7e-3,-63.83) 'calibrated transducer number 8

' Refrigerant temperatures
'high side temperatures
AM25T (RTdischarge,1,mV2_5,1,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTcondin,1,mV2_5,2,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTcondout,1,mV2_5,3,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTsuction1,1,mV2_5,8,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'to see drier temperature drop implies pressure drop
AM25T (RTdrierin,1,mV2_5,4,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTdrierout,1,mV2_5,5,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'low side temperatures
AM25T (RTpostLEV,1,mV2_5,6,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTHXin,1,mV2_5,7,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTHXout,1,mV2_5,12,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'chilled water temperatures
AM25T (CHWTin,1,mV2_5,9,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (CHWTout,1,mV2_5,10,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

' Air Temperature
AM25T (ATcondenserin,1,mV2_5,11,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)

' Scaling for thermopile measurement
AM25T (delta_mV,1,mV25C,16,1,-1,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
delta_mV = delta_mV/16 '16 thermopile junction pairs
Tref = ATcondenserin
'delta_mV = delta_mV*0.1 'to avoid exponents in equation of volt to temp conversion dTresult
'TdTref = TdTref*0.01
'mV_TdT = delta_mV*TdTref*0.001' for bringing it in Volts
dTresult = 25.89-5.749e-2*Tref-.7447*delta_mV+1.632e-4*Tref^2+5.557e-3*Tref*delta_mV+.4654*delta_mV^2-.4475e-6*Tref^3-2.107e-5*Tref^2*delta_mV-3.793e-4*Tref*delta_mV^2-2.188e-3*delta_mV^3 'volt to temp conversion
'dTresult = dTresult-5.749*TdTref+1.635*TdTref-0.4475*TdTref
'dTresult = dTresult+mV_TdT*5.557-2.107*mV_TdT*TdTref-3.793*mV_TdT*delta_mV
'delta_mV = delta_mV*10
ATdelTcondenser = dTresult*delta_mV
'TdTref = TdTref*100

' end of scaling for thermopile measurement

' Wattnode power
'PulseCount (VFDpowerin,1,1,0,1,34.506,0)
' WNB-3Y-400-P, Wh per pulse per CT rated Amp = 0.001917
' 59.7 ohm resistor installed = 5 Amps full scale
' WhpP = 0.0096
' Watts = WhpP*PulseCount/sec*3600 sec/hour
' W/Hz = WhpP*3600 sec/hour = 34.506 Watts

AM25T(comp_voltage,1,mv5000,17,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.06,0)
AM25T(comp_angle,1,mv5000,19,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.072,0)
AM25T(comp_power,1,mv5000,20,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,1.22,0)
AM25T(comp_totpower,1,mv5000,21,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,1.045,0)
AM25T(fan_power,1,mv5000,22,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.06,0)
AM25T(fan_totpower,1,mv5000,23,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.03,0)

VoltSe(GHI_South,1,mV25,4,True,0,_50Hz,-86.704,0) 'PY64287 1/(78.7e-3*146.55ohm)
VoltSe(GHI_West,1,mV25,5,True,0,_50Hz,-85.03,0) 'PY64288 1/(78.93e-3*149ohm)
AM25T (Tsouth,1,mV2_5,25,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) 'epoxied
AM25T (Twest,1,mV2_5,24,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' epoxied

' Measure refrigerant level
VoltSe (refrigerant_level,1,mv5000,6,True,0,_50Hz,16.67e-3,16.67)
'3321.15mV=100 level 1mV=.03006153596 level (not applicable)

''''to calculate superheat
Tsatdis=C2*(LN(PdisPSIG+14.5))^2+C1*(LN(PdisPSIG+14.5))+C0
Tsuperheatdis=RTdischarge-Tsatdis

'to calculate subcooling
Tsatcond=C2*(LN(PcondoutPSIG+14.7))^2+C1*(LN(PcondoutPSIG+14.7))+C0
Tsubcool=Tsatcond-RTcondout

GetVariables(log_result,ComRS232,0,2,0,0,"Public","room_temp()",room_temp(),19)
Tz=(room_temp(1)+room_temp(2)+room_temp(3)+room_temp(4)+room_temp(5)+room_temp(6)+room_temp(7)+room_temp(8)+room_temp(9)+room_temp(10)+room_temp(11)+room_temp(12)+room_temp(13)+room_temp(14)+room_temp(15)+room_temp(16)+room_temp(17)+room_temp(18)+room_temp(19)+room_temp_NW)/20
''''cntrlvarspeed=-Tz
''''cntrlvarspeed_set=-Tz_set

'to prevent compressor stall and decrease compressor current
AM25T(comp_current,1,mv5000,18,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.002,0)
Call Failsafe

CallTable test_stand0
CallTable test_stand1
' PulseCountReset
NextScan
EndSequence

EndProg


masdarmech May 24, 2011 07:41 PM

i got my code working after switching shifting some measurement lines between the main and slow sequence. however, if i add even one more measurement line in the slow sequence now, i start getting the watchdog error.

The working code is:
'Declare Reference Variables
Public CR1000Temp, AM25Temp, AM25Temp0, batt_volt, sdmstat, serialstat, es,
Public comp_voltage,comp_current, comp_current_limit=5.7, failmode, suction_timer=0, timer_flag=0,suction_timer_set=60, zone_timer=0, zone_flag=0,zone_timer_set=5, delay_timer=200, delay_flag=0, delay_timer_set=120'failsafe
Public Qe,Tz,f,rpm,TxK,TzK 'model based speed control
Public log_result, water_flow, pump_power, slab_temp(20), room_temp(19), Ptemp, Iload '+++++
Public rpm_sensor
Public GHI_South, GHI_West, Tsouth, Twest
Public PambairkPa, RelativeHumidity, room_temp_NW, Tdew, Tglobe, SpecificHumidity, Tdew1

Public PdisPSIG, PcondoutPSIG, PevapinPSIG, PsucPSIG
Public RTdischarge, RTcondin, RTcondout, RTdrierin, RTdrierout 'high side temp
Public RTpostLEV, RTsuction, RTsuction1 'low side temp
Public RTHXin, RTHXout, CHWTin, CHWTout 'HX inlet and outlet
'Public RTcondout1,RTcondoutlevhigh1small,RTcondoutlevhigh2big,RTcondoutlevlow1small,RTcondoutlevlow2big 'tcondout error check
Public ATcondenserin, ATdelTcondenser, delta_mV, Tref, dTresult, mV_TdT 'condenser thermopile

Public fan_totpower,fan_angle,fan_power,VFDpowerin,comp_totpower,comp_angle,comp_power
Public ref_mass_flow

Public Psat, Tsat 'for saturation temperature
Public Tsatcond, Tsubcool, Tsubcool_set=5 'subcool control
Public Tsatsuc,Tsuperheat,Tsuperheat_set=2,Tsatdis,Tsuperheatdis 'superheat control
Public refrigerant_level,refrigerant_level_set=95 'refrigerant level control

Public frequency_set_old As Long,frequency_set As Long,VFD_control_old As Long,VFD_control As Long, VFD_relay_old 'VFD control
Public fan_speed_set, fan_speed_max=1000,volt_signal(4) 'fan speed control
Public LEV_Kp,LEV_Ki,LEV_Kd,errvarLEV_old,errvarLEV=0,intgrlLEV=0,LEVcorr_0,LEVcorr,LEV_Kpold, LEV_Kiold, LEV_Kdold,LEVpos=0,del As Long,LEV_operation(16) 'LEVcontrol
Public speed_Kp,speed_Ki,speed_Kd,errvarspeed_old,errvarspeed=0,intgrlspeed=0,speedcorr_0,speedcorr,speed_Kpold, speed_Kiold, speed_Kdold 'speed control

Public cntrlvarLEV,cntrlvarLEV_set,cntrlvarLEV_set_old,cntrlvarspeed,cntrlvarspeed_set,cntrlvarspeed_set_old,Tz_set=24,dead_band_speed=.5 'control variables

Alias RTdrierout=RTpreLEV
Alias ATcondenserin=Tx

Alias LEV_operation(1)=LEV_open
Alias LEV_operation(2)=LEV_close
Alias LEV_operation(3)=VFD_relay

Dim i=1

Const LEVmax_pos=965 'millisec
Const ct = 2 'number of times in a sec scan time/control time for LEV
Const ctspeed = 60 'number of times in a sec scan time/control time for speeds
Const dtt=20 'sec data table time
Const C0= -30.27 'from honeywell PT chart for R410a quadratic polynomial with ln(P) Genetron-Pressure-Temperature-Chart in papers folder
Const C1= -14.71
Const C2= 4.61


'Define Data Tables
DataTable (test_stand1,1,-1)
DataInterval (0,2,Min,10)
Minimum (1,batt_volt,IEEE4,0,False)
'Average (1,CR1000Temp,IEEE4,)
Average (1,AM25Temp,IEEE4,False)

Average (1,fan_speed_set,IEEE4,False)
Average (1,frequency_set_old,IEEE4,False)

Average (1,PambairkPa,IEEE4,False)
Average (1,RelativeHumidity,IEEE4,False)
Average (1,Tz,IEEE4,False)
Average (1,room_temp_NW,IEEE4,False)
Average (1,Tdew,IEEE4,False)
Average (1,SpecificHumidity,IEEE4,False)
' Average (1,Tglobe,IEEE4,False)

Average (1,Tx,IEEE4,False)
Average (1,ATdelTcondenser,IEEE4,False)

Average (1,RTcondin,IEEE4,False)
Average (1,RTpreLEV,IEEE4,False)
Average (1,RTpostLEV,IEEE4,False)

' Average (1,VFDpowerin,IEEE4,False)
Average (1,comp_power,IEEE4,False)
Average (1,fan_Power,IEEE4,False)

Average (1,GHI_South,IEEE4,False)
Average (1,GHI_West,IEEE4,False)
Average (1,Tsouth,IEEE4,False)
Average (1,Twest,IEEE4,False)

' Average (1,refrigerant_level,FP2,False)

Average (1,comp_voltage,IEEE4,False)
Average (1,comp_angle,IEEE4,False)


EndTable

DataTable (test_stand0,1,-1)
DataInterval (0,2,Min,10)

Average (1,PdisPSIG,IEEE4,False)
Average (1,PcondoutPSIG,IEEE4,False)
Average (1,PevapinPSIG,IEEE4,False)
Average (1,PsucPSIG,IEEE4,False)

Average (1,RTdischarge,IEEE4,False)
Average (1,RTcondout,IEEE4,False)
Average (1,RTsuction,IEEE4,False)

Average (1,RTHXin,IEEE4,False)
Average (1,RTHXout,IEEE4,False)

Average (1,CHWTin,IEEE4,False)
Average (1,CHWTout,IEEE4,False)

Average (1,Tsuperheat,IEEE4,False)
Average (1,Tsuperheatdis,IEEE4,False)
Average (1,Tsubcool,IEEE4,False)

Average (1,comp_current,IEEE4,False)

Average (1,ref_mass_flow,IEEE4,False)
Average (1,rpm_sensor,IEEE4,False)

EndTable

Sub actLEV(cntrlvarLEV)
Call LEVcontrol(cntrlvarLEV)
If i<>0 'for zero excitation when valve is fully closed or open
If LEVcorr>0'cntrlvar<cntrlvar_set 'open valve red light C2
del=ABS(LEVcorr)

'If del>LEVmax_pos*1000 Then 'for crash prevention (from NANs) not working
'Else
If del>3 '3msec is the delay of microcontroller
'WriteIO(&B00100000,&B00100000) 'C6
LEV_open=1
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
Delay (1,del,mSec)'LEVcorr is the amount of time excitation remains there
LEV_open=0
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
'WriteIO(&B00100000,&B00000000)

LEVpos=LEVpos+LEVcorr
EndIf
'EndIf
ElseIf LEVcorr<0'cntrlvar>cntrlvar_set 'close valve green light C3
del=ABS(LEVcorr)
'If del>LEVmax_pos*1000 Then
'Else
If del>3
'WriteIO(&B01000000,&B01000000) 'C7
LEV_close=1
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
Delay (1,del,mSec)'LEVcorr is the amount of time excitation remains there
LEV_close=0
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
'WriteIO(&B01000000,&B00000000)

LEVpos=LEVpos+LEVcorr
EndIf
'EndIf
EndIf
If LEVpos>LEVmax_pos
LEVpos=LEVmax_pos
ElseIf LEVpos<0
LEVpos=0 'can't be less than 0
EndIf
EndIf

EndSub

Sub LEVcontrol(cntrlvarLEV)
errvarLEV=cntrlvarLEV_set-cntrlvarLEV
If (ABS(cntrlvarLEV_set-cntrlvarLEV_set_old)+ABS(LEV_Kp-LEV_Kpold)+ABS(LEV_Ki-LEV_Kiold)+ABS(LEV_Kd-LEV_Kdold))>0 OR LEVpos>LEVmax_pos OR LEVpos<=0 Then
intgrlLEV=0 'Resset Intergal term if the setpoint or gains are changed or valve is at saturation
EndIf
LEVcorr_0=LEV_Kp*errvarLEV+LEV_Kp*(intgrlLEV+1/ct*errvarLEV)/LEV_Ki+LEV_Kp*LEV_Kd*(errvarLEV-errvarLEV_old)*ct 'control line
LEVcorr=Round(LEVcorr_0,0)
If (cntrlvarLEV_set<cntrlvarLEV AND LEVcorr>0) Then 'correct for incorrect valve operation and wrong correction (have encountered)
LEVcorr=-LEVcorr
ElseIf (cntrlvarLEV_set>cntrlvarLEV AND LEVcorr<0) Then
LEVcorr=LEVcorr
EndIf
'If (LEVcorr-LEV_pos) > LEVmax_del Then 'limit for positive extreme of pulses (correction that CR1000 can handle w/o skipping scans) depends on scan time (not needed for 1 sec)
' LEVcorr=LEVmax_pos+LEV_pos
'ElseIf (LEVcorr-LEV_pos) < -LEVmax_del Then 'limit for negative extreme of pulses
' LEVcorr =-LEVmax_pos+LEV_pos
'EndIf
'integral routine
If LEVcorr>LEVmax_pos Then 'for max time limit/valve position
LEVcorr=LEVmax_pos
If errvarLEV > 0 Then
intgrlLEV=intgrlLEV+errvarLEV*1/ct 's(k-1) integral summing
EndIf
ElseIf LEVcorr<-LEVmax_pos Then 'for max time limit/valve position
LEVcorr =-LEVmax_pos
If errvarLEV < 0 Then
intgrlLEV=intgrlLEV+errvarLEV*1/ct 's(k-1) integral summing
EndIf
Else
intgrlLEV=intgrlLEV+errvarLEV*1/ct 's(k-1) integral summing
EndIf
'LEVcorr_a=LEVcorr-LEV_pos
'refrigrant_level_set_old=refrigerant_level_set

errvarLEV_old=errvarLEV
cntrlvarLEV_set_old=cntrlvarLEV_set
LEV_Kpold=LEV_Kp
LEV_Kiold=LEV_Ki
LEV_Kdold=LEV_Kd
If (LEVpos>=LEVmax_pos AND LEVcorr>0) Then ' not to operate valve if already fully open or closed
LEVcorr=0
intgrlLEV=0
i=0
ElseIf (LEVpos<=0 AND LEVcorr<0) Then
LEVcorr=0
intgrlLEV=0
i=0
EndIf
EndSub

Sub Failsafe

If CHWTin<5 OR CHWTout<5 OR Tz<10 OR RTdischarge>85 OR Tsatdis>50 OR comp_current>=7 OR comp_current=Nan
frequency_set=0
VFD_control=0
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,9,1,3,10) 'change VFD operation status start (2)/stop(0 or 1)
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'change running VFD frequency
ModBusMaster(serialstat,Com3,19200,1,3,frequency_set_old,14,1,3,10) 'read running VFD frequency
failmode=1
delay_timer=Timer(3,Sec,2) 'reset and start delay_timer
delay_flag=1
EndIf
If RTsuction1<-2 AND timer_flag=0
suction_timer=Timer(1,Sec,2) 'reset and start suction_timer
timer_flag=1
EndIf
suction_timer=Timer(1,Sec,4)
If RTsuction1<-2 AND suction_timer>suction_timer_set 'if Tsuction remains at -2 for 1 minute
frequency_set=0
VFD_control=0
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,9,1,3,10) 'change VFD operation status start (2)/stop(0 or 1)
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'change running VFD frequency
ModBusMaster(serialstat,Com3,19200,1,3,frequency_set_old,14,1,3,10) 'read running VFD frequency
failmode=2
delay_timer=Timer(3,Sec,2) 'reset and start delay_timer
suction_timer=Timer(1,Sec,3) 'stop and reset suction_timer
timer_flag=0
ElseIf suction_timer>suction_timer_set
suction_timer=Timer(1,Sec,3) 'reset and stop suction_timer
timer_flag=0
EndIf
EndSub

'Main Program
BeginProg
'for LEV control with Tsuperheat
LEV_Kp=5
LEV_Kpold=LEV_Kp
LEV_Ki= 45
LEV_Kiold=LEV_Ki
LEV_Kd= 11.25
LEV_Kdold=LEV_Kd

'for speed control with Tz
speed_Kp=5000
speed_Kpold=speed_Kp
speed_Ki= 100000
speed_Kiold=speed_Ki
speed_Kd= 0
speed_Kdold=speed_Kd

'initialization
frequency_set=10000
frequency_set_old=frequency_set

fan_speed_set=1000

VFD_control=0
VFD_control_old=VFD_control

VFD_relay=0
VFD_relay_old=VFD_relay

cntrlvarLEV_set_old=cntrlvarLEV_set
cntrlvarspeed_set_old=cntrlvarspeed_set
f=63
rpm=0

SDMIO16(LEV_operation,sdmstat,0,89,0,0,0,0,0111,0) 'don't know why it doesn't work sometimes with 94 if restart cr1000

'initialization for controls
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,2,1,3,10) 'for resetting VFD .1msec delay
'SW12(1) '12V power for control circuit
'WriteIO(&B10000000,&B00000000) 'relay on (currently off)
'WriteIO(&B00100000,&B00100000) 'to bring the valve to its fully close position green light C4
LEV_close=1
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
Delay (1,3,Sec)'LEVcorr is the amount of time excitation remains there
LEV_close=0
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
'WriteIO(&B00100000,&B00000000)
'SDMIO16(LEV_close,sdmstat,0,89,9999,9999,9999,9990,1,0)
ModBusMaster(serialstat,Com3,19200,1,3,VFD_control_old,9,1,3,10) 'read VFD operation status
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'set VFD frequency = 0Hz

volt_signal(1)=0 '1rpm=2.857mV
SDMAO4(volt_signal(1),1,1)

Scan (ct,Sec,0,0)
AM25T (AM25Temp0,0,mV2_5,1,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0)

' Refrigerant pressures
VoltDiff (PdisPSIG,1,mV250C,5,True ,0,_50Hz,4.977,1.55) 'calibrated transducer number 3
VoltSe (PcondoutPSIG,1,mv5000,13,True,0,_50Hz,123.9e-3,-63.1) 'calibrated transducer number 5
VoltSe (PevapinPSIG,1,mv5000,14,True,0,_50Hz,124.7e-3,-63.83) 'calibrated transducer number 8
VoltDiff (PsucPSIG,1,mV250C,6,True ,0,_50Hz,4.945,-6.467) 'calibrated transducer number 1

' Refrigerant temperatures
'high side temperatures
AM25T (RTdischarge,1,mV2_5,1,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTcondout,1,mV2_5,3,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTsuction,1,mV2_5,8,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

AM25T (RTHXin,1,mV2_5,7,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTHXout,1,mV2_5,12,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'chilled water temperatures
AM25T (CHWTin,1,mV2_5,9,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (CHWTout,1,mV2_5,10,1,TypeT,AM25Temp0,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'to calculate superheat
Tsatsuc=C2*(LN(PsucPSIG+14.5))^2+C1*(LN(PsucPSIG+14.5))+C0
Tsuperheat=RTsuction-Tsatsuc

Tsatdis=C2*(LN(PdisPSIG+14.5))^2+C1*(LN(PdisPSIG+14.5))+C0
Tsuperheatdis=RTdischarge-Tsatdis

'to calculate subcooling
Tsatcond=C2*(LN(PcondoutPSIG+14.7))^2+C1*(LN(PcondoutPSIG+14.7))+C0
Tsubcool=Tsatcond-RTcondout

i=1
cntrlvarLEV=-Tsuperheat 'can make any variable control varaiable as long as error (set-actual) follows for > valve open for < valve close
'parameter s>a s<a actual increase actual decrease
'ref. level open close open close
'Tsubcool open close open close
'Tsuperheat close open close open (if multiply by -1 both set and actual then s>a open s<a close)
'Tsuperheatcond close open close open (if multiply by -1 both set and actual then s>a open s<a close)
'Q decrease increase speed decrease speed increase
cntrlvarLEV_set=-Tsuperheat_set

Call actLEV(cntrlvarLEV)

' mass flow rate
PulseCount (ref_mass_flow,1,2,0,1,3e-6,0) 'Refrigerant
'10000Hz=.03 kg/sec so for 1 Hz 3e-6

' rpm sensor
PulseCount(rpm_sensor,1,1,2,1,60,0)

'to prevent compressor stall and decrease compressor current
AM25T(comp_current,1,mv5000,18,1,-1,AM25Temp0,4,8,Vx1,False,0,_50Hz,.002,0)
Call Failsafe

CallTable test_stand0

PulseCountReset
NextScan

SlowSequence
Scan(dtt,Sec,0,0)

If VFD_relay<>VFD_relay_old
SDMIO16(LEV_operation,sdmstat,0,94,0,0,0,0,1,0)
VFD_relay_old=VFD_relay
EndIf

If frequency_set<>frequency_set_old
ModBusMaster(serialstat,Com3,19200,1,16,frequency_set,14,1,3,10) 'change running VFD frequency
ModBusMaster(serialstat,Com3,19200,1,3,frequency_set_old,14,1,3,10) 'read running VFD frequency
EndIf

volt_signal(1)=fan_speed_set*(2.857+.0857)+1.9 '1rpm=2.857mV
SDMAO4(volt_signal(1),1,1)

If VFD_control<>VFD_control_old
ModBusMaster(serialstat,Com3,19200,1,16,VFD_control,9,1,3,10) 'change VFD operation status start (2)/stop(0 or 1)
VFD_control_old=VFD_control
EndIf

'Panel Temperatures and references
AM25T (AM25Temp,0,mV2_5,1,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
'PanelTemp (CR1000Temp,_50Hz)
Battery (Batt_volt)

' Air pressure
VoltDiff (PambairkPa,1,mv5000,8,True,0,_50Hz,3.939e-3,-3.75)
'238 ohm, 4-20 mA output, 4760 mV = 15 psia, 952 mV = 0 psia
PambairkPa=PambairkPa*6.89476

'zone relative humidity
VoltSe (RelativeHumidity, 1,mv5000,3,True,0,_50Hz,0.032258,-25.80645)

'zone temperature
AM25T (room_temp_NW,1,mV2_5,13,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
' AM25T (Tglobe,1,mV2_5,14,1,TypeT,AM25Temp,4,6,Vx1,True ,0,_50Hz,1.0,0)
es=6.1121*EXP((18.678-room_temp_NW/234.5)*room_temp_NW/(257.14+room_temp_NW)) 'arden buck equation 1996
'Tdew1=(237.7*LOG10(es*RelativeHumidity/611))/(7.5-LOG10(es*RelativeHumidity/611))
SpecificHumidity=.62197*(es*RelativeHumidity/100)/(PambairkPa*10+(es*RelativeHumidity/100)*(.62197-1))
DewPoint(Tdew,room_temp_NW,RelativeHumidity)
If Tdew>room_temp_NW OR Tdew=NAN Then Tdew=room_temp_NW


' Air Temperature
AM25T (ATcondenserin,1,mV2_5,11,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)

' Scaling for thermopile measurement
AM25T (delta_mV,1,mV25C,16,1,-1,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0)
delta_mV = delta_mV/16 '16 thermopile junction pairs
Tref = ATcondenserin
'delta_mV = delta_mV*0.1 'to avoid exponents in equation of volt to temp conversion dTresult
'TdTref = TdTref*0.01
'mV_TdT = delta_mV*TdTref*0.001' for bringing it in Volts
dTresult = 25.89-5.749e-2*Tref-.7447*delta_mV+1.632e-4*Tref^2+5.557e-3*Tref*delta_mV+.4654*delta_mV^2-.4475e-6*Tref^3-2.107e-5*Tref^2*delta_mV-3.793e-4*Tref*delta_mV^2-2.188e-3*delta_mV^3 'volt to temp conversion
'dTresult = dTresult-5.749*TdTref+1.635*TdTref-0.4475*TdTref
'dTresult = dTresult+mV_TdT*5.557-2.107*mV_TdT*TdTref-3.793*mV_TdT*delta_mV
'delta_mV = delta_mV*10
ATdelTcondenser = dTresult*delta_mV
'TdTref = TdTref*100

' end of scaling for thermopile measurement

' Wattnode power
'PulseCount (VFDpowerin,1,1,0,1,34.506,0)
' WNB-3Y-400-P, Wh per pulse per CT rated Amp = 0.001917
' 59.7 ohm resistor installed = 5 Amps full scale
' WhpP = 0.0096
' Watts = WhpP*PulseCount/sec*3600 sec/hour
' W/Hz = WhpP*3600 sec/hour = 34.506 Watts

AM25T (RTcondin,1,mV2_5,2,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'low side temperatures
AM25T (RTpostLEV,1,mV2_5,6,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

'to see drier temperature drop implies pressure drop
'AM25T (RTdrierin,1,mV2_5,4,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered
AM25T (RTdrierout,1,mV2_5,5,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' soldered

VoltSe(GHI_South,1,mV25,4,True,0,_50Hz,-86.704,0) 'PY64287 1/(78.7e-3*146.55ohm)
VoltSe(GHI_West,1,mV25,5,True,0,_50Hz,-85.03,0) 'PY64288 1/(78.93e-3*149ohm)
AM25T (Tsouth,1,mV2_5,25,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) 'epoxied
AM25T (Twest,1,mV2_5,24,1,TypeT,AM25Temp,4,8,Vx1,True ,0,_50Hz,1.0,0) ' epoxied

' Measure refrigerant level
VoltSe (refrigerant_level,1,mv5000,6,True,0,_50Hz,16.67e-3,16.67)
'3321.15mV=100 level 1mV=.03006153596 level (not applicable)


GetVariables(log_result,ComRS232,0,2,0,0,"Public","room_temp()",room_temp(),19)
Tz=(room_temp(1)+room_temp(2)+room_temp(3)+room_temp(4)+room_temp(5)+room_temp(6)+room_temp(7)+room_temp(8)+room_temp(9)+room_temp(10)+room_temp(11)+room_temp(12)+room_temp(13)+room_temp(14)+room_temp(15)+room_temp(16)+room_temp(17)+room_temp(18)+room_temp(19)+room_temp_NW)/20
''''cntrlvarspeed=-Tz
''''cntrlvarspeed_set=-Tz_set

AM25T(comp_voltage,1,mv5000,17,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.06,0)
AM25T(comp_angle,1,mv5000,19,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.072,0)
AM25T(comp_power,1,mv5000,20,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,1.22,0)
AM25T(fan_power,1,mv5000,22,1,-1,AM25Temp,4,8,Vx1,False,0,_50Hz,.06,0)


CallTable test_stand1

NextScan
EndSequence

EndProg


Carolyn May 26, 2011 10:05 PM

Thanks for reporting this.

We found that the problem is due to an OS issue resulting from running the AM25T in the slow sequence in sequential mode. This worked OK until the slow sequence required more room than the main sequence. The issue will be resolved in the next release of the CR1000 OS.

Log in or register to post/reply in the forum.