basic program

hello, i’m doing a test bench on the T3-nano and i’m having a little trouble writing these program lines.
I ask that the boiler D01 (on / off) turn on when the temperature probe AI6 is lower than the maximum temperature of one of these two probes AI4 and AI5

Fandu’s note there about the user manual is a good one, there is a simple on-off example in there. You can also access the help system by hitting the F1 function key.

Here’s a program example for your sequence:

10 VAR1 = MAX ( AI1 , AI2 )
20 IF AI6 < VAR1 THEN START OUT1
30 IF AI6 > VAR1 + 1 THEN STOP OUT1

The “+ 1” offset in line 30 just stops the boiler from short cycling when the temperatures are close.

I left all the items with no user names yet but VAR1 can be assigned a name here. Same goes for the inputs and outputs, once the names are assigned the program will be easier to read:

Hello, thank you for your help. yes I program the three lines of programs and I have a little problem with the out1. out1 closes and opens systematically.

You can debug programs by setting variables, inputs and outputs to manual mode and adjusting the values.

image

I STILL CAN’T SOLVE THE PROBLEM OF JUMPING OUT.

I am not fully following your question but the program looks pretty good. The program flows from the top to the bottom with no confusing gotos and gosubs which is good.

There’s one small improvement you can do which is to add a little hysteresis:
20 IF IECS > VAR10 THEN START OECS
30 IF IECS < VAR10 - 1 THEN STOP OECS

Line 51 looks suspicious because the PID1 will not go below 0. Change it from this
51 IF PID1 < 0 or PID2 < 0 THEN START ORAD ELSE STOP ORAD

To this:
51 IF PID1 = 0 or PID2 = 0 THEN START ORAD ELSE STOP ORAD

You can change the wording a little to make it easier for later maintenance, instead of IF OECS > 0, use this:
70 IF OECS OR ORAD THEN START OCOLL ELSE STOP OCOLL

Give VAR5 a user name as well.

1 Like

my problem is that the ORAD and OCH output activates and continuously disables with 10-second intervals and I can’t solve this problem.

Sounds like you could make use the IF+ and IF- statements, these will trigger only once on the rising or falling edge of some event.