NXC-VAI4 Analog card freezing for no reason
robinzzitto
Posts: 2
NXC-VAI4 Analog card freezing for no reason
Hi all,
I'm using the NI-2100 controller with the NXF-mini card frame and i'll post how i did the programing for AHU's
P.S: the thing is i calibrate the sensors depending on the reading values of the sensors,
but the problem is it works for a while and then it's hanging and i'm not able to have a correct reading at the same time i'm able to control the valve if i change the set point.
if someone can help to diagnose what is the problem i'll be thankful
please find below the program that i did on netlinx,
Thank you in advance,
DEFINE_DEVICE
dvVAI_AHU23_24_25_26 = 85:1:7 //VAI CARD IN SLOT 1 CARDFRAME
DEFINE_VARIABLE
//AHU 23
FLOAT AHU23_TEMP_VALUE
FLOAT AHU23_IN_SENSOR
FLOAT AHU23_OUT_CONTROL_SIGNAL
FLOAT AHU23_SET_POINT_TRACE = 22
//AHU 24
FLOAT AHU24_TEMP_VALUE
FLOAT AHU24_IN_SENSOR
FLOAT AHU24_OUT_CONTROL_SIGNAL
FLOAT AHU24_SET_POINT_TRACE = 22
//AHU 25
FLOAT AHU25_TEMP_VALUE
FLOAT AHU25_IN_SENSOR
FLOAT AHU25_OUT_CONTROL_SIGNAL
FLOAT AHU25_SET_POINT_TRACE = 22
//AHU 26
FLOAT AHU26_TEMP_VALUE
FLOAT AHU26_IN_SENSOR
FLOAT AHU26_OUT_CONTROL_SIGNAL
FLOAT AHU26_SET_POINT_TRACE = 22
DEFINE_EVENT
DATA_EVENT [dvVAI_AHU23_24_25_26] // AHU ANALOG CARD AHU 23 24 25 26
{
ONLINE:
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'LEVON'
//BELOW IS COMMANDS TO SET MINIMUM OF ALL OUTPUTS TO ONE VOLTS
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1N0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2N0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3N0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4N0'
//SETTING THE LEVEL AFTER STARTUP TO 127 of controlling the valve and 255 to sensor
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1U255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2U255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3U255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4U255'
//STTING THE MAXIMUM VALUE OF ALL OUTPUTS TO 10 VOLTS
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1X9'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2X9'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3X9'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4X9'
}
}
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 5] // AHU 23(ON OFF VALVE)
{
AHU23_IN_SENSOR = LeveL.VALUE
IF (AHU23_IN_SENSOR < 165) { AHU23_TEMP_VALUE = ((AHU23_IN_SENSOR)/10)-6 }
IF (AHU23_IN_SENSOR <= 168 && AHU23_IN_SENSOR >= 165) { AHU23_TEMP_VALUE = 16 }
IF (AHU23_IN_SENSOR <= 171 && AHU23_IN_SENSOR > 168) { AHU23_TEMP_VALUE = 17 }
IF (AHU23_IN_SENSOR <= 174 && AHU23_IN_SENSOR > 171) { AHU23_TEMP_VALUE = 18 }
IF (AHU23_IN_SENSOR <= 177 && AHU23_IN_SENSOR > 174) { AHU23_TEMP_VALUE = 19 }
IF (AHU23_IN_SENSOR <= 180 && AHU23_IN_SENSOR > 177) { AHU23_TEMP_VALUE = 20 }
IF (AHU23_IN_SENSOR <= 183 && AHU23_IN_SENSOR > 180) { AHU23_TEMP_VALUE = 21 }
IF (AHU23_IN_SENSOR <= 186 && AHU23_IN_SENSOR > 183) { AHU23_TEMP_VALUE = 22 }
IF (AHU23_IN_SENSOR <= 189 && AHU23_IN_SENSOR > 186) { AHU23_TEMP_VALUE = 23 }
IF (AHU23_IN_SENSOR <= 192 && AHU23_IN_SENSOR > 189) { AHU23_TEMP_VALUE = 24 }
IF (AHU23_IN_SENSOR <= 195 && AHU23_IN_SENSOR > 192) { AHU23_TEMP_VALUE = 25 }
IF (AHU23_IN_SENSOR <= 198 && AHU23_IN_SENSOR > 195) { AHU23_TEMP_VALUE = 26 }
IF (AHU23_IN_SENSOR <= 201 && AHU23_IN_SENSOR > 198) { AHU23_TEMP_VALUE = 27 }
IF (AHU23_IN_SENSOR > 201) { AHU23_TEMP_VALUE = ((AHU23_IN_SENSOR/10)+5) }
SEND_COMMAND dvNXD73,"'^TXT-2,0,',ITOA(AHU23_TEMP_VALUE),'C'"
IF (AHU23_SET_POINT_TRACE != AHU23_TEMP_VALUE)
{
IF (AHU23_SET_POINT_TRACE < AHU23_TEMP_VALUE +1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L255[T0]'
AHU23_OUT_CONTROL_SIGNAL = 255}
IF (AHU23_SET_POINT_TRACE > AHU23_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L0[T0]'
AHU23_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD73,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU23_SET_POINT_TRACE <= 29)
{
AHU23_SET_POINT_TRACE=AHU23_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD73,"'^TXT-1,0,',ITOA(AHU23_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD73,"'^TXT-2,0,',ITOA(AHU23_TEMP_VALUE),'C'"
}
IF (AHU23_SET_POINT_TRACE > AHU23_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L0[T0]'
AHU23_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD73,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU23_SET_POINT_TRACE >= 16)
{
AHU23_SET_POINT_TRACE=AHU23_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD73,"'^TXT-1,0,',ITOA(AHU23_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD73,"'^TXT-2,0,',ITOA(AHU23_TEMP_VALUE),'C'"
}
IF (AHU23_SET_POINT_TRACE < AHU23_TEMP_VALUE + 1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L255[T0]'
AHU23_OUT_CONTROL_SIGNAL = 255}
}
}
'
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 6] // AHU 24(ON OFF VALVE)
{
AHU24_IN_SENSOR = LeveL.VALUE
IF (AHU24_IN_SENSOR < 179) { AHU24_TEMP_VALUE = ((AHU24_IN_SENSOR)/10)-2 }
IF (AHU24_IN_SENSOR <= 181 && AHU24_IN_SENSOR >= 179) { AHU24_TEMP_VALUE = 16 }
IF (AHU24_IN_SENSOR <= 183 && AHU24_IN_SENSOR >= 181) { AHU24_TEMP_VALUE = 17 }
IF (AHU24_IN_SENSOR <= 185 && AHU24_IN_SENSOR > 183) { AHU24_TEMP_VALUE = 18 }
IF (AHU24_IN_SENSOR <= 187 && AHU24_IN_SENSOR > 185) { AHU24_TEMP_VALUE = 19 }
IF (AHU24_IN_SENSOR <= 189 && AHU24_IN_SENSOR > 187) { AHU24_TEMP_VALUE = 20 }
IF (AHU24_IN_SENSOR <= 191 && AHU24_IN_SENSOR > 189) { AHU24_TEMP_VALUE = 21 }
IF (AHU24_IN_SENSOR <= 193 && AHU24_IN_SENSOR > 191) { AHU24_TEMP_VALUE = 22 }
IF (AHU24_IN_SENSOR <= 195 && AHU24_IN_SENSOR > 193) { AHU24_TEMP_VALUE = 23 }
IF (AHU24_IN_SENSOR <= 197 && AHU24_IN_SENSOR > 195) { AHU24_TEMP_VALUE = 24 }
IF (AHU24_IN_SENSOR <= 199 && AHU24_IN_SENSOR > 197) { AHU24_TEMP_VALUE = 25 }
IF (AHU24_IN_SENSOR <= 201 && AHU24_IN_SENSOR > 199) { AHU24_TEMP_VALUE = 26 }
IF (AHU24_IN_SENSOR <= 203 && AHU24_IN_SENSOR > 201) { AHU24_TEMP_VALUE = 27 }
IF (AHU24_IN_SENSOR > 205) { AHU24_TEMP_VALUE = ((AHU24_IN_SENSOR/10)+8) }
SEND_COMMAND dvNXD72,"'^TXT-2,0,',ITOA(AHU24_TEMP_VALUE),'C'"
IF (AHU24_SET_POINT_TRACE != AHU24_TEMP_VALUE)
{
IF (AHU24_SET_POINT_TRACE < AHU24_TEMP_VALUE +1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255[T0]'
AHU24_OUT_CONTROL_SIGNAL = 255}
IF (AHU24_SET_POINT_TRACE > AHU24_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0[T0]'
AHU24_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD72,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU24_SET_POINT_TRACE <= 29)
{
AHU24_SET_POINT_TRACE=AHU24_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD72,"'^TXT-1,0,',ITOA(AHU24_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD72,"'^TXT-2,0,',ITOA(AHU24_TEMP_VALUE),'C'"
}
IF (AHU24_SET_POINT_TRACE > AHU24_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0[T0]'
AHU24_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD72,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU24_SET_POINT_TRACE >= 16)
{
AHU24_SET_POINT_TRACE=AHU24_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD72,"'^TXT-1,0,',ITOA(AHU24_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD72,"'^TXT-2,0,',ITOA(AHU24_TEMP_VALUE),'C'"
}
IF (AHU24_SET_POINT_TRACE < AHU24_TEMP_VALUE + 1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255[T0]'
AHU24_OUT_CONTROL_SIGNAL = 255}
}
}
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 7] // AHU 25(ON OFF VALVE)
{
AHU25_IN_SENSOR = LeveL.VALUE
IF (AHU25_IN_SENSOR < 183) { AHU25_TEMP_VALUE = ((AHU25_IN_SENSOR)/10)-6 }
IF (AHU25_IN_SENSOR <= 184 && AHU25_IN_SENSOR >= 183){ AHU25_TEMP_VALUE = 16 }
IF (AHU25_IN_SENSOR <= 185 && AHU25_IN_SENSOR > 184) { AHU25_TEMP_VALUE = 17 }
IF (AHU25_IN_SENSOR <= 186 && AHU25_IN_SENSOR > 185) { AHU25_TEMP_VALUE = 18 }
IF (AHU25_IN_SENSOR <= 187 && AHU25_IN_SENSOR > 186) { AHU25_TEMP_VALUE = 19 }
IF (AHU25_IN_SENSOR <= 188 && AHU25_IN_SENSOR > 187) { AHU25_TEMP_VALUE = 20 }
IF (AHU25_IN_SENSOR <= 189 && AHU25_IN_SENSOR > 188) { AHU25_TEMP_VALUE = 21 }
IF (AHU25_IN_SENSOR <= 190 && AHU25_IN_SENSOR > 189) { AHU25_TEMP_VALUE = 22 }
IF (AHU25_IN_SENSOR <= 191 && AHU25_IN_SENSOR > 190) { AHU25_TEMP_VALUE = 23 }
IF (AHU25_IN_SENSOR <= 192 && AHU25_IN_SENSOR > 191) { AHU25_TEMP_VALUE = 24 }
IF (AHU25_IN_SENSOR <= 193 && AHU25_IN_SENSOR > 192) { AHU25_TEMP_VALUE = 25 }
IF (AHU25_IN_SENSOR <= 194 && AHU25_IN_SENSOR > 193) { AHU25_TEMP_VALUE = 26 }
IF (AHU25_IN_SENSOR <= 195 && AHU25_IN_SENSOR > 194) { AHU25_TEMP_VALUE = 27 }
IF (AHU25_IN_SENSOR > 195) { AHU25_TEMP_VALUE = ((AHU25_IN_SENSOR/10)+4) }
SEND_COMMAND dvNXD78,"'^TXT-2,0,',ITOA(AHU25_TEMP_VALUE),'C'"
IF (AHU25_SET_POINT_TRACE != AHU25_TEMP_VALUE)
{
IF (AHU25_SET_POINT_TRACE < AHU25_TEMP_VALUE +1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L255[T0]'
AHU25_OUT_CONTROL_SIGNAL = 255}
IF (AHU25_SET_POINT_TRACE > AHU25_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L0[T0]'
AHU25_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD78,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU25_SET_POINT_TRACE <= 29)
{
AHU25_SET_POINT_TRACE=AHU25_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD78,"'^TXT-1,0,',ITOA(AHU25_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD78,"'^TXT-2,0,',ITOA(AHU25_TEMP_VALUE),'C'"
}
IF (AHU25_SET_POINT_TRACE > AHU25_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L0[T0]'
AHU25_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD78,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU25_SET_POINT_TRACE >= 16)
{
AHU25_SET_POINT_TRACE=AHU25_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD78,"'^TXT-1,0,',ITOA(AHU25_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD78,"'^TXT-2,0,',ITOA(AHU25_TEMP_VALUE),'C'"
}
IF (AHU25_SET_POINT_TRACE < AHU25_TEMP_VALUE + 1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L255[T0]'
AHU25_OUT_CONTROL_SIGNAL = 255}
}
}
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 8] // AHU 26 (MODULATING VALVE)
{
AHU26_IN_SENSOR = LeveL.VALUE
IF (AHU26_IN_SENSOR < 160) { AHU26_TEMP_VALUE = ((AHU26_IN_SENSOR)/10)-1 }
IF (AHU26_IN_SENSOR <= 167 && AHU26_IN_SENSOR > 160) { AHU26_TEMP_VALUE = 16 }
IF (AHU26_IN_SENSOR <= 174 && AHU26_IN_SENSOR > 167) { AHU26_TEMP_VALUE = 17 }
IF (AHU26_IN_SENSOR <= 181 && AHU26_IN_SENSOR > 174) { AHU26_TEMP_VALUE = 18 }
IF (AHU26_IN_SENSOR <= 188 && AHU26_IN_SENSOR > 181) { AHU26_TEMP_VALUE = 19 }
IF (AHU26_IN_SENSOR <= 195 && AHU26_IN_SENSOR > 188) { AHU26_TEMP_VALUE = 20 }
IF (AHU26_IN_SENSOR <= 202 && AHU26_IN_SENSOR > 195) { AHU26_TEMP_VALUE = 21 }
IF (AHU26_IN_SENSOR <= 209 && AHU26_IN_SENSOR > 202) { AHU26_TEMP_VALUE = 22 }
IF (AHU26_IN_SENSOR <= 216 && AHU26_IN_SENSOR > 209) { AHU26_TEMP_VALUE = 23 }
IF (AHU26_IN_SENSOR <= 223 && AHU26_IN_SENSOR > 216) { AHU26_TEMP_VALUE = 24 }
IF (AHU26_IN_SENSOR <= 230 && AHU26_IN_SENSOR > 223) { AHU26_TEMP_VALUE = 25 }
IF (AHU26_IN_SENSOR <= 237 && AHU26_IN_SENSOR > 230) { AHU26_TEMP_VALUE = 26 }
IF (AHU26_IN_SENSOR <= 244 && AHU26_IN_SENSOR > 237) { AHU26_TEMP_VALUE = 27 }
IF (AHU26_IN_SENSOR >= 244) { AHU26_TEMP_VALUE = ((AHU26_IN_SENSOR/10) +3) }
SEND_COMMAND dvNXD75,"'^TXT-2,0,',ITOA(AHU26_TEMP_VALUE),'C'"
IF (AHU26_SET_POINT_TRACE < AHU26_TEMP_VALUE)
{
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L255[T0]'
AHU26_OUT_CONTROL_SIGNAL = 255
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 3 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) < 4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L170[T0]'
AHU26_OUT_CONTROL_SIGNAL = 170
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=2 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) < 3 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L130[T0]'
AHU26_OUT_CONTROL_SIGNAL = 130
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=1 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) < 2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L90[T0]'
AHU26_OUT_CONTROL_SIGNAL = 90
}
}
ELSE
{
IF (AHU26_TEMP_VALUE < AHU26_SET_POINT_TRACE)
{
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L0[T0]'
AHU26_OUT_CONTROL_SIGNAL = 0
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 3 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L20[T0]'
AHU26_OUT_CONTROL_SIGNAL = 20
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 2 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L30[T0]'
AHU26_OUT_CONTROL_SIGNAL = 30
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 1 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L50[T0]'
AHU26_OUT_CONTROL_SIGNAL = 50
}
}
}
}
BUTTON_EVENT [dvNXD75,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU26_SET_POINT_TRACE >= 16)
{ AHU26_SET_POINT_TRACE=AHU26_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD75,"'^TXT-1,0,',ITOA( AHU26_SET_POINT_TRACE ),'C'"
}
IF (AHU26_SET_POINT_TRACE < AHU26_TEMP_VALUE)
{
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L255[T0]'
AHU26_OUT_CONTROL_SIGNAL = 255
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 3 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L170[T0]'
AHU26_OUT_CONTROL_SIGNAL = 170
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=2 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L130[T0]'
AHU26_OUT_CONTROL_SIGNAL = 130
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=1 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L90[T0]'
AHU26_OUT_CONTROL_SIGNAL = 90
}
}
ELSE
{
IF (AHU26_TEMP_VALUE < AHU26_SET_POINT_TRACE)
{
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L0[T0]'
AHU26_OUT_CONTROL_SIGNAL = 0
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 3 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L20[T0]'
AHU26_OUT_CONTROL_SIGNAL = 20
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 2 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L30[T0]'
AHU26_OUT_CONTROL_SIGNAL = 30
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 1 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L50[T0]'
AHU26_OUT_CONTROL_SIGNAL = 50
}
}
}
}
}
BUTTON_EVENT [dvNXD75,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU26_SET_POINT_TRACE <= 29)
{ AHU26_SET_POINT_TRACE=AHU26_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD75,"'^TXT-1,0,',ITOA( AHU26_SET_POINT_TRACE ),'C'"
}
IF (AHU26_SET_POINT_TRACE < AHU26_TEMP_VALUE)
{
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L255[T0]'
AHU26_OUT_CONTROL_SIGNAL = 255
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 3 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L170[T0]'
AHU26_OUT_CONTROL_SIGNAL = 170
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=2 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L130[T0]'
AHU26_OUT_CONTROL_SIGNAL = 130
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=1 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <2)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L90[T0]'
AHU26_OUT_CONTROL_SIGNAL = 90
}
}
ELSE
{
IF (AHU26_TEMP_VALUE < AHU26_SET_POINT_TRACE)
{
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L0[T0]'
AHU26_OUT_CONTROL_SIGNAL = 0
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 3 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L20[T0]'
AHU26_OUT_CONTROL_SIGNAL = 20
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 2 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L30[T0]'
AHU26_OUT_CONTROL_SIGNAL = 30
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 1 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <2)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L50[T0]'
AHU26_OUT_CONTROL_SIGNAL = 50
}
}
}
}
}
Hi all,
I'm using the NI-2100 controller with the NXF-mini card frame and i'll post how i did the programing for AHU's
P.S: the thing is i calibrate the sensors depending on the reading values of the sensors,
but the problem is it works for a while and then it's hanging and i'm not able to have a correct reading at the same time i'm able to control the valve if i change the set point.
if someone can help to diagnose what is the problem i'll be thankful
please find below the program that i did on netlinx,
Thank you in advance,
DEFINE_DEVICE
dvVAI_AHU23_24_25_26 = 85:1:7 //VAI CARD IN SLOT 1 CARDFRAME
DEFINE_VARIABLE
//AHU 23
FLOAT AHU23_TEMP_VALUE
FLOAT AHU23_IN_SENSOR
FLOAT AHU23_OUT_CONTROL_SIGNAL
FLOAT AHU23_SET_POINT_TRACE = 22
//AHU 24
FLOAT AHU24_TEMP_VALUE
FLOAT AHU24_IN_SENSOR
FLOAT AHU24_OUT_CONTROL_SIGNAL
FLOAT AHU24_SET_POINT_TRACE = 22
//AHU 25
FLOAT AHU25_TEMP_VALUE
FLOAT AHU25_IN_SENSOR
FLOAT AHU25_OUT_CONTROL_SIGNAL
FLOAT AHU25_SET_POINT_TRACE = 22
//AHU 26
FLOAT AHU26_TEMP_VALUE
FLOAT AHU26_IN_SENSOR
FLOAT AHU26_OUT_CONTROL_SIGNAL
FLOAT AHU26_SET_POINT_TRACE = 22
DEFINE_EVENT
DATA_EVENT [dvVAI_AHU23_24_25_26] // AHU ANALOG CARD AHU 23 24 25 26
{
ONLINE:
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'LEVON'
//BELOW IS COMMANDS TO SET MINIMUM OF ALL OUTPUTS TO ONE VOLTS
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1N0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2N0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3N0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4N0'
//SETTING THE LEVEL AFTER STARTUP TO 127 of controlling the valve and 255 to sensor
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1U255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2U255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3U255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4U255'
//STTING THE MAXIMUM VALUE OF ALL OUTPUTS TO 10 VOLTS
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1X9'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2X9'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3X9'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4X9'
}
}
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 5] // AHU 23(ON OFF VALVE)
{
AHU23_IN_SENSOR = LeveL.VALUE
IF (AHU23_IN_SENSOR < 165) { AHU23_TEMP_VALUE = ((AHU23_IN_SENSOR)/10)-6 }
IF (AHU23_IN_SENSOR <= 168 && AHU23_IN_SENSOR >= 165) { AHU23_TEMP_VALUE = 16 }
IF (AHU23_IN_SENSOR <= 171 && AHU23_IN_SENSOR > 168) { AHU23_TEMP_VALUE = 17 }
IF (AHU23_IN_SENSOR <= 174 && AHU23_IN_SENSOR > 171) { AHU23_TEMP_VALUE = 18 }
IF (AHU23_IN_SENSOR <= 177 && AHU23_IN_SENSOR > 174) { AHU23_TEMP_VALUE = 19 }
IF (AHU23_IN_SENSOR <= 180 && AHU23_IN_SENSOR > 177) { AHU23_TEMP_VALUE = 20 }
IF (AHU23_IN_SENSOR <= 183 && AHU23_IN_SENSOR > 180) { AHU23_TEMP_VALUE = 21 }
IF (AHU23_IN_SENSOR <= 186 && AHU23_IN_SENSOR > 183) { AHU23_TEMP_VALUE = 22 }
IF (AHU23_IN_SENSOR <= 189 && AHU23_IN_SENSOR > 186) { AHU23_TEMP_VALUE = 23 }
IF (AHU23_IN_SENSOR <= 192 && AHU23_IN_SENSOR > 189) { AHU23_TEMP_VALUE = 24 }
IF (AHU23_IN_SENSOR <= 195 && AHU23_IN_SENSOR > 192) { AHU23_TEMP_VALUE = 25 }
IF (AHU23_IN_SENSOR <= 198 && AHU23_IN_SENSOR > 195) { AHU23_TEMP_VALUE = 26 }
IF (AHU23_IN_SENSOR <= 201 && AHU23_IN_SENSOR > 198) { AHU23_TEMP_VALUE = 27 }
IF (AHU23_IN_SENSOR > 201) { AHU23_TEMP_VALUE = ((AHU23_IN_SENSOR/10)+5) }
SEND_COMMAND dvNXD73,"'^TXT-2,0,',ITOA(AHU23_TEMP_VALUE),'C'"
IF (AHU23_SET_POINT_TRACE != AHU23_TEMP_VALUE)
{
IF (AHU23_SET_POINT_TRACE < AHU23_TEMP_VALUE +1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L255[T0]'
AHU23_OUT_CONTROL_SIGNAL = 255}
IF (AHU23_SET_POINT_TRACE > AHU23_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L0[T0]'
AHU23_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD73,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU23_SET_POINT_TRACE <= 29)
{
AHU23_SET_POINT_TRACE=AHU23_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD73,"'^TXT-1,0,',ITOA(AHU23_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD73,"'^TXT-2,0,',ITOA(AHU23_TEMP_VALUE),'C'"
}
IF (AHU23_SET_POINT_TRACE > AHU23_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L0[T0]'
AHU23_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD73,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU23_SET_POINT_TRACE >= 16)
{
AHU23_SET_POINT_TRACE=AHU23_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD73,"'^TXT-1,0,',ITOA(AHU23_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD73,"'^TXT-2,0,',ITOA(AHU23_TEMP_VALUE),'C'"
}
IF (AHU23_SET_POINT_TRACE < AHU23_TEMP_VALUE + 1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P1L255[T0]'
AHU23_OUT_CONTROL_SIGNAL = 255}
}
}
'
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 6] // AHU 24(ON OFF VALVE)
{
AHU24_IN_SENSOR = LeveL.VALUE
IF (AHU24_IN_SENSOR < 179) { AHU24_TEMP_VALUE = ((AHU24_IN_SENSOR)/10)-2 }
IF (AHU24_IN_SENSOR <= 181 && AHU24_IN_SENSOR >= 179) { AHU24_TEMP_VALUE = 16 }
IF (AHU24_IN_SENSOR <= 183 && AHU24_IN_SENSOR >= 181) { AHU24_TEMP_VALUE = 17 }
IF (AHU24_IN_SENSOR <= 185 && AHU24_IN_SENSOR > 183) { AHU24_TEMP_VALUE = 18 }
IF (AHU24_IN_SENSOR <= 187 && AHU24_IN_SENSOR > 185) { AHU24_TEMP_VALUE = 19 }
IF (AHU24_IN_SENSOR <= 189 && AHU24_IN_SENSOR > 187) { AHU24_TEMP_VALUE = 20 }
IF (AHU24_IN_SENSOR <= 191 && AHU24_IN_SENSOR > 189) { AHU24_TEMP_VALUE = 21 }
IF (AHU24_IN_SENSOR <= 193 && AHU24_IN_SENSOR > 191) { AHU24_TEMP_VALUE = 22 }
IF (AHU24_IN_SENSOR <= 195 && AHU24_IN_SENSOR > 193) { AHU24_TEMP_VALUE = 23 }
IF (AHU24_IN_SENSOR <= 197 && AHU24_IN_SENSOR > 195) { AHU24_TEMP_VALUE = 24 }
IF (AHU24_IN_SENSOR <= 199 && AHU24_IN_SENSOR > 197) { AHU24_TEMP_VALUE = 25 }
IF (AHU24_IN_SENSOR <= 201 && AHU24_IN_SENSOR > 199) { AHU24_TEMP_VALUE = 26 }
IF (AHU24_IN_SENSOR <= 203 && AHU24_IN_SENSOR > 201) { AHU24_TEMP_VALUE = 27 }
IF (AHU24_IN_SENSOR > 205) { AHU24_TEMP_VALUE = ((AHU24_IN_SENSOR/10)+8) }
SEND_COMMAND dvNXD72,"'^TXT-2,0,',ITOA(AHU24_TEMP_VALUE),'C'"
IF (AHU24_SET_POINT_TRACE != AHU24_TEMP_VALUE)
{
IF (AHU24_SET_POINT_TRACE < AHU24_TEMP_VALUE +1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255[T0]'
AHU24_OUT_CONTROL_SIGNAL = 255}
IF (AHU24_SET_POINT_TRACE > AHU24_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0[T0]'
AHU24_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD72,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU24_SET_POINT_TRACE <= 29)
{
AHU24_SET_POINT_TRACE=AHU24_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD72,"'^TXT-1,0,',ITOA(AHU24_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD72,"'^TXT-2,0,',ITOA(AHU24_TEMP_VALUE),'C'"
}
IF (AHU24_SET_POINT_TRACE > AHU24_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0[T0]'
AHU24_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD72,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU24_SET_POINT_TRACE >= 16)
{
AHU24_SET_POINT_TRACE=AHU24_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD72,"'^TXT-1,0,',ITOA(AHU24_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD72,"'^TXT-2,0,',ITOA(AHU24_TEMP_VALUE),'C'"
}
IF (AHU24_SET_POINT_TRACE < AHU24_TEMP_VALUE + 1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255[T0]'
AHU24_OUT_CONTROL_SIGNAL = 255}
}
}
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 7] // AHU 25(ON OFF VALVE)
{
AHU25_IN_SENSOR = LeveL.VALUE
IF (AHU25_IN_SENSOR < 183) { AHU25_TEMP_VALUE = ((AHU25_IN_SENSOR)/10)-6 }
IF (AHU25_IN_SENSOR <= 184 && AHU25_IN_SENSOR >= 183){ AHU25_TEMP_VALUE = 16 }
IF (AHU25_IN_SENSOR <= 185 && AHU25_IN_SENSOR > 184) { AHU25_TEMP_VALUE = 17 }
IF (AHU25_IN_SENSOR <= 186 && AHU25_IN_SENSOR > 185) { AHU25_TEMP_VALUE = 18 }
IF (AHU25_IN_SENSOR <= 187 && AHU25_IN_SENSOR > 186) { AHU25_TEMP_VALUE = 19 }
IF (AHU25_IN_SENSOR <= 188 && AHU25_IN_SENSOR > 187) { AHU25_TEMP_VALUE = 20 }
IF (AHU25_IN_SENSOR <= 189 && AHU25_IN_SENSOR > 188) { AHU25_TEMP_VALUE = 21 }
IF (AHU25_IN_SENSOR <= 190 && AHU25_IN_SENSOR > 189) { AHU25_TEMP_VALUE = 22 }
IF (AHU25_IN_SENSOR <= 191 && AHU25_IN_SENSOR > 190) { AHU25_TEMP_VALUE = 23 }
IF (AHU25_IN_SENSOR <= 192 && AHU25_IN_SENSOR > 191) { AHU25_TEMP_VALUE = 24 }
IF (AHU25_IN_SENSOR <= 193 && AHU25_IN_SENSOR > 192) { AHU25_TEMP_VALUE = 25 }
IF (AHU25_IN_SENSOR <= 194 && AHU25_IN_SENSOR > 193) { AHU25_TEMP_VALUE = 26 }
IF (AHU25_IN_SENSOR <= 195 && AHU25_IN_SENSOR > 194) { AHU25_TEMP_VALUE = 27 }
IF (AHU25_IN_SENSOR > 195) { AHU25_TEMP_VALUE = ((AHU25_IN_SENSOR/10)+4) }
SEND_COMMAND dvNXD78,"'^TXT-2,0,',ITOA(AHU25_TEMP_VALUE),'C'"
IF (AHU25_SET_POINT_TRACE != AHU25_TEMP_VALUE)
{
IF (AHU25_SET_POINT_TRACE < AHU25_TEMP_VALUE +1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L255[T0]'
AHU25_OUT_CONTROL_SIGNAL = 255}
IF (AHU25_SET_POINT_TRACE > AHU25_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L0[T0]'
AHU25_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD78,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU25_SET_POINT_TRACE <= 29)
{
AHU25_SET_POINT_TRACE=AHU25_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD78,"'^TXT-1,0,',ITOA(AHU25_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD78,"'^TXT-2,0,',ITOA(AHU25_TEMP_VALUE),'C'"
}
IF (AHU25_SET_POINT_TRACE > AHU25_TEMP_VALUE -1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L0[T0]'
AHU25_OUT_CONTROL_SIGNAL = 0}
}
}
BUTTON_EVENT [dvNXD78,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU25_SET_POINT_TRACE >= 16)
{
AHU25_SET_POINT_TRACE=AHU25_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD78,"'^TXT-1,0,',ITOA(AHU25_SET_POINT_TRACE),'C'"
SEND_COMMAND dvNXD78,"'^TXT-2,0,',ITOA(AHU25_TEMP_VALUE),'C'"
}
IF (AHU25_SET_POINT_TRACE < AHU25_TEMP_VALUE + 1)
{ SEND_COMMAND dvVAI_AHU23_24_25_26, 'P3L255[T0]'
AHU25_OUT_CONTROL_SIGNAL = 255}
}
}
LEVEL_EVENT [dvVAI_AHU23_24_25_26, 8] // AHU 26 (MODULATING VALVE)
{
AHU26_IN_SENSOR = LeveL.VALUE
IF (AHU26_IN_SENSOR < 160) { AHU26_TEMP_VALUE = ((AHU26_IN_SENSOR)/10)-1 }
IF (AHU26_IN_SENSOR <= 167 && AHU26_IN_SENSOR > 160) { AHU26_TEMP_VALUE = 16 }
IF (AHU26_IN_SENSOR <= 174 && AHU26_IN_SENSOR > 167) { AHU26_TEMP_VALUE = 17 }
IF (AHU26_IN_SENSOR <= 181 && AHU26_IN_SENSOR > 174) { AHU26_TEMP_VALUE = 18 }
IF (AHU26_IN_SENSOR <= 188 && AHU26_IN_SENSOR > 181) { AHU26_TEMP_VALUE = 19 }
IF (AHU26_IN_SENSOR <= 195 && AHU26_IN_SENSOR > 188) { AHU26_TEMP_VALUE = 20 }
IF (AHU26_IN_SENSOR <= 202 && AHU26_IN_SENSOR > 195) { AHU26_TEMP_VALUE = 21 }
IF (AHU26_IN_SENSOR <= 209 && AHU26_IN_SENSOR > 202) { AHU26_TEMP_VALUE = 22 }
IF (AHU26_IN_SENSOR <= 216 && AHU26_IN_SENSOR > 209) { AHU26_TEMP_VALUE = 23 }
IF (AHU26_IN_SENSOR <= 223 && AHU26_IN_SENSOR > 216) { AHU26_TEMP_VALUE = 24 }
IF (AHU26_IN_SENSOR <= 230 && AHU26_IN_SENSOR > 223) { AHU26_TEMP_VALUE = 25 }
IF (AHU26_IN_SENSOR <= 237 && AHU26_IN_SENSOR > 230) { AHU26_TEMP_VALUE = 26 }
IF (AHU26_IN_SENSOR <= 244 && AHU26_IN_SENSOR > 237) { AHU26_TEMP_VALUE = 27 }
IF (AHU26_IN_SENSOR >= 244) { AHU26_TEMP_VALUE = ((AHU26_IN_SENSOR/10) +3) }
SEND_COMMAND dvNXD75,"'^TXT-2,0,',ITOA(AHU26_TEMP_VALUE),'C'"
IF (AHU26_SET_POINT_TRACE < AHU26_TEMP_VALUE)
{
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L255[T0]'
AHU26_OUT_CONTROL_SIGNAL = 255
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 3 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) < 4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L170[T0]'
AHU26_OUT_CONTROL_SIGNAL = 170
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=2 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) < 3 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L130[T0]'
AHU26_OUT_CONTROL_SIGNAL = 130
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=1 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) < 2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L90[T0]'
AHU26_OUT_CONTROL_SIGNAL = 90
}
}
ELSE
{
IF (AHU26_TEMP_VALUE < AHU26_SET_POINT_TRACE)
{
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L0[T0]'
AHU26_OUT_CONTROL_SIGNAL = 0
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 3 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L20[T0]'
AHU26_OUT_CONTROL_SIGNAL = 20
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 2 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L30[T0]'
AHU26_OUT_CONTROL_SIGNAL = 30
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 1 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L50[T0]'
AHU26_OUT_CONTROL_SIGNAL = 50
}
}
}
}
BUTTON_EVENT [dvNXD75,12] //DECREASE SET POINT
{
PUSH:
{
IF (AHU26_SET_POINT_TRACE >= 16)
{ AHU26_SET_POINT_TRACE=AHU26_SET_POINT_TRACE - 1
SEND_COMMAND dvNXD75,"'^TXT-1,0,',ITOA( AHU26_SET_POINT_TRACE ),'C'"
}
IF (AHU26_SET_POINT_TRACE < AHU26_TEMP_VALUE)
{
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L255[T0]'
AHU26_OUT_CONTROL_SIGNAL = 255
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 3 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L170[T0]'
AHU26_OUT_CONTROL_SIGNAL = 170
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=2 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L130[T0]'
AHU26_OUT_CONTROL_SIGNAL = 130
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=1 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L90[T0]'
AHU26_OUT_CONTROL_SIGNAL = 90
}
}
ELSE
{
IF (AHU26_TEMP_VALUE < AHU26_SET_POINT_TRACE)
{
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L0[T0]'
AHU26_OUT_CONTROL_SIGNAL = 0
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 3 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L20[T0]'
AHU26_OUT_CONTROL_SIGNAL = 20
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 2 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L30[T0]'
AHU26_OUT_CONTROL_SIGNAL = 30
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 1 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <2 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L50[T0]'
AHU26_OUT_CONTROL_SIGNAL = 50
}
}
}
}
}
BUTTON_EVENT [dvNXD75,13] //INCREASE SET POINT
{
PUSH:
{
IF (AHU26_SET_POINT_TRACE <= 29)
{ AHU26_SET_POINT_TRACE=AHU26_SET_POINT_TRACE + 1
SEND_COMMAND dvNXD75,"'^TXT-1,0,',ITOA( AHU26_SET_POINT_TRACE ),'C'"
}
IF (AHU26_SET_POINT_TRACE < AHU26_TEMP_VALUE)
{
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L255[T0]'
AHU26_OUT_CONTROL_SIGNAL = 255
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >= 3 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L170[T0]'
AHU26_OUT_CONTROL_SIGNAL = 170
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=2 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L130[T0]'
AHU26_OUT_CONTROL_SIGNAL = 130
}
IF ((AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) >=1 && (AHU26_TEMP_VALUE - AHU26_SET_POINT_TRACE) <2)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L90[T0]'
AHU26_OUT_CONTROL_SIGNAL = 90
}
}
ELSE
{
IF (AHU26_TEMP_VALUE < AHU26_SET_POINT_TRACE)
{
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 4)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L0[T0]'
AHU26_OUT_CONTROL_SIGNAL = 0
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 3 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <4 )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L20[T0]'
AHU26_OUT_CONTROL_SIGNAL = 20
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 2 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) )
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L30[T0]'
AHU26_OUT_CONTROL_SIGNAL = 30
}
IF ((AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) >= 1 && (AHU26_SET_POINT_TRACE - AHU26_TEMP_VALUE) <2)
{
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P4L50[T0]'
AHU26_OUT_CONTROL_SIGNAL = 50
}
}
}
}
}
0
Comments
2. Please use [noparse] [/noparse] tags to wrap code so that the formatting gets better preserved and gets displayed using a monospace font because that code is very hard to read with the current formatting.
3. Please for the love of $DEITY, in the future do not post your question four multiple times across multiple subforums. It will not get your question answered faster. It will not insure that more people see your question. It just makes a mess all over the forum and makes people angry. Thank you.
4. Please REALLY do not hijack other unrelated threads on completely unrelated subforums to post even more copies of your question. Especially the freaking sticky threads. That's just plain rude.
thanks in advance
1) The send commands you are using:
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255[T0]'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0[T0]'
Should either be:
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255T0'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0T0'
or:
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L255'
SEND_COMMAND dvVAI_AHU23_24_25_26, 'P2L0'
The brackets were in the documentation to indicate that the 'T' value is optional, but the brackets themselves should not be sent to the device.
2) The value transitions of your LEVEL_EVENT [dvVAI_AHU23_24_25_26, 5] logic has some very odd jumps in it:
IF (AHU23_IN_SENSOR < 165) { AHU23_TEMP_VALUE = ((AHU23_IN_SENSOR)/10)-6 }
=== If the sensor is at 164, then AHU23_TEMP_VALUE is 10
IF (AHU23_IN_SENSOR <= 168 && AHU23_IN_SENSOR >= 165) { AHU23_TEMP_VALUE = 16 }
=== If the sensor is at 165, then AHU23_TEMP_VALUE is 16
...(other cases in order)...
IF (AHU23_IN_SENSOR <= 201 && AHU23_IN_SENSOR > 198) { AHU23_TEMP_VALUE = 27 }
=== If the sensor is at 200, then AHU23_TEMP_VALUE is 27
IF (AHU23_IN_SENSOR > 201) { AHU23_TEMP_VALUE = ((AHU23_IN_SENSOR/10)+5) }
=== If the sensor is at 201, then AHU23_TEMP_VALUE is 25
You may have intended it this way, I don't know, but the other conditional statements later in LEVEL_EVENT [dvVAI_AHU23_24_25_26, 6] have a smooth value map.