CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 43
Текст из файла (страница 43)
In “TC number,” specify the timer/counter number used bythe instruction.NameOP1OP2Instruction nameTIMOP3OP4(Space)TIMERTIMHHIGH-SPEED TIMERTIMLLONG TIMERTMHHVERY HIGH-SPEED TIMERCNT(Space)COUNTERCNTRREVERSIBLE COUNTEROperand, SV (Response)The name that indicates the SV classification is returned to “Operand,” and either the word address where the SV is stored or the constant SV is returned to“SV.”OperandOP1 OP2OP3ClassificationOP4Constant or word addressCIOLR(Space) (Space) LRCPM2A/CPM2C PCs0000 to 00490200 to 02550000 to 0015HR(Space) (Space) HR0000 to 00190000 to 0019AR(Space) (Space) AR0000 to 00230000 to 0015DM(Space) (Space) DM0000 to 66550000 to 6655DM(Space) DM (indirect)0000 to 66550000 to 6655CON(Space) Constant0000 to 99990000 to 9999(Space) IR or SRCPM1 PCs0000 to 00190200 to 02550000 to 0015Note The instruction name specified under “Name” must be in four characters.
Fill anygaps with spaces to make a total of four characters.4-5-17 SV CHANGE 1 – W#Searches for the first instance of the specified TIM, TIMH(15), TIML(––),TMHH(––), CNT, or CNTR(12) instruction in the user’s program and changesthe SV to new constant SV specified in the second word of the instruction. Theprogram is searched from the beginning, and it may therefore take approximately 10 seconds to produce a response.Command Format@x 101 x 100Node no.W#HeadercodeOP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100 x 103 x 102 x 101 x 100NameTC number*SV (0000 to 9999)FCS↵TerminatorNote TC number: 0000 to 0255 in CPM2A/CPM2C PCs and 0000 to 0127 inCPM1/CPM1A/SRM1(-V2) PCsResponse FormatAn end code of 00 indicates normal completion.@x 101 x 100Node no.264W#Headercodex 161 x 160End codeFCS↵TerminatorSectionHost Link CommandsParameters4-5Name, TC Number (Command)In “Name,” specify the name of the instruction, in four characters, for changingthe SV.
In “TC number,” specify the timer/counter number used for the instruction.Instruction nameOP1OP2ClassificationOP3TIMOP4(Space)TIMHHIGH-SPEED TIMERTIMLLONG TIMERTMHHVERY HIGH-SPEED TIMERCNT(Space)COUNTERCNTRREVERSIBLE COUNTERTIMER4-5-18 SV CHANGE 2 – W$Changes the contents of the second word of the TIM, TIMH(15), TIML(––),TMHH(––), CNT, or CNTR(12) at the specified program address in the user’sprogram. This can only be done with a program of less than 10K.Command Format@x 101 x 100Node no.W$x 103 x 102 x 101 x 100 OP1 OP2 OP3 OP4HeadercodeProgramaddressx 103 x 102 x 101 x 100NameTC numberOP1 OP2 OP3 OP4x 103 x 102 x 101 x 100OperandSVFCS↵TerminatorNote TC number: 0000 to 0255 in CPM2A/CPM2C PCs and 0000 to 0127 inCPM1/CPM1A/SRM1(-V2) PCsResponse FormatAn end code of 00 indicates normal completion.@x 101 x 100Node no.ParametersW$Headercodex 161 x 160End codeFCS↵TerminatorName, TC Number (Command)In “Name,” specify the name of the instruction, in four characters, for changingthe SV.
In “TC number,” specify the timer/counter number used for the instruction.Instruction nameOP1OP2OP3ClassificationTIMOP4(Space)TIMERTIMHHIGH-SPEED TIMERTIMLLONG TIMERTMHHVERY HIGH-SPEED TIMERCNT(Space)COUNTERCNTRREVERSIBLE COUNTER265SectionHost Link Commands4-5Operand, SV (Response)In “Operand,” specify the name that indicates the SV classification.
Specify thename in four characters. In “SV,” specify either the word address where the SV isstored or the constant SV.OperandOP1OP2OP3CIOLRHAConstant or word addressClassificationOP4(Space) (Space) LRCPM2A/CPM2C PCs0000 to 00490200 to 02520000 to 0015CPM1/CPM1A/SRM1(-V2) PCs0000 to 00190200 to 02520000 to 0015R(Space) (Space) HR0000 to 00190000 to 0019R(Space) (Space) AR0000 to 00230000 to 0015DM(Space) (Space) DMDM(Space) DM (indirect)CON(Space) Constant0000 to 20476144 to 66550000 to 20476144 to 66550000 to 99990000 to 1023*6144 to 66550000 to 1023*6144 to 66550000 to 9999(Space) IR or SRNote *For SRM1(-V2) PCs, the DM range is from 0000 to 2047.4-5-19 STATUS READ – MSReads the PC operating conditions.Command Format@x 101 x 100Node no.Response Format@x 101 x 100Node no.266MSHeadercodeFCS↵TerminatorAn end code of 00 indicates normal completion.MSHeadercodex 161 x 160 x 163 x 162 x 161 x 160 16 charactersEnd codeStatus dataMessageFCS↵TerminatorSectionHost Link CommandsParametersStatus Data, Message (Response)“Status data” consists of four digits (two bytes) hexadecimal.
The leftmost byteindicates CPU Unit operation mode, and the rightmost byte indicates the size ofthe program area.x 163Bit 154-5141300x 1621211100098Bit1: Fatal error generated1: FALS generatedOperation mode9800PROGRAM mode10RUN mode11MONITOR modex 161Bit765This area is differentfrom that of STATUSWRITE.x 160431Bit210000Program area654000None0014 Kbytes0108 KbytesProgram area write-protection0: Write-protected1: Not write-protectedThe “Message” parameter is a 16-character message that exists when MSG(47)has been executed.
When there is no message, this parameter is omitted.4-5-20 STATUS WRITE – SCChanges the PC operating mode.Command Format@x 101 x 100Node no.Response FormatSCHeadercodex 161 x 160Mode dataFCS↵TerminatorAn end code of 00 indicates normal completion.@x 101 x 100Node no.SCHeadercodex 161 x 160End codeFCS↵Terminator267SectionHost Link CommandsParameters4-5Mode Data (Command)“Mode data” consists of two digits (one byte) hexadecimal. With the leftmost twobits, specify the PC operating mode. Set all of the remaining bits to “0.”x 161x 160Bit 76543200000010BitOperation mode10001011PROGRAM modeMONITOR modeRUN modeThis area is differentfrom that of STATUSREAD.4-5-21 ERROR READ – MFReads and clears errors in the PC.
Also checks whether previous errors havebeen cleared.Command Format@x 101 x 100Node no.Response Format@x 101 x 100Node no.Parameters268MFHeadercodex 101 x 100Error clearFCS↵TerminatorAn end code of 00 indicates normal completion.MFHeadercodex 161 x 160 x 163 x 162 x 161 x 160 x 163 x 162 x 161 x 160End codeError information(1st word)Error information(2nd word)FCS↵TerminatorError Clear (Command)Specify 01 to clear errors and 00 to not clear errors (BCD). Fatal errors can becleared only when the PC is in PROGRAM mode.Error Information (Response)The error information comes in two words.SectionHost Link Commands4-5CPM1/CPM1A/CPM2A/CPM2C PCs1st wordx 163Bit 1514x 16213121100010x 16198706x 160504321000000ON: Battery alarm (F7)ON: System error (FAL)ON: Memory error (Error code F1)ON: I/O bus error (Error code C0)ON: No end instruction error (FALS)ON: System error (FAL)2nd wordx 163Bit 15140013x 16212x 161111098000076x 160543210FAL, FALS No.
(00 to FF)ON: Cycle time overrun (Error code F8)ON: I/O Unit overflow (Error code E1)SRM1(-V2) PCs1st wordx 163Bit 1514x 16213121110900000x 16187x 16065432100000000ON: System error (FAL)ON: Memory error (Error code F1)ON: No end instruction error (FALS)ON: System error (FAL)2nd wordx 163Bit 151413000x 16212x 1611110980000765x 16043210FAL, FALS No. (00 to 99)ON: Cycle time overrun (Error code F8)4-5-22 FORCED SET – KSForce sets a bit in the IR, SR, LR, HR, AR, or TC area. Just one bit can be forceset at a time.Once a bit has been forced set or reset, that status will be retained until aFORCED SET/RESET CANCEL (KC) command or the next FORCED SET/RESET command is transmitted.269SectionHost Link Commands4-5Command Format@x 101 x 100Node no.KSHeadercodeResponse FormatOP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100 x 101 x 100NameWordaddressBitFCS↵TerminatorAn end code of 00 indicates normal completion.@x 101 x 100Node no.ParametersKSHeadercodex 161 x 160End codeFCS↵TerminatorName, Word address, Bit (Command)In “Name,” specify the area (i.e., IR, SR, LR, HR, AR, or TC) that is to be forcedset.
Specify the name in four characters. In “Word address,” specify the addressof the word, and in “Bit” the number of the bit that is to be forced set.NameOP3Word address setting rangeClassificationOP1OP2OP4CIO(Space) IR or SRLHATTTTCCRRRIIIMNN(Space)(Space)(Space)MMMHTT(Space)(Space)(Space)(Space)HLH(Space)RLRHRARCompletion Flag (timer)Completion Flag (high-speed timer)Completion Flag (long timer)Completion Flag (very high-speed timer)Completion Flag (counter)Completion Flag (reversible counter)CPM2A/CPM2C PCs0000 to 00490200 to 02520000 to 00150000 to 00190000 to 00230000 to 0255CPM1/ CPM1A/SRM1(-V2) PCs0000 to 00190200 to 02520000 to 00150000 to 00190000 to 00150000 to 0127Bit00 to 15(decimal)Always00Note The area specified under “Name” must be in four characters.
Add spaces afterthe data area name if it is shorter than four characters.4-5-23 FORCED RESET – KRForce resets a bit in the IR, SR, LR, HR, AR, or TC area. Just one bit can be forcereset at a time.Once a bit has been forced set or reset, that status will be retained until aFORCED SET/RESET CANCEL (KC) command or the next FORCED SET/RESET command is transmitted.Command Format@x 101 x 100Node no.Response FormatKRHeadercodeNameWordaddressBitFCSx 101 x 100Node no.KRHeadercodex 161 x 160End codeFCS↵TerminatorAn end code of 00 indicates normal completion.@270OP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100 x 101 x 100↵TerminatorSectionHost Link CommandsParameters4-5Name, Word address, Bit (Command)In “Name,” specify the area (i.e., IR, SR, LR, HR, AR, or TC) that is to be forcedreset.
Specify the name in four characters. In “Word address,” specify the address of the word, and in “Bit” the number of the bit that is to be forced reset.NameWord address setting rangeClassificationOP1OP2OP3OP4CIO(Space) IR or SRLHATTTTCCRRRIIIMNN(Space)(Space)(Space)MMMHTT(Space)(Space)(Space)(Space)HLH(Space)RLRHRARCompletion Flag (timer)Completion Flag (high-speed timer)Completion Flag (long timer)Completion Flag (very high-speed timer)Completion Flag (counter)Completion Flag (reversible counter)BitCPM2A/CPM2C PCsCPM1/CPM1A/SRM1(-V2)PCs0000 to 00490200 to 02520000 to 00150000 to 00190000 to 00230000 to 02550000 to 00190200 to 02520000 to 00150000 to 00190000 to 00150000 to 012700 to 15(decimal)Always 00Note The area specified under “Name” must be in four characters.
Add spaces afterthe data area name if it is shorter than four characters.4-5-24 MULTIPLE FORCED SET/RESET – FKForce sets, force resets, or cancels the status of the bits in one word in the IR,SR, LR, HR, AR, or TC area.Command Format@x 101 x 100Node no.FKHeadercodeOP1 OP2 OP3 OP4 x 103 x 102 x 101 x 100NameWordaddressForced set/reset/cancel datax 160 x 160 x 160 x 160 x 160 x 160x 160 x 160FCSBitResponse Format1514131211101↵Terminator0An end code of 00 indicates normal completion.@x 101 x 100Node no.FKHeadercodex 161 x 160End codeFCS↵Terminator271SectionHost Link CommandsParameters4-5Name, Word address (Command)In “Name,” specify the area (i.e., IR, SR, LR, HR, AR, or TC) that is to be forcedset or reset.