Ошибка c0046 codesys

Hello,

On this post I report an issue arised after installation of another version of the CODESYS IDE.

On a PC with V3.5SP6 already installed I installed V3.5SP10 to test some newer features. After tests, I uninstalled this version.

Then, applications do not build, and IDE report a lot of errors not related to any Object.

Neither builds a new application, created following the steps in «Online Help: Quickstart > Create and Run a Project».

Just after creation of a new application, the following error is displayed.

C0046: Identifier ioConfigConnector not defined.

If tried to build, the list of errors increases.
Library Manager warns that IoStandard 3.5.10.0 has not been added. <- notice the version number.

Reinstallated of CODESYS IDE V3.5SP6, but this did not solve the issue.

The issue was solved when I uninstalled CODESYS IDE V3.5SP6, found and deleted any CODESYS related files and Windows Registry entries, and installed again.

CODESYS IDE help claims that:

Concepts and Base Components > Profile and Plug-ins
Please note the following with respect to versions of CODESYS and its components:
simultaneous installation of several versions is possible.
different versions of the runtime system and the programming system work together .

did I misunderstand anything?

Thank you

IMG: QuickStart

IMG: QuickStart

Компилятор выдает ошибку для следующей программы. Я не могу это решить.

Это система Codesys, пишущая на языке ST. Я хочу управлять электромагнитным клапаном, используя битовую операцию.

CanRx := can_getDatabox (CAN_2, 10, ADR(CanRx_data), ADR(CanRxNumBytes));
Rx_test_1 := CanRx_data[1];
Rx_test_2 := CanRx_data[2];
Rx_test_3 := CanRx_data[3];
Rx_test_4 := CanRx_data[4];

IF(Rx_test_1 & 4 = 4)THEN
  out (OUT_1_POH_CL, 1500);
  ELSE IF(Rx_test_1 & 8 = 8)THEN
  out (OUT_1_POH_CL, 0);
END_IF

Ошибка компилятора:

 Error: 4011:Callback_MAIN_Task(XX): Type mismatch in parameter 1 of 'AND':Cannot convert 'INT' to 'ANY_BIT'  
 Error: 4024:Callback_MAIN_Task(XX): Expecting END_IF_before"

2 ответа

Я смог решить это сам. Я использовал AND вместо &, использовал ELSIF вместо ELSEIF. Вот правильный код.

Rx_test_1 : BYTE;

IF ((Rx_test_1 AND 1) =1) THEN
   statement1;
ELSIF (( Rx_test_1 AND 2) =1) THEN
   statement2;
ELSIF (( Rx_test_1 AND 4) =1) THEN
   statement3;
ELSE
   statement4;
END_IF


1

Taro NAKAMURA
20 Ноя 2020 в 13:45

В документации для операторов ST сказано, что операторы сравнения и равенства <, >, <=, >=, = и <> имеют более высокий приоритет чем операторы логической логики и операторы побитовой логики.

Кроме того, в ST побитовыми логическими операторами являются AND и OR вместо & и |. Точно так же булевы логические операторы — это AND_THEN и OR_ELSE вместо && и ||. (однако учтите, что булев логический оператор был добавлен в компилятор CODESYS V3.5 SP4, если вы используете более раннюю версию, они будут недоступны. Например, SoMachine. em> использует более старый)

Кроме того, синтаксис IF выглядит следующим образом:

IF condition THEN
    statement1;
ELSEIF condition THEN
    statement2;
ELSE
    statement3;
END_IF;

Но в вашем коде есть ELSE IF вместо ELSEIF, а в вашем END_IF отсутствует точка с запятой. (Хотя у меня никогда не было жалоб компилятора, если я пропустил это, и они сами часто опускают их в своих примерах в документации)

Итак, вам просто нужно заключить в скобки побитовую операцию перед сравнением. (Такая же ситуация и в языках семейства C, что приводит к нечитаемым выражениям со слишком большим количеством скобок), замените их допустимыми операторами ST и исправьте часть ELSE IF.

Попробуйте включить эти изменения, например:

(Обратите внимание, что я также добавил пробелы для удобства чтения. ST не накладывает никакой семантики на пробелы (в отличие от Python, Haskell и т. д.), поэтому вы должны использовать пробелы, чтобы максимизировать удобочитаемость и удобство сопровождения). (Мой личный стиль заключается в том, чтобы в скобках были пробелы, а не снаружи — другие люди категорически не согласны, YMMV)

IF ( ( Rx_test_1 AND 4 ) = 4 ) THEN

    out ( OUT_1_POH_CL, 1500 );

ELSEIF ( ( Rx_test_1 AND 8 ) = 8 ) THEN

    out ( OUT_1_POH_CL, 0 );

END_IF;


1

Guiorgy
21 Ноя 2020 в 14:50

Errors 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 «Expecting or or … before »» Enter a valid operand at the named position. «Expecting ‘:=’ or ‘=>’ before »» Enter one of the both operators at the named position. «‘BITADR’ expects a bit address or a variable on a bit address»Use a valid bit address (e.g. %IX0.1). «Integer number or symbolic constant expected» Enter a integer number or the identifier of a valid constant. «‘INI’ operator needs function block instance or data unit type instance» Check the data type of the variable, for which the INI operator is used. «Nested calls of the same function are not possible.» At not reentrant target systems and in simulation mode a function call may not contain a call of itself as a parameter. Example: fun1(a,fun1(b,c,d),e); Use a intermediate table. «Expressions and constants are not allowed as operands of ‘ADR’» Replace the constant or the expression by a variable or a direct address. «‘ADR’ is not allowed on bits! Use ‘BITADR’ instead.» Use BITADR. Please Note: The BITADR function does not return a physical memory address. «’’ operands are too few for ». At least ‘’ are needed» Check how many operands the named operator requires and add the missing operands. «’’ operands are too many for ». At least ‘’ are needed» Check how many operands the named operator requires and remove the surplus operands. «Division by 0» You are using a division by 0 in a constant expression. If you want to provocate a runtime error, use – if applicable — a variable with the value 0. 10-118 <strong>CoDeSys</strong> V2.3

Appendix J: Compiler Errors and Warnings 4035 «ADR must not be applied on ‘VAR CONSTANT’ if ‘replaced constants’ is activated» An address access on constants for which the direct values are used, is not possible. If applicable, deactivate the option ‚Replace Constants’ in ‚Project’ ‚Options’ ‚Build’. 4040 «Label » is not defined» Define a label with the name or change the name to that of a defined label. 4041 4042 4043 4050 4051 4052 «Duplicate definition of label »» The label ‘< Name>’ is multiple defined in the POU. Rename the label or remove one of the definitions. «No more than labels in sequence are allowed» The number of jump labels is limited to ». Insert a dummy instruction. «Format of label invalid. A label must be a name optionally followed by a colon.»The label name is not valid or the colon is missing in the definition. «POU ‘%s’ is not defined» Define a POU with the name » using the command ‘Project’ ‘Add Object’ or change » to the name of a defined POU. «‘%s’ is no function» Use instead of a function name which is defined in the project or in the libraries. «» must be a declared instance of FB »» Use an instance of data type » which is defined in the project or change the type of to ». 4053 «» is no valid box or operator» Replace » by the name of a POU or an operator defined in the project. 4054 «POU name expected as parameter of ‘INDEXOF’» The given paramter is not a valid POU name. 4060 «‘VAR_IN_OUT’ parameter » of » needs variable with write access as input» To VAR_IN_OUT parameters variables with write access have to be handed over, because a VAR_IN_OUT can be modified within the POU. <strong>CoDeSys</strong> V2.3 10-119

  • Page 1 and 2:

    User Manual for PLC Programming wit

  • Page 3 and 4:

    Content 1 A Brief Introduction to C

  • Page 5 and 6:

    8 The License Manager 8-1 8.1.1 Cre

  • Page 7 and 8:

    A Brief Introduction to CoDeSys 1 A

  • Page 9:

    A Brief Introduction to CoDeSys 1.3

  • Page 12 and 13:

    Project Components… The call of a

  • Page 14 and 15:

    Project Components… Calling a fun

  • Page 16 and 17:

    Project Components… In FBD : PLC_

  • Page 18 and 19:

    Languages… Data types Visualizati

  • Page 20 and 21:

    Languages… LDN BOOL2 (*save the n

  • Page 22 and 23:

    Languages… BOOL2 := FALSE; END_CA

  • Page 24 and 25:

    Languages… FOR loop • If the va

  • Page 26 and 27:

    Languages… 2.2.3 Sequential Funct

  • Page 28 and 29:

    Languages… An example for an IEC

  • Page 30 and 31:

    Languages… is stored in the branc

  • Page 32 and 33:

    Languages… Contact Each network i

  • Page 34 and 35:

    Debugging, Online Functions… Moni

  • Page 37 and 38:

    Chapter 3 — We Write a Little Progr

  • Page 39 and 40:

    3 — We Write a Little Program For t

  • Page 41 and 42:

    3 — We Write a Little Program At fi

  • Page 43 and 44:

    3 — We Write a Little Program Actio

  • Page 45 and 46:

    3 — We Write a Little Program Progr

  • Page 47 and 48:

    3 — We Write a Little Program The n

  • Page 49 and 50:

    3 — We Write a Little Program The r

  • Page 51:

    3 — We Write a Little Program CoDeS

  • Page 54 and 55:

    The Main Window… In order to see

  • Page 56 and 57:

    Project Options… • Log • Buil

  • Page 58 and 59:

    Project Options… Autodeclaration:

  • Page 60 and 61:

    Project Options… If you have chos

  • Page 62 and 63:

    Project Options… Here the comment

  • Page 64 and 65:

    Project Options… Using the option

  • Page 66 and 67:

    Project Options… Local: The POU w

  • Page 68 and 69:

    Managing Projects… ‘File’ ‘Open’

  • Page 70 and 71:

    Managing Projects… implementation

  • Page 72 and 73:

    Managing Projects… ‘File’ ‘Print’

  • Page 74 and 75:

    Managing Projects… Window for pas

  • Page 76 and 77:

    Managing Projects… Translate proj

  • Page 78 and 79:

    Managing Projects… If a translati

  • Page 80 and 81:

    Managing Projects… Dialog box for

  • Page 82 and 83:

    Managing Projects… Please Note: I

  • Page 84 and 85:

    Managing Projects… If the report

  • Page 86 and 87:

    Managing Projects… 4.3.1 ‘Project

  • Page 88 and 89:

    Managing Projects… Dialog ‘Login’

  • Page 90 and 91:

    Managing Projects… Dialog showing

  • Page 92 and 93:

    Managing Projects… Label Version

  • Page 94 and 95:

    Managing Objects in a Project… ‘N

  • Page 96 and 97:

    Managing Objects in a Project… Di

  • Page 98 and 99:

    Managing Objects in a Project… On

  • Page 100 and 101:

    General Editing Functions… 4.5 Ge

  • Page 102 and 103:

    General Editing Functions… ‘Edit’

  • Page 104 and 105:

    General Online Functions… ‘Edit’

  • Page 106 and 107:

    General Online Functions… VAR PER

  • Page 108 and 109:

    General Online Functions… Before

  • Page 110 and 111:

    General Online Functions… Dialog

  • Page 112 and 113:

    General Online Functions… ‘Online

  • Page 114 and 115:

    Window set up… 4.7 Window set up.

  • Page 117 and 118:

    5 — Editors in CoDeSys 5 Editors in

  • Page 119 and 120:

    5 — Editors in CoDeSys Input Variab

  • Page 121 and 122:

    5 — Editors in CoDeSys con1:INT:=12

  • Page 123 and 124:

    5 — Editors in CoDeSys • All iden

  • Page 125 and 126:

    5 — Editors in CoDeSys In the onlin

  • Page 127 and 128:

    5 — Editors in CoDeSys If the POU h

  • Page 129 and 130:

    5 — Editors in CoDeSys ‘Insert’ ‘Op

  • Page 131 and 132:

    5 — Editors in CoDeSys IL Editor wi

  • Page 133 and 134:

    5 — Editors in CoDeSys 5.3.2 The Ed

  • Page 135 and 136:

    5 — Editors in CoDeSys of the netwo

  • Page 137 and 138:

    5 — Editors in CoDeSys Depending on

  • Page 139 and 140:

    5 — Editors in CoDeSys ‘Extras’ ‘Se

  • Page 141 and 142:

    5 — Editors in CoDeSys All editors

  • Page 143 and 144:

    5 — Editors in CoDeSys The contact

  • Page 145 and 146:

    5 — Editors in CoDeSys The coil now

  • Page 147 and 148:

    5 — Editors in CoDeSys ‘Insert’ ‘Pa

  • Page 149 and 150:

    5 — Editors in CoDeSys setting is d

  • Page 151 and 152:

    5 — Editors in CoDeSys If IEC steps

  • Page 153 and 154:

    5 — Editors in CoDeSys 2. Text fiel

  • Page 155 and 156:

    5 — Editors in CoDeSys ‘Extras’ ‘Se

  • Page 157 and 158:

    5 — Editors in CoDeSys ‘Extras’ ‘Co

  • Page 159 and 160:

    5 — Editors in CoDeSys ‘Extras’ ‘Or

  • Page 161 and 162:

    5 — Editors in CoDeSys Example: Sel

  • Page 163:

    5 — Editors in CoDeSys PINs in macr

  • Page 166 and 167:

    Global Variables, Variable Configur

  • Page 168 and 169:

    Global Variables, Variable Configur

  • Page 170 and 171:

    Global Variables, Variable Configur

  • Page 172 and 173:

    Library Manager… variable. You ca

  • Page 174 and 175:

    Log… Remove Library With the ‘Edi

  • Page 176 and 177:

    PLC Configuration Storing the proje

  • Page 178 and 179:

    PLC Configuration All modules start

  • Page 180 and 181:

    PLC Configuration Modul id: The Mod

  • Page 182 and 183:

    PLC Configuration 6.5.5 Configurati

  • Page 184 and 185:

    PLC Configuration The GSD file pert

  • Page 186 and 187:

    PLC Configuration Basisparameter di

  • Page 188 and 189:

    PLC Configuration The Properties bu

  • Page 190 and 191:

    PLC Configuration 6.5.7 Configurati

  • Page 192 and 193:

    PLC Configuration given Guard COB-I

  • Page 194 and 195:

    PLC Configuration cyclic — synchron

  • Page 196 and 197:

    PLC Configuration CAN settings of a

  • Page 198 and 199:

    Target Settings Target-Support-Pack

  • Page 200 and 201:

    Task Configuration… • A task na

  • Page 202 and 203:

    Task Configuration… may be extend

  • Page 204 and 205:

    Watch and Receipt Manager… The sc

  • Page 206 and 207:

    Watch and Receipt Manager… Watch

  • Page 208 and 209:

    Sampling Trace Dialog Box for Trace

  • Page 210 and 211:

    Sampling Trace Display of the Sampl

  • Page 212 and 213:

    Sampling Trace ‘Load Values’ Be awa

  • Page 214 and 215:

    Parameter Manager 6.10.1 Dialog Tar

  • Page 216 and 217:

    Parameter Manager 6.11.2 Der Parame

  • Page 218 and 219:

    Parameter Manager Now close the tem

  • Page 220 and 221:

    Parameter Manager attributes. To en

  • Page 222 and 223:

    PLC Browser In a selection box the

  • Page 224 and 225:

    Tools %V If NAME is a variable name

  • Page 226 and 227:

    Tools The table lists all tools for

  • Page 228 and 229:

    Tools Parameter Path of the file wh

  • Page 230 and 231:

    Tools Mark the entry ‘Tools’ in the

  • Page 232 and 233:

    Tools • a project data base for w

  • Page 235 and 236:

    8 — The License Manager 8 The Licen

  • Page 237 and 238:

    9 — DDE Communication with CoDeSys

  • Page 239 and 240:

    9 — DDE Communication with CoDeSys

  • Page 241 and 242:

    APPENDIX 10 APPENDIX Appendix A: IE

  • Page 243 and 244:

    IEC Operators and additional norm e

  • Page 245 and 246:

    IEC Operators and additional norm e

  • Page 247 and 248:

    IEC Operators and additional norm e

  • Page 249 and 250:

    IEC Operators and additional norm e

  • Page 251 and 252:

    IEC Operators and additional norm e

  • Page 253 and 254:

    IEC Operators and additional norm e

  • Page 255 and 256:

    IEC Operators and additional norm e

  • Page 257 and 258:

    IEC Operators and additional norm e

  • Page 259 and 260:

    IEC Operators and additional norm e

  • Page 261 and 262:

    IEC Operators and additional norm e

  • Page 263 and 264:

    IEC Operators and additional norm e

  • Page 265 and 266:

    Appendix B: Operands in CoDeSys App

  • Page 267 and 268:

    Appendix B: Operands in CoDeSys $P

  • Page 269:

    Appendix B: Operands in CoDeSys %QB

  • Page 272 and 273:

    Standard data types Time Data Types

  • Page 274 and 275:

    Defined data types FUNCTION CheckBo

  • Page 276 and 277:

    Defined data types References For e

  • Page 279 and 280:

    Appendix D: CoDeSys Libraries Appen

  • Page 281 and 282:

    Appendix D: CoDeSys Libraries LD CO

  • Page 283 and 284:

    Appendix D: CoDeSys Libraries Examp

  • Page 285 and 286:

    Appendix D: CoDeSys Libraries CLK :

  • Page 287 and 288:

    Appendix D: CoDeSys Libraries Examp

  • Page 289 and 290:

    Appendix D: CoDeSys Libraries As so

  • Page 291 and 292:

    Appendix D: CoDeSys Libraries Decla

  • Page 293 and 294:

    Appendix D: CoDeSys Libraries Examp

  • Page 295 and 296:

    Appendix D: CoDeSys Libraries A P-c

  • Page 297 and 298:

    Appendix D: CoDeSys Libraries IN of

  • Page 299 and 300:

    Appendix D: CoDeSys Libraries If th

  • Page 301 and 302:

    Appendix E: Operators and Library M

  • Page 303 and 304:

    Appendix E: Operators and Library M

  • Page 305:

    Appendix E: Operators and Library M

  • Page 308 and 309: Command File (cmdfile) Commands onl
  • Page 310 and 311: Command File (cmdfile) Commands dir
  • Page 312 and 313: Command File (cmdfile) Commands ‘Co
  • Page 315 and 316: Appendix G: Siemens Import Appendix
  • Page 317 and 318: Appendix G: Siemens Import BE, BEA,
  • Page 319: Appendix G: Siemens Import redirect
  • Page 322 and 323: Command File (cmdfile) Commands 10.
  • Page 324 and 325: Command File (cmdfile) Commands Tar
  • Page 326 and 327: Command File (cmdfile) Commands Tar
  • Page 328 and 329: Command File (cmdfile) Commands Tar
  • Page 330 and 331: Command File (cmdfile) Commands 10.
  • Page 332 and 333: Command File (cmdfile) Commands 10.
  • Page 334 and 335: Key Combinations ‘File’ ‘Print’ ‘Fi
  • Page 336 and 337: Key Combinations ‘Insert’ ‘Step-Tra
  • Page 339 and 340: Appendix J: Compiler Errors and War
  • Page 341 and 342: Appendix J: Compiler Errors and War
  • Page 343 and 344: Appendix J: Compiler Errors and War
  • Page 345 and 346: Appendix J: Compiler Errors and War
  • Page 347 and 348: Appendix J: Compiler Errors and War
  • Page 349 and 350: Appendix J: Compiler Errors and War
  • Page 351 and 352: Appendix J: Compiler Errors and War
  • Page 353 and 354: Appendix J: Compiler Errors and War
  • Page 355 and 356: Appendix J: Compiler Errors and War
  • Page 357: Appendix J: Compiler Errors and War
  • Page 361 and 362: Appendix J: Compiler Errors and War
  • Page 363 and 364: Appendix J: Compiler Errors and War
  • Page 365 and 366: Appendix J: Compiler Errors and War
  • Page 367 and 368: Appendix J: Compiler Errors and War
  • Page 369 and 370: Appendix J: Compiler Errors and War
  • Page 371 and 372: Appendix J: Compiler Errors and War
  • Page 373: Appendix J: Compiler Errors and War
  • Page 376 and 377: Errors Changing connections 5-40 Cr
  • Page 378 and 379: Errors Set as project configuration
  • Page 380 and 381: Errors Insert Label in CFC 5-38 Ins
  • Page 382 and 383: Errors Function 5-13 Function Block
  • Page 384 and 385: Errors Cut/Copy/Paste line 6-55 Del
  • Page 386 and 387: Errors SFCTip 2-19 SFCTipMode 2-19
  • Page 388: Errors Window 4-62 Window Arrange S

Обновлено: 29.01.2023

I am currently working on ABB PLC, I tried to upload the program from PLC but I cann’t make it. Now I got the backup program which have number of errors. The errors are

Error4268:RECIPE(32):Expression expected.
Error4052:RECIPE(32):»must be a declared instance of function block’ADDSUB’

Please help me on this. How to remove this error?

Lifetime Supporting Member
Join Date: Apr 2004
Location: Israel
Posts: 615

Can you upload the code?

Which PLC are you using?

Member
Join Date: Nov 2011
Location: Aurangabad
Posts: 9

I am using CPU PM571, with CD522, DC522, AX521 modules.

Code is attached here with

Member
Join Date: Dec 2012
Location: Koprivnica, HR
Posts: 418
Quote:
Originally Posted by kam

Error4268:RECIPE(32):Expression expected.
Error4052:RECIPE(32):»must be a declared instance of function block’ADDSUB’

Please help me on this. How to remove this error?

First error was probably due to forgotten semicolon at the end or = instead of :=

Second error: you forgot to declare function block instance as variable:

balash
View Public Profile
Find More Posts by balash

Member
Join Date: Nov 2011
Location: Aurangabad
Posts: 9

I checked program many times, we have given all necessary punctuation marks. Also we have declared each function block.

For ex. TRAVERS_MTR: AC500_REAL_AO;
SPOOLADD: ADDSUB;

Attached Files

Program.zip (40.2 KB, 17 views)

Member
Join Date: Dec 2012
Location: Koprivnica, HR
Posts: 418

well i can’t really much compile cause i have codesys integrated with control builder, and i miss lots of your custom libraries and PLC conf but.
if i am not wrong i think you forgot to name the instance of «addsub» box in rung 32. every functionblock box must have instance that is name of the functionblock box.

that would solve one problem i guess.

not much help with second problem cause i’m cripled without conf and libs needed.

balash
View Public Profile
Find More Posts by balash

Member
Join Date: Nov 2011
Location: Aurangabad
Posts: 9

Thanks for your reply.

I have resolved all the errors by following steps.

1. If you observe the PLC configuration you won’t found CD522 module, so to insert this module I upgraded my CoDeSys.

2. The programmer have declared the Function Blocks by some variable name, but forgot to give that variable name to certain block.
For ex. in OUTPUT (11) he used AC500_REAL_AO, but didn’t give the variable name to this function block, but he declared this block by ‘LEFT SPOOLER3’. So I give the same name to function block. and Bingo.

But not while going online I am going through a error. I have attached this for reference.

Читайте также:

  • Плач ярославны что значит выражение
  • Я в курсе выражение
  • Живет же горстка людей откуда фраза
  • Примером применения нормативного подхода в макроэкономическом анализе являются высказывания что
  • В жизни шура человеку должно повезти три раза откуда фраза

Если это не поможет, свяжитесь с изготовителем ПЛКCoDeSys V2.310-123Приложение J: Ошибки и предупреждения компилятора3601″<name> is a reserved variable name»Имя данной переменной зарезервировано генератором кода, измените его.3610″ ‘<Name>’ is not supported»Данное свойство не поддерживается в установленной целевой системе.3611″The given compile directory ‘<name>’ is invalid»В ‚Project’ ‚Options’ ‚Directories’ задана несуществующая директория для файлов компилятора.3612″Maximum number of POUs (<number>) exceeded! Compile is aborted.»В проекте используется слишком много POU.

Измените максимум POU в Target Settings / MemoryLayout.3613″Build canceled»Компиляция прервана пользователем.3614″Project must contain a POU named ‘<name>’ (main routine) or a taskconfiguration»Создайте главный POU (т.е. PLC_PRG) или задайте конфигурацию задач.3615″<Name> (main routine) must be of type program»Главный POU (т.е. PLC_PRG) должен иметь тип программа.3616″Programs musn’t be implemented in external libraries»Проект, который предполагается сохранить как внешнюю библиотеку? содержит программы.

Они небудут доступны в библиотеке.3617″Out of memory»Увеличьте размер виртуальной памяти вашего компьютера.CoDeSys V2.310-124Приложение J: Ошибки и предупреждения компилятора3618″BitAccess not supported in current code generator!»Битовый доступ не поддерживается генератором кода данной целевой системы.3619″Object file ‘<name>’ and library ‘<name>’ have different versions!»Убедитесь, что файлы *.lib и *.obj resp. *.hex соответствуют одной версии библиотеки.

Проверьте даты создания этих файлов.3620″The POU ‘<name>’ must not be present inside a library»Вы пытаетесь сохранить библиотеку в формате версии 2.1. В этой версии библиотека не может содержать PLC_PRG, удалите или переименуйте его.3621″Cannot write compile file ‘<name>'»Вероятнее всего, в директории, указанной для файлов компилятора, уже имеется файл с таким именем, имеющий атрибут «Только чтение «. Удалите данный файл либо измените ему права доступа.3622″The symbol file ‘<name>’ could not be created»Вероятнее всего, в директории, указанной для символьных файлов (обычно это директория проекта),уже имеется файл с таким именем, имеющий атрибут «Только чтение «.

Удалите данный файл либоизмените ему права доступа.3623″Cannot write boot project file ‘<name>'»Вероятнее всего, в директории, указанной для загрузочных файлов (специфичных для целевой платформы), уже имеется файл с таким именем, имеющий атрибут «Только чтение «. Удалите данный файллибо измените ему права доступа.3624″Target setting <targetsetting1>=<set value> not compatible with <targetsetting2>=<set value>»Проверьте и исправьте данные установки в диалоге Targetsettings dialogs (вкладка Resources). Если онинедоступны для редактирования, то обратитесь к изготовителю контроллера.3700» POU with name ‘<name>’ is already in library ‘<name>'»Имя POU проекта уже использовано в библиотеке, измените его.CoDeSys V2.310-125Приложение J: Ошибки и предупреждения компилятора3701″Name used in interface is not identical with POU Name»Используйте команду ‘Project’ ‘Rename object’ для изменения памяти POU в организаторе объектовлибо измените имя в окне объявления POU.

Имя POU следует за одним из ключевых слов: PROGRAM, FUNCTION или FUNCTIONBLOCK.3702″Overflow of identifier list»Не более 100 идентификаторов могут быть использованы при объявлении одной переменной.3703″Duplicate definition of identifier ‘<Name>'»Убедитесь, что только один идентификатор ‘<Name>’ присутствует в разделе объявлений POU.3704″data recursion: «<POU 0> -> <POU 1> -> .. -> <POU 0>»»Применен не допустимый вызов экземпляром функционального блока самого себя.3705″<Name>: VAR_IN_OUT in Top-Level-POU not allowed, if there is no Task-Configuration»Создайте конфигурацию задач или убедитесь, что переменные VAR_IN_OUT не используются вPLC_PRG.3720″Address expected after ‘AT'»После ключевого слова AT должен быть указан корректный адрес.3721″Only ‘VAR’ and ‘VAR_GLOBAL’ can be located to addresses»Поместите объявление в область VAR или VAR_GLOBAL.3722″Only ‘BOOL’ variables allowed on bit addresses»Только переменные типа BOOL могут адресовать биты.

Измените адрес или тип переменной.3726″Constants can not be laid on direct addresses»Константы нельзя располагать по прямым адресам.CoDeSys V2.310-126Приложение J: Ошибки и предупреждения компилятора3727″No array declaration allowed on this address»Объявление может быть произведено по указанному адресу. Измените адрес.3728″Invalid address: ‘<address>'»Указанный адрес не определен для заданной конфигурации ПЛК. Измените адрес или конфигурациюПЛК.3729″Invalid type ‘<name>’ at address: ‘<Name>’ «Переменная данного типа не может быть размещена по указанному адресу.

Например: адрес AT%IB1:WORD; не допустим, если включено выравнивание по четным адресам. Данная ошибка можетвозникнуть при попытке разместить массив по недопустимому прямому адресу.3740″Invalid type: ‘<Name>’ «Ошибка в типе данных объявления.3741″Expecting type specification»Ключевое слово или оператор использован вместо типа данных3742″Enumeration value expected»В определении перечисления пропущен идентификатор после скобки либо разделитель.3743″Integer number expected»Перечисления можно инициализировать только целыми значениями (INT).3744″Enum constant ‘<name>’ already defined»Проверьте соблюдение следующих правил при объявлении перечислений:•Все значения в одном перечислении должны быть уникальны.•Во всех глобальных перечислениях все значения должны быть уникальны.•Во всех локальных перечислениях все значения должны быть уникальны.CoDeSys V2.310-127Приложение J: Ошибки и предупреждения компилятора3745″Subranges are only allowed on Integers!»Переменные с ограниченным диапазоном образуются только на целочисленных типах.3746″Subrange ‘<name>’ is not compatible with Type ‘<name>'»Один из пределов диапазона выходит за область значений базового типа.3747″unknown string length: ‘<name>'»Для определения длины строки используется ошибочная константа.3748″More than three dimensions are not allowed for arrays»Нельзя использовать массивы с размерностью более трех.

Используйте ARRAY OF ARRAY при необходимости.3749″lower bound ‘<name>’ not defined»Не задана константа, определяющая нижнюю границу диапазона.3750″upper bound ‘<name>’ not defined»Не задана константа, определяющая верхнюю границу диапазона.3751″Invalid string length ‘<number of characters>'»Заданный размер строки превышает допустимый в данной целевой системе.3752“More than 9 dimensions are not allowed for nested arrays»Массив может быть 1- 2- или 3-мерный. Размерность можно еще увеличить путем вложений массивов(например, «arr: ARRAY [0..2,0..2,0..2] OF ARRAY [0..2,0..2,0..2] OF ARRAY [0..2,0..2,0..2, 0..2] OFDINT».

Максимальная размерность не должна превышать 9. Данная ошибка говорит о превышенииэтого ограничения. Уменьшите вложенность массивов.3760″Error in initial value»CoDeSys V2.310-128Приложение J: Ошибки и предупреждения компилятораИспользуйте для инициализации значение, совместимое с типом переменной. Изменяя объявление,воспользуйтесь диалогом объявлений переменных (Shift/F2 или ‘Edit»Autodeclare’).3761″‘VAR_IN_OUT’ variables must not have an initial value.»Удалите инициализацию в объявлении переменной VAR_IN_OUT.3780″‘VAR’, ‘VAR_INPUT’, ‘VAR_OUTPUT’ or ‘VAR_IN_OUT’ expected»В следующей за определением имени POU строке должно быть одно из перечисленных ключевыхслов.3781″‘END_VAR’ or identifier expected»Введите корректное определение END_VAR в данной строке окна объявлений.3782″Unexpected end»В разделе объявлений: добавьте ключевое слово END_VAR в конце раздела.В разделе кода: добавьте инструкцию, заканчивающую команду (например, END_IF).3783″END_STRUCT’ or identifier expected»Проверьте правильность окончания определения типа.3784″The current target doesn’t support attribute <attribute name>»Данная целевая система не поддерживает переменные такого типа (например, RETAIN, PERSISTENT)3800″The global variables need too much memory.

Increase the available memory in the project options.»Увеличьте число сегментов в опциях диалога Project’ ‚Options’ ‚Build’.3801″The variable ‘<Name>’ is too big. (<size> byte)»Переменная использует тип, занимающий более одного сегментаРазмер сегмента определяется настройкой целевой платформы. Если вы не нашли этого параметра вопциях памяти, свяжитесь с изготовителем ПЛК.CoDeSys V2.310-129Приложение J: Ошибки и предупреждения компилятора3802″Out of retain memory. Variable ‘<name>’, <number> bytes.»Израсходована вся память Retain переменных.

Компилятор выдает ошибку для следующей программы. Я не могу это решить.

Это система Codesys, пишущая на языке ST. Я хочу управлять электромагнитным клапаном, используя битовую операцию.

CanRx := can_getDatabox (CAN_2, 10, ADR(CanRx_data), ADR(CanRxNumBytes));
Rx_test_1 := CanRx_data[1];
Rx_test_2 := CanRx_data[2];
Rx_test_3 := CanRx_data[3];
Rx_test_4 := CanRx_data[4];

IF(Rx_test_1 & 4 = 4)THEN
  out (OUT_1_POH_CL, 1500);
  ELSE IF(Rx_test_1 & 8 = 8)THEN
  out (OUT_1_POH_CL, 0);
END_IF

Ошибка компилятора:

 Error: 4011:Callback_MAIN_Task(XX): Type mismatch in parameter 1 of 'AND':Cannot convert 'INT' to 'ANY_BIT'  
 Error: 4024:Callback_MAIN_Task(XX): Expecting END_IF_before"

2 ответа

Я смог решить это сам. Я использовал AND вместо &, использовал ELSIF вместо ELSEIF. Вот правильный код.

Rx_test_1 : BYTE;

IF ((Rx_test_1 AND 1) =1) THEN
   statement1;
ELSIF (( Rx_test_1 AND 2) =1) THEN
   statement2;
ELSIF (( Rx_test_1 AND 4) =1) THEN
   statement3;
ELSE
   statement4;
END_IF


1

Taro NAKAMURA
20 Ноя 2020 в 13:45

В документации для операторов ST сказано, что операторы сравнения и равенства <, >, <=, >=, = и <> имеют более высокий приоритет чем операторы логической логики и операторы побитовой логики.

Кроме того, в ST побитовыми логическими операторами являются AND и OR вместо & и |. Точно так же булевы логические операторы — это AND_THEN и OR_ELSE вместо && и ||. (однако учтите, что булев логический оператор был добавлен в компилятор CODESYS V3.5 SP4, если вы используете более раннюю версию, они будут недоступны. Например, SoMachine. em> использует более старый)

Кроме того, синтаксис IF выглядит следующим образом:

IF condition THEN
    statement1;
ELSEIF condition THEN
    statement2;
ELSE
    statement3;
END_IF;

Но в вашем коде есть ELSE IF вместо ELSEIF, а в вашем END_IF отсутствует точка с запятой. (Хотя у меня никогда не было жалоб компилятора, если я пропустил это, и они сами часто опускают их в своих примерах в документации)

Итак, вам просто нужно заключить в скобки побитовую операцию перед сравнением. (Такая же ситуация и в языках семейства C, что приводит к нечитаемым выражениям со слишком большим количеством скобок), замените их допустимыми операторами ST и исправьте часть ELSE IF.

Попробуйте включить эти изменения, например:

(Обратите внимание, что я также добавил пробелы для удобства чтения. ST не накладывает никакой семантики на пробелы (в отличие от Python, Haskell и т. д.), поэтому вы должны использовать пробелы, чтобы максимизировать удобочитаемость и удобство сопровождения). (Мой личный стиль заключается в том, чтобы в скобках были пробелы, а не снаружи — другие люди категорически не согласны, YMMV)

IF ( ( Rx_test_1 AND 4 ) = 4 ) THEN

    out ( OUT_1_POH_CL, 1500 );

ELSEIF ( ( Rx_test_1 AND 8 ) = 8 ) THEN

    out ( OUT_1_POH_CL, 0 );

END_IF;


1

Guiorgy
21 Ноя 2020 в 14:50

Errors 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 «Expecting or or … before »» Enter a valid operand at the named position. «Expecting ‘:=’ or ‘=>’ before »» Enter one of the both operators at the named position. «‘BITADR’ expects a bit address or a variable on a bit address»Use a valid bit address (e.g. %IX0.1). «Integer number or symbolic constant expected» Enter a integer number or the identifier of a valid constant. «‘INI’ operator needs function block instance or data unit type instance» Check the data type of the variable, for which the INI operator is used. «Nested calls of the same function are not possible.» At not reentrant target systems and in simulation mode a function call may not contain a call of itself as a parameter. Example: fun1(a,fun1(b,c,d),e); Use a intermediate table. «Expressions and constants are not allowed as operands of ‘ADR’» Replace the constant or the expression by a variable or a direct address. «‘ADR’ is not allowed on bits! Use ‘BITADR’ instead.» Use BITADR. Please Note: The BITADR function does not return a physical memory address. «’’ operands are too few for ». At least ‘’ are needed» Check how many operands the named operator requires and add the missing operands. «’’ operands are too many for ». At least ‘’ are needed» Check how many operands the named operator requires and remove the surplus operands. «Division by 0» You are using a division by 0 in a constant expression. If you want to provocate a runtime error, use – if applicable — a variable with the value 0. 10-118 <strong>CoDeSys</strong> V2.3

Appendix J: Compiler Errors and Warnings 4035 «ADR must not be applied on ‘VAR CONSTANT’ if ‘replaced constants’ is activated» An address access on constants for which the direct values are used, is not possible. If applicable, deactivate the option ‚Replace Constants’ in ‚Project’ ‚Options’ ‚Build’. 4040 «Label » is not defined» Define a label with the name or change the name to that of a defined label. 4041 4042 4043 4050 4051 4052 «Duplicate definition of label »» The label ‘< Name>’ is multiple defined in the POU. Rename the label or remove one of the definitions. «No more than labels in sequence are allowed» The number of jump labels is limited to ». Insert a dummy instruction. «Format of label invalid. A label must be a name optionally followed by a colon.»The label name is not valid or the colon is missing in the definition. «POU ‘%s’ is not defined» Define a POU with the name » using the command ‘Project’ ‘Add Object’ or change » to the name of a defined POU. «‘%s’ is no function» Use instead of a function name which is defined in the project or in the libraries. «» must be a declared instance of FB »» Use an instance of data type » which is defined in the project or change the type of to ». 4053 «» is no valid box or operator» Replace » by the name of a POU or an operator defined in the project. 4054 «POU name expected as parameter of ‘INDEXOF’» The given paramter is not a valid POU name. 4060 «‘VAR_IN_OUT’ parameter » of » needs variable with write access as input» To VAR_IN_OUT parameters variables with write access have to be handed over, because a VAR_IN_OUT can be modified within the POU. <strong>CoDeSys</strong> V2.3 10-119

  • Page 1 and 2:

    User Manual for PLC Programming wit

  • Page 3 and 4:

    Content 1 A Brief Introduction to C

  • Page 5 and 6:

    8 The License Manager 8-1 8.1.1 Cre

  • Page 7 and 8:

    A Brief Introduction to CoDeSys 1 A

  • Page 9:

    A Brief Introduction to CoDeSys 1.3

  • Page 12 and 13:

    Project Components… The call of a

  • Page 14 and 15:

    Project Components… Calling a fun

  • Page 16 and 17:

    Project Components… In FBD : PLC_

  • Page 18 and 19:

    Languages… Data types Visualizati

  • Page 20 and 21:

    Languages… LDN BOOL2 (*save the n

  • Page 22 and 23:

    Languages… BOOL2 := FALSE; END_CA

  • Page 24 and 25:

    Languages… FOR loop • If the va

  • Page 26 and 27:

    Languages… 2.2.3 Sequential Funct

  • Page 28 and 29:

    Languages… An example for an IEC

  • Page 30 and 31:

    Languages… is stored in the branc

  • Page 32 and 33:

    Languages… Contact Each network i

  • Page 34 and 35:

    Debugging, Online Functions… Moni

  • Page 37 and 38:

    Chapter 3 — We Write a Little Progr

  • Page 39 and 40:

    3 — We Write a Little Program For t

  • Page 41 and 42:

    3 — We Write a Little Program At fi

  • Page 43 and 44:

    3 — We Write a Little Program Actio

  • Page 45 and 46:

    3 — We Write a Little Program Progr

  • Page 47 and 48:

    3 — We Write a Little Program The n

  • Page 49 and 50:

    3 — We Write a Little Program The r

  • Page 51:

    3 — We Write a Little Program CoDeS

  • Page 54 and 55:

    The Main Window… In order to see

  • Page 56 and 57:

    Project Options… • Log • Buil

  • Page 58 and 59:

    Project Options… Autodeclaration:

  • Page 60 and 61:

    Project Options… If you have chos

  • Page 62 and 63:

    Project Options… Here the comment

  • Page 64 and 65:

    Project Options… Using the option

  • Page 66 and 67:

    Project Options… Local: The POU w

  • Page 68 and 69:

    Managing Projects… ‘File’ ‘Open’

  • Page 70 and 71:

    Managing Projects… implementation

  • Page 72 and 73:

    Managing Projects… ‘File’ ‘Print’

  • Page 74 and 75:

    Managing Projects… Window for pas

  • Page 76 and 77:

    Managing Projects… Translate proj

  • Page 78 and 79:

    Managing Projects… If a translati

  • Page 80 and 81:

    Managing Projects… Dialog box for

  • Page 82 and 83:

    Managing Projects… Please Note: I

  • Page 84 and 85:

    Managing Projects… If the report

  • Page 86 and 87:

    Managing Projects… 4.3.1 ‘Project

  • Page 88 and 89:

    Managing Projects… Dialog ‘Login’

  • Page 90 and 91:

    Managing Projects… Dialog showing

  • Page 92 and 93:

    Managing Projects… Label Version

  • Page 94 and 95:

    Managing Objects in a Project… ‘N

  • Page 96 and 97:

    Managing Objects in a Project… Di

  • Page 98 and 99:

    Managing Objects in a Project… On

  • Page 100 and 101:

    General Editing Functions… 4.5 Ge

  • Page 102 and 103:

    General Editing Functions… ‘Edit’

  • Page 104 and 105:

    General Online Functions… ‘Edit’

  • Page 106 and 107:

    General Online Functions… VAR PER

  • Page 108 and 109:

    General Online Functions… Before

  • Page 110 and 111:

    General Online Functions… Dialog

  • Page 112 and 113:

    General Online Functions… ‘Online

  • Page 114 and 115:

    Window set up… 4.7 Window set up.

  • Page 117 and 118:

    5 — Editors in CoDeSys 5 Editors in

  • Page 119 and 120:

    5 — Editors in CoDeSys Input Variab

  • Page 121 and 122:

    5 — Editors in CoDeSys con1:INT:=12

  • Page 123 and 124:

    5 — Editors in CoDeSys • All iden

  • Page 125 and 126:

    5 — Editors in CoDeSys In the onlin

  • Page 127 and 128:

    5 — Editors in CoDeSys If the POU h

  • Page 129 and 130:

    5 — Editors in CoDeSys ‘Insert’ ‘Op

  • Page 131 and 132:

    5 — Editors in CoDeSys IL Editor wi

  • Page 133 and 134:

    5 — Editors in CoDeSys 5.3.2 The Ed

  • Page 135 and 136:

    5 — Editors in CoDeSys of the netwo

  • Page 137 and 138:

    5 — Editors in CoDeSys Depending on

  • Page 139 and 140:

    5 — Editors in CoDeSys ‘Extras’ ‘Se

  • Page 141 and 142:

    5 — Editors in CoDeSys All editors

  • Page 143 and 144:

    5 — Editors in CoDeSys The contact

  • Page 145 and 146:

    5 — Editors in CoDeSys The coil now

  • Page 147 and 148:

    5 — Editors in CoDeSys ‘Insert’ ‘Pa

  • Page 149 and 150:

    5 — Editors in CoDeSys setting is d

  • Page 151 and 152:

    5 — Editors in CoDeSys If IEC steps

  • Page 153 and 154:

    5 — Editors in CoDeSys 2. Text fiel

  • Page 155 and 156:

    5 — Editors in CoDeSys ‘Extras’ ‘Se

  • Page 157 and 158:

    5 — Editors in CoDeSys ‘Extras’ ‘Co

  • Page 159 and 160:

    5 — Editors in CoDeSys ‘Extras’ ‘Or

  • Page 161 and 162:

    5 — Editors in CoDeSys Example: Sel

  • Page 163:

    5 — Editors in CoDeSys PINs in macr

  • Page 166 and 167:

    Global Variables, Variable Configur

  • Page 168 and 169:

    Global Variables, Variable Configur

  • Page 170 and 171:

    Global Variables, Variable Configur

  • Page 172 and 173:

    Library Manager… variable. You ca

  • Page 174 and 175:

    Log… Remove Library With the ‘Edi

  • Page 176 and 177:

    PLC Configuration Storing the proje

  • Page 178 and 179:

    PLC Configuration All modules start

  • Page 180 and 181:

    PLC Configuration Modul id: The Mod

  • Page 182 and 183:

    PLC Configuration 6.5.5 Configurati

  • Page 184 and 185:

    PLC Configuration The GSD file pert

  • Page 186 and 187:

    PLC Configuration Basisparameter di

  • Page 188 and 189:

    PLC Configuration The Properties bu

  • Page 190 and 191:

    PLC Configuration 6.5.7 Configurati

  • Page 192 and 193:

    PLC Configuration given Guard COB-I

  • Page 194 and 195:

    PLC Configuration cyclic — synchron

  • Page 196 and 197:

    PLC Configuration CAN settings of a

  • Page 198 and 199:

    Target Settings Target-Support-Pack

  • Page 200 and 201:

    Task Configuration… • A task na

  • Page 202 and 203:

    Task Configuration… may be extend

  • Page 204 and 205:

    Watch and Receipt Manager… The sc

  • Page 206 and 207:

    Watch and Receipt Manager… Watch

  • Page 208 and 209:

    Sampling Trace Dialog Box for Trace

  • Page 210 and 211:

    Sampling Trace Display of the Sampl

  • Page 212 and 213:

    Sampling Trace ‘Load Values’ Be awa

  • Page 214 and 215:

    Parameter Manager 6.10.1 Dialog Tar

  • Page 216 and 217:

    Parameter Manager 6.11.2 Der Parame

  • Page 218 and 219:

    Parameter Manager Now close the tem

  • Page 220 and 221:

    Parameter Manager attributes. To en

  • Page 222 and 223:

    PLC Browser In a selection box the

  • Page 224 and 225:

    Tools %V If NAME is a variable name

  • Page 226 and 227:

    Tools The table lists all tools for

  • Page 228 and 229:

    Tools Parameter Path of the file wh

  • Page 230 and 231:

    Tools Mark the entry ‘Tools’ in the

  • Page 232 and 233:

    Tools • a project data base for w

  • Page 235 and 236:

    8 — The License Manager 8 The Licen

  • Page 237 and 238:

    9 — DDE Communication with CoDeSys

  • Page 239 and 240:

    9 — DDE Communication with CoDeSys

  • Page 241 and 242:

    APPENDIX 10 APPENDIX Appendix A: IE

  • Page 243 and 244:

    IEC Operators and additional norm e

  • Page 245 and 246:

    IEC Operators and additional norm e

  • Page 247 and 248:

    IEC Operators and additional norm e

  • Page 249 and 250:

    IEC Operators and additional norm e

  • Page 251 and 252:

    IEC Operators and additional norm e

  • Page 253 and 254:

    IEC Operators and additional norm e

  • Page 255 and 256:

    IEC Operators and additional norm e

  • Page 257 and 258:

    IEC Operators and additional norm e

  • Page 259 and 260:

    IEC Operators and additional norm e

  • Page 261 and 262:

    IEC Operators and additional norm e

  • Page 263 and 264:

    IEC Operators and additional norm e

  • Page 265 and 266:

    Appendix B: Operands in CoDeSys App

  • Page 267 and 268:

    Appendix B: Operands in CoDeSys $P

  • Page 269:

    Appendix B: Operands in CoDeSys %QB

  • Page 272 and 273:

    Standard data types Time Data Types

  • Page 274 and 275:

    Defined data types FUNCTION CheckBo

  • Page 276 and 277:

    Defined data types References For e

  • Page 279 and 280:

    Appendix D: CoDeSys Libraries Appen

  • Page 281 and 282:

    Appendix D: CoDeSys Libraries LD CO

  • Page 283 and 284:

    Appendix D: CoDeSys Libraries Examp

  • Page 285 and 286:

    Appendix D: CoDeSys Libraries CLK :

  • Page 287 and 288:

    Appendix D: CoDeSys Libraries Examp

  • Page 289 and 290:

    Appendix D: CoDeSys Libraries As so

  • Page 291 and 292:

    Appendix D: CoDeSys Libraries Decla

  • Page 293 and 294:

    Appendix D: CoDeSys Libraries Examp

  • Page 295 and 296:

    Appendix D: CoDeSys Libraries A P-c

  • Page 297 and 298:

    Appendix D: CoDeSys Libraries IN of

  • Page 299 and 300:

    Appendix D: CoDeSys Libraries If th

  • Page 301 and 302:

    Appendix E: Operators and Library M

  • Page 303 and 304:

    Appendix E: Operators and Library M

  • Page 305:

    Appendix E: Operators and Library M

  • Page 308 and 309: Command File (cmdfile) Commands onl
  • Page 310 and 311: Command File (cmdfile) Commands dir
  • Page 312 and 313: Command File (cmdfile) Commands ‘Co
  • Page 315 and 316: Appendix G: Siemens Import Appendix
  • Page 317 and 318: Appendix G: Siemens Import BE, BEA,
  • Page 319: Appendix G: Siemens Import redirect
  • Page 322 and 323: Command File (cmdfile) Commands 10.
  • Page 324 and 325: Command File (cmdfile) Commands Tar
  • Page 326 and 327: Command File (cmdfile) Commands Tar
  • Page 328 and 329: Command File (cmdfile) Commands Tar
  • Page 330 and 331: Command File (cmdfile) Commands 10.
  • Page 332 and 333: Command File (cmdfile) Commands 10.
  • Page 334 and 335: Key Combinations ‘File’ ‘Print’ ‘Fi
  • Page 336 and 337: Key Combinations ‘Insert’ ‘Step-Tra
  • Page 339 and 340: Appendix J: Compiler Errors and War
  • Page 341 and 342: Appendix J: Compiler Errors and War
  • Page 343 and 344: Appendix J: Compiler Errors and War
  • Page 345 and 346: Appendix J: Compiler Errors and War
  • Page 347 and 348: Appendix J: Compiler Errors and War
  • Page 349 and 350: Appendix J: Compiler Errors and War
  • Page 351 and 352: Appendix J: Compiler Errors and War
  • Page 353 and 354: Appendix J: Compiler Errors and War
  • Page 355 and 356: Appendix J: Compiler Errors and War
  • Page 357: Appendix J: Compiler Errors and War
  • Page 361 and 362: Appendix J: Compiler Errors and War
  • Page 363 and 364: Appendix J: Compiler Errors and War
  • Page 365 and 366: Appendix J: Compiler Errors and War
  • Page 367 and 368: Appendix J: Compiler Errors and War
  • Page 369 and 370: Appendix J: Compiler Errors and War
  • Page 371 and 372: Appendix J: Compiler Errors and War
  • Page 373: Appendix J: Compiler Errors and War
  • Page 376 and 377: Errors Changing connections 5-40 Cr
  • Page 378 and 379: Errors Set as project configuration
  • Page 380 and 381: Errors Insert Label in CFC 5-38 Ins
  • Page 382 and 383: Errors Function 5-13 Function Block
  • Page 384 and 385: Errors Cut/Copy/Paste line 6-55 Del
  • Page 386 and 387: Errors SFCTip 2-19 SFCTipMode 2-19
  • Page 388: Errors Window 4-62 Window Arrange S

Обновлено: 29.01.2023

I am currently working on ABB PLC, I tried to upload the program from PLC but I cann’t make it. Now I got the backup program which have number of errors. The errors are

Error4268:RECIPE(32):Expression expected.
Error4052:RECIPE(32):»must be a declared instance of function block’ADDSUB’

Please help me on this. How to remove this error?

Lifetime Supporting Member
Join Date: Apr 2004
Location: Israel
Posts: 615

Can you upload the code?

Which PLC are you using?

Member
Join Date: Nov 2011
Location: Aurangabad
Posts: 9

I am using CPU PM571, with CD522, DC522, AX521 modules.

Code is attached here with

Member
Join Date: Dec 2012
Location: Koprivnica, HR
Posts: 418
Quote:
Originally Posted by kam

Error4268:RECIPE(32):Expression expected.
Error4052:RECIPE(32):»must be a declared instance of function block’ADDSUB’

Please help me on this. How to remove this error?

First error was probably due to forgotten semicolon at the end or = instead of :=

Second error: you forgot to declare function block instance as variable:

balash
View Public Profile
Find More Posts by balash

Member
Join Date: Nov 2011
Location: Aurangabad
Posts: 9

I checked program many times, we have given all necessary punctuation marks. Also we have declared each function block.

For ex. TRAVERS_MTR: AC500_REAL_AO;
SPOOLADD: ADDSUB;

Attached Files

Program.zip (40.2 KB, 17 views)

Member
Join Date: Dec 2012
Location: Koprivnica, HR
Posts: 418

well i can’t really much compile cause i have codesys integrated with control builder, and i miss lots of your custom libraries and PLC conf but.
if i am not wrong i think you forgot to name the instance of «addsub» box in rung 32. every functionblock box must have instance that is name of the functionblock box.

that would solve one problem i guess.

not much help with second problem cause i’m cripled without conf and libs needed.

balash
View Public Profile
Find More Posts by balash

Member
Join Date: Nov 2011
Location: Aurangabad
Posts: 9

Thanks for your reply.

I have resolved all the errors by following steps.

1. If you observe the PLC configuration you won’t found CD522 module, so to insert this module I upgraded my CoDeSys.

2. The programmer have declared the Function Blocks by some variable name, but forgot to give that variable name to certain block.
For ex. in OUTPUT (11) he used AC500_REAL_AO, but didn’t give the variable name to this function block, but he declared this block by ‘LEFT SPOOLER3’. So I give the same name to function block. and Bingo.

But not while going online I am going through a error. I have attached this for reference.

Читайте также:

  • Плач ярославны что значит выражение
  • Я в курсе выражение
  • Живет же горстка людей откуда фраза
  • Примером применения нормативного подхода в макроэкономическом анализе являются высказывания что
  • В жизни шура человеку должно повезти три раза откуда фраза

Понравилась статья? Поделить с друзьями:
  • Ошибка bsod после обновления windows 10
  • Ошибка bx shellext gettempfilename failed
  • Ошибка brp p1614
  • Ошибка c0031 mercedes
  • Ошибка bsod system service exception