Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/18/03 12:03
Read: times


 
#50952 - RE: First Step....Mr. Fedia
Responding to: ???'s previous message
Hi Rashu,
it is maybe my fault, I should explain some more.
The example I gave is really an example. It has really these errors you had observed.
Why?
Let remember the basics of a programmable controller and how the 'user' program is handled.
Start:
Read all inputs (make input image)
Execute user program (work with image here)
Write the output image to the outputs
Go to Start

It is very rare case when a PLC will use the real inputs, usually in high speed routine, and this should be a subject of special attention by the programmer. "Real" outputs are usually not used by PLC program itself. In your case, if a NPN transistor is connected to P2.0, you really will read always 0 from P2.0 and this I think was discussed before on this forum.

lets see it. assume we have 16 inputs at P0 and P1, 8 outputs at P2
bIN_0 equ 020h ;in bit addressable space!
bIN_1 equ 021h ;
bOUT_0 equ 022h ;
Start equ bIN_0.0
Stop equ bIN_0.1
OVL equ bIN_0.2
K1 equ bOUT_0

begin:
; Read all inputs
mov A,P0
mov bIN_0,A
mov A,P1
mov bIN_1,A
;user program

;..Start.. Stop...OVL...........K1
;|---||-+---|/|----|/|----------( )----|
;| K1 |
;+---||-+


;with macros: in asm:
_RD Start mov C,Start
_OR K1 orl C,K1
_ANDNOT Stop anl C,/Stop
_ANDNOT OVL anl C,/OVL
_WRT K1 mov K1,C

;... more statements

;END2 user program
; Write the output image to the outputs
mov A,bOUT_0
mov P2,A
jmp begin

hope this helps,
regards,
Fedia


List of 53 messages in thread
TopicAuthorDate
PUT A PLC INTO YOUR MICROCONTROLLER !            01/01/70 00:00      
   RE: PUT A PLC INTO YOUR MICROCONTROLLER !            01/01/70 00:00      
      RE: PUT A into B!            01/01/70 00:00      
         RE: PUT A into B!            01/01/70 00:00      
            RE: PUT A into B!            01/01/70 00:00      
               RE: PUT A into B! Murugan & Rob            01/01/70 00:00      
         RE: PUT A into B!            01/01/70 00:00      
   RE: PUT A PLC INTO YOUR MICROCONTROLLER !            01/01/70 00:00      
      RE: How u did it Mr. Mahmood ?!            01/01/70 00:00      
         RE: How u did it Mr. Mahmood ?!            01/01/70 00:00      
            RE: How about interal relays?            01/01/70 00:00      
               RE: How about interal relays?            01/01/70 00:00      
               RE: How about interal relays?            01/01/70 00:00      
   RE: PUT A PLC INTO YOUR MICROCONTROLLER !            01/01/70 00:00      
   RE: PUT A PLC ... the skinny            01/01/70 00:00      
      RE: PUT A PLC ... the skinny            01/01/70 00:00      
         RE: PUT A PLC ... the skinny            01/01/70 00:00      
            RE: PUT A PLC ... the skinny / Erik            01/01/70 00:00      
   PLC vs Microcontrollers            01/01/70 00:00      
      RE: PLC vs Microcontrollers            01/01/70 00:00      
         RE: I/O Summary            01/01/70 00:00      
            RE: I/O Summary            01/01/70 00:00      
               RE: I/O Summary            01/01/70 00:00      
                  RE: I/O Summary            01/01/70 00:00      
               RE: I/O Summary            01/01/70 00:00      
                  RE: I/O Summary            01/01/70 00:00      
                     RE: First Project            01/01/70 00:00      
                        RE: First Project            01/01/70 00:00      
                           RE: First Project            01/01/70 00:00      
                              RE: First Project            01/01/70 00:00      
                                 RE: First Project            01/01/70 00:00      
                                    RE: First Project            01/01/70 00:00      
                              RE: First Project            01/01/70 00:00      
                                 RE: First Project            01/01/70 00:00      
                                    RE: First Project            01/01/70 00:00      
                                       RE: First Project - no 82c55            01/01/70 00:00      
                              RE: First Project -move forward            01/01/70 00:00      
                                 RE: First Project -move forward            01/01/70 00:00      
               RE: I/O Summary            01/01/70 00:00      
                  RE: I/O Summary            01/01/70 00:00      
      RE: PLC vs Microcontrollers            01/01/70 00:00      
         RE: ladder.inc- Fedia Buznik            01/01/70 00:00      
            RE: ladder.inc- Fedia Buznik            01/01/70 00:00      
               RE: ladder.inc- Fedia Buznik            01/01/70 00:00      
                  RE: ladder.inc- Fedia Buznik            01/01/70 00:00      
   RE: First Step..........            01/01/70 00:00      
      RE: First Step..........            01/01/70 00:00      
         RE: First Step....Mr. Fedia            01/01/70 00:00      
            RE: First Step....Mr. Fedia            01/01/70 00:00      
               RE: First Step....Mr. Fedia            01/01/70 00:00      
                  RE: Boolean Variable Manipulation            01/01/70 00:00      
                     RE: Boolean Variable Manipulation            01/01/70 00:00      
   RE: Thanks!            01/01/70 00:00      

Back to Subject List