4000-520-616
欢迎来到免疫在线!(蚂蚁淘生物旗下平台)  请登录 |  免费注册 |  询价篮
主营:原厂直采,平行进口,授权代理(蚂蚁淘为您服务)
咨询热线电话
4000-520-616
当前位置: 首页 > 新闻动态 >
新闻详情
老外写的ST语言教程-很详细.pdf_st语言基础教程,st编程语言详解...
来自 : CSDN技术社区 发布时间:2021-03-24
HardwareThe programming language ST is only available for following programmable controllersSupernodepco compactSupernodTo support sT language bios version must greater than 5.0SoftwareUse a version of 1tool =21xCARELCreation of a solution ST LanguageProject creation wizardPropertiesGeneral project properties⊙ ApplicationModuleO FBD.Funtional Block DiagramProject nameCourse○ST· Structured TextChoosingFBD, the application will be \'mixed, it will consist of amain with Atoms macroblocks.. but you can useroutines(functions and function blocks )written in the STST, the application will be developed entirely using STanguageCARELBasic conceptsWhen programming in St, the application can be organised using three fundamental programmingelements generically called Program Organization Units(POu)PROGRAM· FUNCTIONPROGRAMFUNCTION BLOCKMain programFUNCTIONBLOCKFunctionblockFUNCTIONFunctonPOU type KeywordDescriptionProgramPROGRAM mainMain program that includesread/ write I/odefinition of local variablesEND PROGRAMcalls to functions or function blocksFunctionFUNCTIONST statements block with input variableslocal variables and if specified a returnvalue. This can be called at differentpoints of the program. Recursion is notEND FUNCTIONallowedFunctionFUNCTION BLOCKST statements block with input variablesblocklocal variables, and output variables. Thisan be called at different points of theEND FUNCTION BLOCKprogram. Recursion is not allowedNote: we can define more functions and function blocks, but only one program mainCARELThe basic typesThe following table lists all the properties of basic types (ectype)KeywordData typeLower limitUpper limitMemorySpaceBooleanFALSE(O)TRUE(1)8 BitBit string8 BitBitstring.Bit string6553516 BitDWORDBit string4.294.967.232 BitShort Integer8 BitUSINTUnsigned8 BitShort IntegerInteger327683276716 BitUnsigned6553516 BitIntegersIntegerDouble(2^31)-132 BitIntegerUDINTUnsigned2^32-132 BitDoubleIntegerReal Number-10A3810~3832 BitCARELDeclaration of global variablesThere are two ways to declare global variables:· Variab/ e ListVariable List [new_projectTextual mode of st languageA口Ay区pE[uee1D VAR GLOBALPressure: REALEnab⊥e:BooLNote: if you want to see the variable in the pGD, please declare theFan speed: INT:variable in the variable list5:L END VARGlobal variables declarationVariable listTextual modeIECTypeButton userButton ExtendYou don\'t seetheseCareIType\'variables in IECTypeVariable liste Boolean●REAL工 nteger/ AnalogUsable only in theStrategy Editor ST(no: MASK, FBDUsable in anyStrategy Editor)CARELenvironmentAssignment operator : EAssign to a variable:a constant valueSetpoint: =22.5;the value of another variableSetpoint: =old setpoint;the result of an expressionSetpoint: =Setpoint +0.5;SyntaxAssignment operatorStatement terminatorIn assignment operations : the variablesVaraible name : expression iinvolved must all be the same type, eachstatement must use , as the statementote: there is a: in the end of statementterminatorIn assignment operations with BOOL values, 1 or TRUE, or o orFALSE can be used indifferentlyCARELTextual declarationo declare variables in ST you have to use the following declaration blockSyntaxDescritionGloabal VAR_GLOBAL Declares a group of global variables, shared byprogram, functions or function blocks.END VARDeclares a group of local variables to a program,function or function blockEND VARNote: 1. there is no i in the end of END VAR;2. we can give the default value in the declaration.Global varia bles declared in text mode will not be visible in the variable listCARELRules of the identifiers (variables name)The name of an identifier(variable or constant) can be any combination(see Example) of thecharacters listed belowExampleRules to create identifiersValidInvalididentifiersidentifiersThe 1st character must not benumerIcsexitsexit 1is not included in the set ofcharactersEnrg offEnrg offSpaces are not allowedDrillOnly single underscores_areallowedValve, VALveNot case-sensitiveThe variable names are not case-sensitive valye valvee valve are thesame variableCAREL ...展开详情

本文链接: http://stst.immuno-online.com/view-685804.html

发布于 : 2021-03-24 阅读(0)
公司介绍
品牌分类
食品添加剂
联络我们
服务热线:4000-520-616
(限工作日9:00-18:00)
QQ :1570468124
手机:18915418616
官网:http://