CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 42
Текст из файла (страница 42)
Writing is done wordby word.Command Format@x 101 x 100Node no.WHHeadercodex 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160Beginning word*↵Write data (1 word)FCSTerminatorWrite data(for no. of words to write)Note Beginning word:0000 to 0019Response FormatAn end code of 00 indicates normal completion.@x 101 x 100Node no.ParametersHx 161 x 160HeadercodeEnd codeWFCS↵TerminatorWrite Data (Command)Specify in order the contents of the number of words to be written to the HR areain hexadecimal, starting with the specified beginning word.Note If data is specified for writing which exceeds the allowable range, an error will begenerated and the writing operation will not be executed.
If, for example, 18 isspecified as the beginning word for writing, and three words of data are specified, then 20 will become the last word for writing data, and the command will notbe executed because HR 20 is beyond area boundary.259SectionHost Link Commands4-54-5-11 PV WRITE – WCWrites the PVs (present values) of timers/counters starting from the specifiedtimer/counter.Command Format@x 101 x 100Node no.Wx 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100CHeadercodeBeginning timer/counter*Write data (1 timer/counter)↵TerminatorFCSWrite data(for no.
of PV to write)Note1. Beginning T/C: 0000 to 0255 in CPM2A/CPM2C PCs, 0000 to 0127 inCPM1/ CPM1A/SRM1(-V2) PCs2. Divide the command when writing more than 29 words of data.Response FormatAn end code of 00 indicates normal completion.@x 101 x 100WNode no.ParametersCHeadercodex 161 x 160End code↵FCSTerminatorWrite Data (Command)Specify in decimal numbers (BCD) the present values for the number of timers/counters that are to be written, starting from the beginning timer/counter.Note1. When this command is used to write data to the PV area, the CompletionFlags for the timers/counters that are written will be turned OFF.2.
If data is specified for writing which exceeds the allowable range, an errorwill be generated and the writing operation will not be executed. If, for example, 126 is specified as the beginning word for writing in a CPM1 PC, andthree words of data are specified, then 128 will become the last word for writing data, and the command will not be executed because TC 128 is beyondarea boundary.4-5-12 TC STATUS WRITE – WGWrites the status of the Completion Flags for timers and counters in the TC area,starting from the specified timer/counter (number). Writing is done number bynumber.Command Format@x 101 x 100WNode no.GHeadercodex 103 x 102 x 101 x 100 ON/OFFBeginning timer/counter*FCS↵TerminatorWrite data(1 timer/counter)Write data(for number of TC to write)Note1. Beginning T/C: 0000 to 0255 in CPM2A/CPM2C PCs, 0000 to 0127 inCPM1/ CPM1A/SRM1(-V2) PCs2.
Divide the command when writing the status of more than 118 timer/counters.260SectionHost Link CommandsResponse Format4-5An end code of 00 indicates normal completion.@x 101 x 100Node no.ParametersWGHeadercodex 161 x 160End codeFCS↵TerminatorWrite Data (Command)Specify the status of the Completion Flags, for the number of timers/counters tobe written, in order (from the beginning word) as ON (i.e., “1”) or OFF (i.e., “0”).When a Completion Flag is ON, it indicates that the time or count is up.Note If data is specified for writing which exceeds the allowable range, an error will begenerated and the writing operation will not be executed.
If, for example, 126 isspecified as the beginning word for writing in a CPM1 PC, and three words ofdata are specified, then 128 will become the last word for writing data, and thecommand will not be executed because TC 128 is beyond area boundary.4-5-13 DM AREA WRITE – WDWrites data to the DM area, starting from the specified word. Writing is doneword by word.Command Format@x 101 x 100Node no.WDHeadercodeNoteResponse Formatx 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160Beginning word*Write data (1 word)↵TerminatorFCSWrite data(for number of words to write)1. Beginning word:DM 0000 to DM 1023 and DM 6144 to DM 6655 in CPM1/CPM1A PCsDM 0000 to DM 2047 and DM 6144 to DM 6655 in CPM2A/CPM2C/SRM1(-V2) PCs2.
Divide the command when writing more than 29 words of data.An end code of 00 indicates normal completion.@x 101 x 100Node no.Dx 161 x 160HeadercodeEnd codeWFCS↵TerminatorNote Words DM 1024 to DM 6143 in CPM1/CPM1A PCs and words DM 2048 toDM 6143 in CPM2A/CPM2C/SRM1(-V2) PCs cannot be specified. If an attemptis made to write to any of these words, the writing operation will not be executedfor these words and the command will end normally.ParametersWrite Data (Command)Specify in order the contents of the number of words to be written to the DM areain hexadecimal, starting with the specified beginning word.Note1. If data is specified for writing which exceeds the allowable range, an errorwill be generated and the writing operation will not be executed.
If, for example, 1022 is specified as the beginning word for writing in a CPM1 PC, andthree words of data are specified, then 1024 will become the last word forwriting data, and the command will not be executed because DM 1024 isbeyond the writable range.2. Be careful about the configuration of the DM area, as it varies depending onthe CPU Unit model.261SectionHost Link Commands4-54-5-14 AR AREA WRITE – WJWrites data to the AR area, starting from the specified word.
Writing is done wordby word.Command Format@x 101 x 100Node no.WJx 103 x 102 x 101 x 100 x 163 x 162 x 161 x 160HeadercodeBeginning word*Write data (1 word)↵TerminatorFCSWrite data(for the number of words to write)Note Beginning word: 0000 to 0023 in CPM2A/CPM2C PCs, 0000 to 0015 inCPM1/CPM1A and SRM1(-V2) PCsResponse FormatAn end code of 00 indicates normal completion.@x 101 x 100Node no.ParametersJx 161 x 160HeadercodeEnd codeW:FCS↵TerminatorWrite Data (Command)Specify in order the contents of the number of words to be written to the AR areain hexadecimal, starting with the specified beginning word.Note If data is specified for writing which exceeds the allowable range, an error will begenerated and the writing operation will not be executed.
If, for example, 12 isspecified as the beginning word for writing in a CPM1 PC, and five words of dataare specified, then 16 will become the last word for writing data, and the command will not be executed because AR 16 is beyond the writable range.4-5-15 SV READ 1 – R#Searches for the first instance of a timer or counter instruction (TIM, TIMH(15),TIML(––), TMHH(––), CNT, or CNTR(12)) with the specified TC number in theuser’s program and reads the PV, which is assumed to be set as a constant. TheSV that is read is a 4-digit decimal number (BCD). The program is searched fromthe beginning, which may take as much as 10 seconds to produce a response.Command Format@x 101 x 100Node no.R#OP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100HeadercodeNameTC number*↵TerminatorFCSNote TC number: 0000 to 0255 in CPM2A/CPM2C PCs and 0000 to 0127 inCPM1/CPM1A/SRM1(-V2) PCsResponse Format@x 101 x 100Node no.262R#Headercodex 161 x 160 x 103 x 102 x 101 x 100End codeSVFCS↵TerminatorSectionHost Link CommandsParameters4-5Name, TC Number (Command)Specify the instruction for reading the SV in “Name.” Make this setting in 4 characters.
In “TC number,” specify the timer/counter number used for the instruction.NameOP1OP2Instruction nameTIOP3MOP4(Space) TIMERTIMHHIGH-SPEED TIMERTIMLLONG TIMERTMHHVERY HIGH-SPEED TIMERCNT(Space) COUNTERCNTRREVERSIBLE COUNTERSV (Response)The constant SV is returned.Note1. The instruction specified under “Name” must be in four characters.2. If the same instruction is used more than once in a program, only the first onewill be read.3. Use this command only when it is definite that a constant SV has been set.4. The response end code will indicate an error (16) if the SV wasn’t entered asa constant.4-5-16 SV READ 2 – R$Reads the constant SV or the word address where the SV is stored.
The SV thatis read is a 4-digit decimal number (BCD) written as the second operand for theTIM, TIMH(15), TIML(––), TMHH(––), CNT, or CNTR(12) instruction at the specified program address in the user’s program. This can only be done with a program of less than 10K.Command Format@x 101 x 100Node no.R$x 103 x 102 x 101 x 100 OP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100HeadercodeProgramaddressNameTC number*FCS↵TerminatorNote TC number: 0000 to 0255 in CPM2A/CPM2C PCs and 0000 to 0127 inCPM1/CPM1A/SRM1(-V2) PCsResponse Format@x 101 x 100Node no.An end code of 00 indicates normal completion.R$Headercodex 161 x 160 OP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100End codeOperandSVFCS↵Terminator263SectionHost Link CommandsParameters4-5Name, TC Number (Command)Specify the name of the instruction for reading the SV in “Name.” Make this setting in 4 characters.