亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bascom-plc.bas

?? pic 單片機(jī) 的簡易PLC labplc.zip
?? BAS
字號:
'-----------------------------------------------------------------
'                1999 Mirko Bjelica, Yugoslavia
'
'                   Contact: mikanb@EUnet.yu
'
'                           Lab-PLC
'                           -------
'  This program is a part of whole laboratory PLC project which
'I realized as my final exam on Polytechnical Engeneering College.
'Lab-PLC has 4 inputs, 4 outputs and one timer and it is created
'for educational purposes. There is also 10 memory markers used
'as temporary bits between gates. At this moment Lab-PLC is installed
'at the college laboratory to controll one 3 phase electromotor. I used
'ATMEL's microcontroller AT89C2051 because of its simplicity and because it
'had enough I/O pins for this project. Project also includes software
'written in Visual Basic for DOS, which is used to load RAM memory of
'AT89C2051, PCB, Schematic and a user's manual.
'NOTE:
' Timer - Timer in PLC Device
'uTimer - Timer in AT89C2051 microcontroller
'Input_1, Input_2 - Two inputs of single logic gate or Timer (Input_1)
'Output_ - Output of logic gate or Timer
'-----------------------------------------------------------------

'Variable dimensioning
Dim Output_ As Bit , Input_1 As Bit , Input_2 As Bit , Temporary As Bit , Jump As Bit

Dim Working As Bit , Ctrlbit As Bit , Edge As Bit , Tmpmem As Byte , Interval As Byte

Dim K As Byte , Pc_input As Byte , Countr As Integer , Ir As Bit

Dim M0 As Bit : Dim M1 As Bit : Dim M2 As Bit : Dim M3 As Bit : Dim M4 As Bit

Dim M5 As Bit : Dim M6 As Bit : Dim M7 As Bit : Dim M8 As Bit : Dim M9 As Bit

O1 Alias P1.0 : O2 Alias P1.1 : O3 Alias P1.2 : O4 Alias P1.3

I1 Alias P1.4 : I2 Alias P1.5 : I3 Alias P1.6 : I4 Alias P1.7

'Initialization of uTimer
Config Timer0 = Timer , Gate = Internal , Mode = 2

On Timer0 Timer0_interapt

Load Timer0 , 250

Enable Interrupts

Enable Timer0

Priority Set Timer0

'Definition of Baud Rate for RS232 communication between PC and PLC
$baud = 4800
$crystal = 12000000

Set P3.7                                                      'Turn led "RECEIVED DATA" OFF

Reset P3.3                                                    'Led "READY FOR RECEIVING" starts to blink

P1 = &B11111111                                               'Clear all inputs and outputs

K = 67                                                        'RAM Memory address from where starts writing PLC program

Do                                                            'Routine for loading RAM memory
   Pc_input = Waitkey                                         'Wait for data
   mov R0,{k}                                                 'generating indirect address
   Acc = Pc_input                                             'proceed data to accumulator
   mov @R0,A                                                  'Write received data to indirectly addressed memory location
   inc k
Loop Until Pc_input = 99                                      'Code for "End Of Transfer"


Reset P3.7                                                    'Turn led "RECEIVED DATA" ON

Set P3.3                                                      'Led "READY FOR RECEIVING" stops to blink

Tmpmem = 0                                                    '{

Countr = 0                                                    '{

Jump = 0                                                      '{Initialization of used variables

Edge = 0                                                      '{

Ctrlbit = 0                                                   '{

Prgstart:                                                     'Inception

K = 66                                                        'address-1 because of increment in next subroutine

Gosub Readram                                                 'Go and read RAM memory

'Program
Nastavi:
'Detection of logic function and timer
Select Case Tmpmem
             Case 10 : Gosub Inputs                           'Take logic conditions of input1 and input2
                       Output_ = Input_1 And Input_2            'AND
                       Gosub Outp                             'Set output of current logic gate
                       Goto Checkend
             Case 11 : Gosub Inputs                           'Take logic conditions of input1 and input2
                       Output_ = Input_1 Or Input_2           'OR
                       Gosub Outp                             'Set output of current logic gate
                       Goto Checkend
             Case 12 : Gosub Inputs                           'Take logic conditions of input1 and input2
                       Output_ = Input_1
                       Output_ = Not Output_                  'NOT
                       Gosub Outp                             'Set output of current logic gate
                       Goto Checkend
             Case 13 : Gosub Inputs                           'Take logic conditions of input1 and input2
                       Output_ = Input_1 And Input_2
                       Output_ = Not Output_                  'NAND
                       Gosub Outp                             'Set output of current logic gate
                       Goto Checkend
             Case 14 : Gosub Inputs                           'Take logic conditions of input1 and input2
                       Output_ = Input_1 Or Input_2
                       Output_ = Not Output_                  'NOR
                       Gosub Outp                             'Set output of current logic gate
                       Goto Checkend
             Case 15 : Gosub Inputs                           'Take logic conditions of input1 and input2
                       Output_ = Input_1 Xor Input_2          'XOR
                       Gosub Outp                             'Set output of current logic gate
                       Goto Checkend
             Case 24 : Gosub Tajmer                           'TIMER
                       Gosub Outp                             'Set output of Timer
                       Goto Checkend

End Select

'Input detection
Inputs:
Gosub Readram                                                 ' /
Gosub Inpt                                                    '| Find first input of current log.gate
Input_1 = Temporary                                           ' \

Gosub Readram                                                 ' /
Gosub Inpt                                                    '| Find second input of current log.gate
Input_2 = Temporary                                           ' \
Return                                                        'Return from subroutine Inputs

'Finding if input in current log.gate is phisical input,phisical output or memory marker
Inpt:
Select Case Tmpmem
                Case 16 : Temporary = I1
                Case 17 : Temporary = I2
                Case 18 : Temporary = I3
                Case 19 : Temporary = I4
                Case 20 : Temporary = O1
                          Temporary = Not Temporary
                Case 21 : Temporary = O2
                          Temporary = Not Temporary
                Case 22 : Temporary = O3
                          Temporary = Not Temporary
                Case 23 : Temporary = O4
                          Temporary = Not Temporary
                Case 30 : Temporary = M0
                Case 31 : Temporary = M1
                Case 32 : Temporary = M2
                Case 33 : Temporary = M3
                Case 34 : Temporary = M4
                Case 35 : Temporary = M5
                Case 36 : Temporary = M6
                Case 37 : Temporary = M7
                Case 38 : Temporary = M8
                Case 39 : Temporary = M9
End Select
Return

'Finding if output from current log.gate is phisical output or memory marker
Outp:
Gosub Readram
Select Case Tmpmem
                Case 20 : Output_ = Not Output_
                          O1 = Output_
                Case 21 : Output_ = Not Output_
                          O2 = Output_
                Case 22 : Output_ = Not Output_
                          O3 = Output_
                Case 23 : Output_ = Not Output_
                          O4 = Output_
                Case 30 : M0 = Output_
                Case 31 : M1 = Output_
                Case 32 : M2 = Output_
                Case 33 : M3 = Output_
                Case 34 : M4 = Output_
                Case 35 : M5 = Output_
                Case 36 : M6 = Output_
                Case 37 : M7 = Output_
                Case 38 : M8 = Output_
                Case 39 : M9 = Output_
End Select
Return

'Timer routine
Tajmer:
Gosub Readram                                                 ' /
Gosub Inpt                                                    '| Find input of Timer
Input_1 = Temporary                                                 ' \

If Jump = 1 Then                                              'Control bit for bypassing Timer input scan when Timer Workings
               Goto L1
End If
Edge = Input_1
If Edge = 0 Then                                              'If input Timer input is low SET control bit
               Set Jump
End If
L1:
If Input_1 = 1 Then                                             'These are 3 conditions which have to be accomplished to start uTimer
               If Edge = 0 Then
                              If Working = 0 Then
                                          Start Timer0
                                          Set Working
                              End If
                              Goto L2
               End If
End If

Stop Timer0
Countr = 0                                                    'Reset elapsed time counter
Working = 0                                                   'Reset Timer condition bit
Output_ = 0                                                   'Reset output of Timer
Ctrlbit = 0

L2:
If Ctrlbit = 1 Then
               K = K + 1
          Else
               Gosub Readram
               Interval = Tmpmem
               Ctrlbit = 1
End If

If Interval = 0 Then
                     Stop Timer0
                     Countr = 0
                     Reset Output_
                     Jump = 0
                     Reset Working
                     Ctrlbit = 0
                Else
                If Working = 1 Then
                                 Set Output_
                            Else
                                 Reset Output_
                End If

End If

Return

'Checking if it is end of PLC program and if it is, go again from start
Checkend:
Gosub Readram
If Tmpmem = 99 Then
   Goto Prgstart
Else
   Goto Nastavi
End If

'Interrupt routine for Timer interval
Timer0_interapt:
Countr = Countr + 1                                           'Elapsed time counter
     If Countr = 4000 Then                                    '4000x250=1s
     Interval = Interval - 1                                  'Previously set interval by user
     Countr = 0                                               'Reset elapsed time counter
     End If
Return

'Routine for reading RAM memory in Execution mode
Readram:
        inc k                             'Increment address value
        mov R0,{k}                        'Move value to indirect address register
        mov A,@R0                         'Move value from addressed location to accumulator
        Tmpmem = Acc                                          'Store this value in temporary register because-
                                          'leaving data in accumulator can cause loss-
                                          'of that data while accumulator is used for other purposes
Return
End

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线一区二区观看| 欧美精品123区| 久久99精品网久久| 亚州成人在线电影| 亚洲色图一区二区三区| 欧美巨大另类极品videosbest | 亚洲国产成人一区二区三区| 欧美一区二区三区性视频| 日本高清视频一区二区| 成人av电影在线网| 成人av资源下载| 91丝袜美女网| 2020国产精品自拍| 蜜臀久久99精品久久久久久9 | 欧美一级精品在线| 国产精品一区二区在线看| 天使萌一区二区三区免费观看| 国产无一区二区| 精品精品欲导航| 欧美日韩一区二区电影| 色综合天天综合网天天狠天天 | 欧美午夜一区二区三区免费大片| 欧美日韩美女一区二区| 69堂精品视频| 欧美日韩国产首页| 91精品国产综合久久香蕉的特点| 欧美一区二区三区性视频| 日韩美女一区二区三区| 欧美一区二区在线免费观看| 久久亚洲综合色一区二区三区| 最新高清无码专区| 国产成人精品免费网站| 日产精品久久久久久久性色| 美女在线视频一区| 一本色道久久综合亚洲91 | 精品国产123| 亚洲大片一区二区三区| 成人一区在线观看| 日韩欧美国产午夜精品| 偷拍亚洲欧洲综合| 夜夜嗨av一区二区三区中文字幕| 日本一区二区免费在线| 欧美国产在线观看| 国产精品卡一卡二卡三| 国产目拍亚洲精品99久久精品| 国产一区二区按摩在线观看| 亚洲成人午夜电影| 成人性视频免费网站| 日韩欧美中文一区| 国产亚洲欧美一区在线观看| 免费在线观看精品| 国产一区视频网站| 成人免费的视频| 97成人超碰视| 91国偷自产一区二区开放时间 | 一区二区三区国产| 欧美色区777第一页| 欧美又粗又大又爽| 欧美猛男男办公室激情| 亚洲免费观看高清完整版在线观看 | 免费在线视频一区| 成人夜色视频网站在线观看| 久久久久久久免费视频了| 免费成人美女在线观看.| 欧美性大战久久久久久久蜜臀| 天天综合网天天综合色| 91色综合久久久久婷婷| 91精品福利在线一区二区三区| 日韩三级视频中文字幕| 日韩欧美视频一区| 欧美国产精品专区| 久久精品国产99| 国产米奇在线777精品观看| 欧美体内she精高潮| 亚洲成人av资源| 欧美美女视频在线观看| 日本最新不卡在线| 日韩精品一区二区在线观看| 久久爱www久久做| 亚洲国产精品成人综合| 91麻豆国产香蕉久久精品| 亚洲激情网站免费观看| 欧美揉bbbbb揉bbbbb| 图片区日韩欧美亚洲| 久久久综合九色合综国产精品| 国产精品影视天天线| 亚洲乱码精品一二三四区日韩在线 | 久久99久久精品| 欧美日本一区二区三区四区| 欧美岛国在线观看| 国产一区二区三区日韩| 国产91在线观看丝袜| 欧美视频日韩视频在线观看| 亚洲最大色网站| 粉嫩av一区二区三区粉嫩 | 欧美午夜电影网| 日本中文字幕一区| 91精彩视频在线| 中文字幕一区免费在线观看| 国产精品 欧美精品| 欧美日韩精品久久久| 一区二区三区不卡在线观看| 91最新地址在线播放| 亚洲成人在线观看视频| 久久久不卡网国产精品二区| 日本精品一区二区三区高清| 午夜精品久久久久久久久久久| 欧美成人精品二区三区99精品| 成人99免费视频| 激情图区综合网| 日日噜噜夜夜狠狠视频欧美人| 中文字幕一区二区三区在线不卡| 欧美一区二区在线免费观看| 一区二区成人在线观看| 中文字幕免费一区| 久久久久九九视频| 国产亚洲一二三区| 欧美成人国产一区二区| 91精品国产91综合久久蜜臀| 欧美日韩五月天| 欧美日免费三级在线| 欧洲亚洲精品在线| 日本久久电影网| 在线观看视频一区二区欧美日韩| 成人av动漫网站| 日本高清成人免费播放| 在线视频你懂得一区| 色久优优欧美色久优优| 欧美日韩精品一二三区| 91精品国产入口在线| 日韩久久免费av| 久久众筹精品私拍模特| 国产精品区一区二区三| 亚洲裸体在线观看| 亚洲国产精品传媒在线观看| 亚洲精品视频在线| 北条麻妃一区二区三区| 国产乱码精品一区二区三区五月婷| 国产一区二区三区av电影| 豆国产96在线|亚洲| 懂色av中文一区二区三区| 丁香天五香天堂综合| 亚洲福利视频三区| 丝袜a∨在线一区二区三区不卡 | 91福利精品视频| 欧美三级中文字| 91精品国产综合久久福利软件| 日韩欧美精品在线视频| 日韩一区二区免费在线电影| 99国产欧美另类久久久精品 | 亚洲欧美日韩在线不卡| 日韩福利电影在线| 91在线播放网址| 久久久国产午夜精品| 一区二区不卡在线视频 午夜欧美不卡在| 日本v片在线高清不卡在线观看| av福利精品导航| 久久综合中文字幕| 三级影片在线观看欧美日韩一区二区| 国产成人综合在线播放| 欧美日韩小视频| 亚洲精品国产a| 99久久综合狠狠综合久久| 久久毛片高清国产| 麻豆精品蜜桃视频网站| 欧美久久一二三四区| 一区二区成人在线视频| bt7086福利一区国产| 中文字幕一区二区视频| 成人高清av在线| 亚洲国产经典视频| 丁香桃色午夜亚洲一区二区三区| 精品成人在线观看| 国产一区二区不卡老阿姨| 精品久久国产字幕高潮| 精品在线一区二区三区| 在线电影院国产精品| 亚洲成人激情社区| 日韩一区二区三免费高清| 婷婷丁香久久五月婷婷| 欧美一级xxx| 国产精选一区二区三区| 国产三级精品三级| 91热门视频在线观看| 一级中文字幕一区二区| 欧美日韩国产bt| 国产麻豆一精品一av一免费| 久久精品视频在线看| 欧美一二三区在线观看| 美女视频黄免费的久久 | 欧美成人精品3d动漫h| 国产精品一二三在| 一级精品视频在线观看宜春院| 3d成人动漫网站| 成人午夜私人影院| 香蕉av福利精品导航| 亚洲国产经典视频| 欧美另类z0zxhd电影| 床上的激情91.| 麻豆91在线播放免费|