NS 宏指令参考 触摸屏功能及应用手册.pdf

guangrongpr 25 0 PDF 2020-07-31 01:07:04

NS 宏指令参考-触摸屏功能及应用手册pdf,NS 宏指令参考-触摸屏功能及应用手册Section 1 Outline of macro functionNS series Macro ReferenceMacros can be created for each project, screen, and functional objects. also they can becreated for the following execution conditionsExecuting conditions for the projectMacro execution conditions that can be made for the project are indicated belowSelect [PT]-[Project Properties]-[Macro]tab in CX-Designer, then set execution condition andrecord macroFor details on registering macros, refer to the online CX-Designer Help System Settings andProject PropertiesExecution conditionExplanationWhen Loading a ProjectExecute just before loading the first screen afterstarting up ns-HardwarON timing Alarm/EventExecute when alarm is occurredoccurredON timing Alarm/Event is Execute when alarm is cancelledcanceledWhen a bit changedSet macro to execute when the address of specifiebit type is changed. Up to 10 macros can be setWhen a value changedSet macro to execute when the address of specifiedword type is changed. Up to 10 macros can be setExecution conditions for the screenMacro execution conditions that can be made for each screen are indicated belowSelect [PT]-[Screen/Sheet Properties]-[Macro] tab screen in CX-Designer, then set executioncondition and record macroFor details on registering macros, refer to the online CX-Designer Help 'Creating ScreensExecution conditionExplanationWhen Loading a screenExecute immediately after reading screen data todisplay the nextWhen Unloading a Screen Execute immediately after closing the current screenSection 1 Outline of macro functionNS series Macro ReferenceEMacros are executed by the timing as shown belowNS series. NSJ series and nsh seriesWhen loading a screeWhen unloading a screen(Execute at the destination(Execute at the destinationscreen)screenUser screen->User screenExecutedExecutedUser screen->Transfer screen Not ExecutedExecutede User screen->System menu Not ExecutedExecutedSystem menu->User screen ExecutedNotEⅹ cuterUser screen->Screen Saver Not ExecutedNot executedScreen Saver->User screen Not ExecutedNot ExecutedNS-RuntimeWhen loading a screenWhen unloading a screen(Execute at the destination(Execute at the destinationscreen)screena User screen->User screenExecutedExecutedUser screen->Transfer screen Not ExecutedExecutedUser screen-> System menu Not ExecutedExecutedSystem menu->User screenExecutedNot executedUser screen->Screen Saver Not ExecutedNot executedScreen Saver->User screen Not ExecutedNot executedWhen exiting ns-RuntimeExecutedSection 1 Outline of macro functionNS series Macro ReferenceExecution conditions for the functional objectsMacro execution conditions that can be made for each functional object are described in thefollowing tableOpen property dialog for each functional object and select [Macro] tab page, then set theexecution condition and create macroFor details on registering macros, refer to the online CX-Designer Help ' Creating FunctionalbjectsExecution conditionExplanationTouch on TimingExecute when functional object is pressed.Touch off TimingExecute when functional object is releasedBefore Inputting numeral or character Execute just before display tenkey pad or virtuastringkeyboard for inputting values or stringsBefore Writing numeral or characterExecute just before notice numeral and characterstringstring to the hostWhen changing numeral and character Execute when changing the value of addressstring and comparing numeralWhen Processing display areaExecute when display area for alarm display ispressedWhen Selecting an alarm/EventExecute just after select each alarm/event displayedon Alarm/Event SummaryWhen selecting a listExecute just after select a list displayed on the listSelectionIf the password is set for functional objects the following macros are executed afterinputting the password. If the password has been cancelled for inputting, macros will notbe executedTouch on/Touch off timingBefore inputting Numeral/ Character stringWhen pressing Display AreaWhen selecting an alarm/EventWhen selecting a listSection 1 Outline of macro functionNS series Macro ReferenceThe following conditions can be selected for functional objectsoc3Functional object935D3∽oo≤ON/OFF ButtonOKOKWord buttonOKOKCommand buttonOKOKBit LampOKWord LampOKNumeral Display&InputOKOKOKString display InputOKOKOKThumbwheel switchOKOKTextList selectionOKLevel meterBroken-line GraphBitmapAnalogue MeterVideo DisplayDateTimeData Log graphData block TableOKOKTemporary InputConsecutive linedrawingDocument DisplayMultifunction ObjectOKOKOKContents Display[Alarm/Event objectFunctional ObjectWhen Pressing a Display Area When selecting an Alarm/EventAlarm/Event DisplayOKAlarm/Event SummaryOKSection 1 Outline of macro functionNS series Macro ReferenceWhen a command button is set in the following functions, macros that are set atthe touch on will be executed at the touch off. macros that are set at the off willnot be executedSwitch screenControl pop-up screenDisplay system menuData block controWhen functions other than above are selected macros will be executed at thespecified timingDocument Display is a functional object that can be used only with NS-Runtime.Section 1 Outline of macro functionNS series Macro ReferenceThis section describes macro creation procedures and programming termsThe Method for Writing a macroDelimiter of the ProgramPut a semicolon( at the end of each program as a delimiter. However, it is notnecessary for IF O, ELSEIF (, ELSEO,ENDIFExample$Wo=2;IF (SWO>=10$W5=$W0-$W2;ELSEW5=$W0+SW2ENDIFCommentPut single quotation mark at the beginning of the sentence when you add the commentfor each program From single quotation mark o to the end of character sting will beregarded as a commentExampleSW0=100 'CommentCommentF(SW1==200)Writing Programming TermsBoth uppercase and lowercase can be used for programming macros because they arenot classifiedExampleMove Popw Down( and MOVEPOPWDOWNO are regarded as same function[Host 1: DMOJand [host 1: dmo] are regarded as same host addressSection 1 Outline of macro functionNS series Macro ReferenceProgramming termsThis section describes terms used in this functionVariableThe following variables can be used in macro programemExplanationHostUse functions(READCMEM and WritECMEM) for communication whenaddressaccessing to the address in the hostEnclose address in [IExampleREADCMEM(SW100, [HOST1: DM00000], 100)Read Host1: DM00000 to dM00099 to sW100 to $W199PT MemoryBitInternal memory: $BSB0 to $B32767(1 bit per 1pointInternal Holding memory: Shb shbo to $HB8191(1 bit per 1point)System Memory $SBSSBO to SSB 63(1bit per 1point)Internal memory: $WSW to $w32767(16bit per 1pointInternal Holding memory: SHW $ HWo to SHW 8191(16bit per 1 point)System Memory: SSWSSWO to SSW39(16bit per 1 pointExampleSW100=SW0+1: 'Set the value swo and 1 added to sw100IndexIndex is used for processing bit and word in the pt memoryAdd index to the end of the address and it will processed as [specifiedaddress index valueThere are 10 index points(i0 to 19)Set 10 to 19 for the value of sw27 to SSw36ExampleSW27=H20;$WOI0= 123; $W0I0 is regarded as $W20 added $WO and 20W20=123Qualifier of∨ ariableQualifiers set for variables must be used as shown belowQualifiers are used when performing 32-bit data processing and numeral processing for bitItemExplanationLong Access Put"L"at the end of variable Uses 2 words(32bit) ofWord(16bit)SWOL=1000000; 'Accesses regarding SWO, SW1 as 32-bitSW100L=1000*1000; 'Accesses regarding $ W100, W101 as 32-bitNumeralPut: n "at the end of variable. Specify the value of bit address(up to 32Access of Bit by 4-bit unit)for"nEXceptions: If n=16, input Wfn=32, input“L$B04=3;Sets 3(0011)for 4-bit from $BO to $B3$BOW=12345;“Sets12345(0011000000111001)for16- bit from$B0to$B15Section 1 Outline of macro functionNS series Macro ReferenceConstantUsable constants for macro program and procedure are described in the following tableItemExplanationDecimal constant32768 to 32767 can be input when using word(16-bit2147483648 to 2147483647 can be input when using 2words(32-bit)Hexadecimal constant HO to HFFFF can be input when using word(16-bitHo to HFFFFFFFF can be input when using 2 words( 32-bitCharacter StringEnclose in““E.g. ABCDEBranchesThe following keywords can be used for specifying conditionsItemExplanationFEnclose conditional expressions in parentheses o after the IF andELSEIFELSEIFELSEAlways use ENdIF at the end. Up to 8 nests can be inputENDIFThere is no restrictions for inputting the number of lines under IFsentence. However the total number of characters used in wholemacro must be no more than 3000 charactersEF($W100==1)If W100 is 1$W99=1ELSE|F($W100==2)if sw100 is 2$W99=2;ELSEif SW100 is other than 1 or 2$W99=3;ENDIF

NS 宏指令参考 触摸屏功能及应用手册.pdf

用户评论
请输入评论内容
评分:
暂无评论