cad srd functionality

Barbara_Cnt

Member
Join Date
Apr 2010
Location
sindelfingen
Posts
8
Hallo my engineer friends. It`s my first message in this forum:)
I really need help from you experienced plc specialists:)
I`ve big problem with this program part

Code:
     AN    #L_Active
      O     #NO_ButtonSEL
      JC    j10
//Convert Inputbit to Integervalue
      L     0
      T     #L_LoopCounter
[COLOR=Red]SelB: L     #L_LoopCounter
      L     #L_Buttons
      CAD   
      SRD   
      L     1
      AW    
      L     1
      <>I [/COLOR]  
      O     #L_StatusButtonSelected
// button pressed
      JC    j11
      SET   
      S     #L_StatusButtonSelected
      L     #L_LoopCounter
      +     1
      T     #L_SelectedButton
j11: L     #L_LoopCounter
      +     1
      T     #L_LoopCounter
      L     20
      <I    
      JC    SelB
//Reset Button Input
j10: AN    #L_Cancel
      A     #VOLT_ON
      O     #NO_ButtonSEL
      JC    j12
      SET   
      R     #L_StatusButtonSelected
      L     0
      T     #L_SelectedButton
      T     #L_AP_Button
//Enter Button  
j12: A     #L_Active
      A     #L_Select
      A(    
      L     0
      L     #L_SelectedButton
      <>I   
      )     
      JCN   j13
      T     #L_AP_Button
j13: NOP   0

I have no idea what are the cad and srd commands for and how the program functions? After I read the older posts about cad and srd functionalities in the forum, I feel myself comfortable with the cad-srd function. But after I turn back to this program piece, I totally confused again:(
I will be really glad with your helps.
 
All that the loop code does, is to check if a bit is set in #L_Buttons (an array of buttons ?).
If it finds that a bit is set (a button is pressed ?), it writes the offset into #L_SelectedButton.

No idea why the CAD instruction is there. It could be because the number that #L_SelectedButton report must match a certain numbering system.
 

Similar Topics

Hi Expert: I have used EPlan at previous job, now in the new job they use AutoCAD Electrical, just finished one training at Udemy, it is not good...
Replies
7
Views
1,144
When I started as a controls engineer way back in the ‘80s everyone used all caps when documenting PLS programs and in AutoCAD. This was still...
Replies
14
Views
1,662
This is my first IO-Link project. I am having trouble figuring out how to draw this in ACAD-E. How to show the system as well as the wiring to...
Replies
6
Views
1,753
We have a request from a customer to import a .dwg of the mechanical drawing of their system into the HMI. The components, like the motors, would...
Replies
8
Views
2,567
Back
Top Bottom