Citect SCADA - Help Please

EICS_2

Member
Join Date
Mar 2015
Location
Melbourne
Posts
49
Hi

i am by no means a cicode expert in fact i struggle with code. as a plant electrician i can do alarms, graphis, trends etc.

i have citect V7.2 and i am trying to count the amount of devices that are running to display as a integer value "D1_FIB_TOT_RUNNING " .

i have the tags D1_FIB_1_RUN etc addressed as I1, I2 and so on in my database as integers to a Diskplc (memory)I/O device and can read/write to these tags.

the tags CW_D1F1CH_OUT are existing digital tags from the process. i call the function
D1_Fib_Run() from the events form every 10 seconds as a Global event.

what syntax do i have wrong ?

thanks in advance.

EICS.

FUNCTIOND1_Fib_Run()
IF CW_D1F1CH_OUT ANDNOT CW_D1F1CH_IN THEN D1_FIB_1_RUN = 1ELSE0;
IF CW_D1F2CH_OUT ANDNOT CW_D1F2CH_IN THEN D1_FIB_2_RUN = 1ELSE0;
IF CW_D1F3CH_OUT ANDNOT CW_D1F3CH_IN THEN D1_FIB_3_RUN = 1ELSE0;
IF CW_D1F4CH_OUT ANDNOT CW_D1F4CH_IN THEN D1_FIB_4_RUN = 1ELSE0;
IF CW_D1F5CH_OUT ANDNOT CW_D1F5CH_IN THEN D1_FIB_5_RUN = 1ELSE0;
D1_FIB_TOT_RUNNING = D1_FIB_1_RUN + D1_FIB_2_RUN + D1_FIB_3_RUN + D1_FIB_4_RUN + D1_FIB_5_RUN;
END
END
END
END
END
END
 
Last edited:
what syntax do i have wrong ?

Might this be closer to what you want?



FUNCTIOND1_Fib_Run()
IF (CW_D1F1CH_OUT AND (NOT CW_D1F1CH_IN)) THEN
D1_FIB_1_RUN = 1;
ELSE
D1_FIB_1_RUN = 0;
END

IF (CW_D1F2CH_OUT AND (NOT CW_D1F2CH_IN)) THEN
D1_FIB_2_RUN = 1;
ELSE
D1_FIB_2_RUN = 0;
END
IF (CW_D1F3CH_OUT AND (NOT CW_D1F3CH_IN)) THEN
D1_FIB_3_RUN = 1;
ELSE
D1_FIB_3_RUN = 0;
END
IF (CW_D1F4CH_OUT AND (NOT CW_D1F4CH_IN)) THEN
D1_FIB_4_RUN = 1;
ELSE
D1_FIB_4_RUN = 0;
END
IF (CW_D1F5CH_OUT AND (NOT CW_D1F5CH_IN)) THEN
D1_FIB_5_RUN = 1;
ELSE
D1_FIB_5_RUN = 0;
END
D1_FIB_TOT_RUNNING = D1_FIB_1_RUN + D1_FIB_2_RUN + D1_FIB_3_RUN + D1_FIB_4_RUN + D1_FIB_5_RUN;
END
 

Similar Topics

Hello Everyone, I am working on reports in Vijeo Citect V7.40. I want to generate a report whenever I press the button. I am able to generate it...
Replies
0
Views
877
Excuse my inexperience with cicode, I have a citect issue I need to make "Global" where the line below is shown in bold in the below function...
Replies
10
Views
3,203
Hello Everyone, I am working on an already existing project updating new equipments installed. I have no prior experience in this field but I do...
Replies
8
Views
3,409
Hi, I am maintaining a Citect SCADA with 2 x IO servers and 2 x File servers. the version of Citect is 5.21.00 Service Pack G. I have my project...
Replies
0
Views
1,928
hello every one : am working in gas station and we r using PLC s7 300 with citect scada like picture below : and every thing working good ...
Replies
12
Views
4,362
Back
Top Bottom