NEED PROGRAMMING HELP WITH SIEMENS S7 program using LAD

dimgit

Member
Join Date
Oct 2006
Location
australia
Posts
2
a) the black button starts the display. red button stops the display

b) when start 'moving row' sequence is displayed. each row of lamps is lit for 1.5sec starting from the top row down. this is played 4 times

c) two seconds after the completion of the above process, the digit 1, 2 and 3 are displayed in sequence. each letter flashes three times in a row. each flash last for 1 second. the interval between flashes is 0.7sec. the letter sequence is repeated continuously until the red button is pressed

d)the seqence of the displayed digits can be reversed repeatedly at any stage with the white button

From the above, I need help with the program. steps a,b and c can be done but I do not know how to implement the reverse function. Please help me as i am a still a student still learning the PLC.
 
Last edited:
If you show what you have done and ask for help/opinion then you will get a better response.

People here will not do your homework but will be very willing to assist you by assessing what you have done.
 
dimgit said:
c) two seconds after the completion of the above process, the digit 1, 2 and 3 are displayed in sequence. each letter flashes three times in a row. each flash last for 1 second. the interval between flashes is 0.7sec. the letter sequence is repeated continuously until the red button is pressed

d)the seqence of the displayed digits can be reversed repeatedly at any stage with the white button


How do you intend on making the digits flash? I would probably write the sequence for the flashing digits in forward and reverse and then use the white button input to swap between the two.
 
Logic. Cool, clear, logic. Precise, unambiguous, logic. That's what we need here.

So why do we have -
"the digit 1, 2 and 3 are displayed in sequence" OK, so we are going to display numbers (digits) somewhere. A PLC with built-in display? Some other device attached?
and then -
"each letter flashes three times in a row" Whoa, which letters are these? The alphabet? Where are these displayed etc...?
followed by -
"the letter sequence is repeated continuously" Who said anything about a sequence? All we were told was these mysterious letters were to flash. What is the sequence?
and finally -
"the seqence [sic] of the displayed digits can be reversed" Ahh, so we're back to the numbers again. Ignore the letters?

There's a lot more detail required in defining the requirements.
Come on Dimgit, don't short change us. Asking for help on homework is one thing, being lazy about stating the problem is quite another.

Regards

Ken
 
Ken - I think this involves an array of lamps which are lit to display any character of choice.

To assist in the reverse function, I would have a fixed location for the current characters to be displayed. If displaying forward move the characters into the location in the correct order, if reverse is required, simply move them into the location in reverse order. Your display logic will not need to go backwards/forwards through memory this way.
 
As I said in my initial response, he should show what he's got and show what he wants to do for reversing, doesn't matter if its wrong. At least then we know what he's doing.

How can anyone offer any help when they don't know the structure, reversing to me as to most others on this site would be easy, but it is impossible to do unless you know the structure your working with.
 
Sorry for not stating properly, but the problem came to me in that exact words. the letters in this case refer to the numbers 1, 2 and 3. I just need help for the last part. reverseing it. Basically there a 6 rows of program, 3 lights in each row. The program starts out by flashing each row step by step and repeats for 4 times. Then it starts displaying the number 1, 2, and 3. Each number is repeated 3 times before moving on to the next number. Then the white button reverses that number dispayed at any time, basically it goes 3,2,1 or 2,1,3, or 1,3,2 and if you press the white button again it reverses again (goes back to a normal forward count). That's the problem i'm facing mainly, the reversing. Hope this makes it clearer. Thanks for the respond.
 
Here's some ladder logic for doing the digit order change. Insert this source code into the source folder and compile it, you can then view the block in ladder form.

Code:
FUNCTION_BLOCK FB 3
TITLE =digit order change
VERSION : 0.1

VAR_INPUT
  bWhiteButton : BOOL ; 
END_VAR
VAR_IN_OUT
  Digits : ARRAY  [1 .. 3 ] OF INT ; 
END_VAR
VAR
  bButtonEdge : BOOL ; 
  iDigitOrder : BOOL ; 
END_VAR
VAR_TEMP
  bChange : BOOL ; 
END_VAR
BEGIN
NETWORK
TITLE =Detect edge
	  A	 #bWhiteButton; 
	  FP	#bButtonEdge; 
	  =	 #bChange; 
NETWORK
TITLE =123 - 321
	  A	 #bChange; 
	  A(	; 
	  L	 #Digits[1]; 
	  L	 1; 
	  ==I   ; 
	  )	 ; 
	  A(	; 
	  L	 #Digits[2]; 
	  L	 2; 
	  ==I   ; 
	  )	 ; 
	  A(	; 
	  L	 #Digits[3]; 
	  L	 3; 
	  ==I   ; 
	  )	 ; 
	  =	 L	  1.0; 
	  A	 L	  1.0; 
	  JNB   _001; 
	  L	 3; 
	  T	 #Digits[1]; 
	  SET   ; 
	  SAVE  ; 
	  CLR   ; 
_001: A	 BR; 
	  R	 #bChange; 
	  A	 L	  1.0; 
	  JNB   _002; 
	  L	 2; 
	  T	 #Digits[2]; 
_002: NOP   0; 
	  A	 L	  1.0; 
	  JNB   _003; 
	  L	 1; 
	  T	 #Digits[3]; 
_003: NOP   0; 
NETWORK
TITLE =321 - 132
	  A	 #bChange; 
	  A(	; 
	  L	 #Digits[1]; 
	  L	 3; 
	  ==I   ; 
	  )	 ; 
	  A(	; 
	  L	 #Digits[2]; 
	  L	 2; 
	  ==I   ; 
	  )	 ; 
	  A(	; 
	  L	 #Digits[3]; 
	  L	 1; 
	  ==I   ; 
	  )	 ; 
	  =	 L	  1.0; 
	  A	 L	  1.0; 
	  JNB   _004; 
	  L	 1; 
	  T	 #Digits[1]; 
	  SET   ; 
	  SAVE  ; 
	  CLR   ; 
_004: A	 BR; 
	  R	 #bChange; 
	  A	 L	  1.0; 
	  JNB   _005; 
	  L	 3; 
	  T	 #Digits[2]; 
_005: NOP   0; 
	  A	 L	  1.0; 
	  JNB   _006; 
	  L	 2; 
	  T	 #Digits[3]; 
_006: NOP   0; 
NETWORK
TITLE =132 - 123
	  A	 #bChange; 
	  A(	; 
	  L	 #Digits[1]; 
	  L	 1; 
	  ==I   ; 
	  )	 ; 
	  A(	; 
	  L	 #Digits[2]; 
	  L	 3; 
	  ==I   ; 
	  )	 ; 
	  A(	; 
	  L	 #Digits[3]; 
	  L	 2; 
	  ==I   ; 
	  )	 ; 
	  =	 L	  1.0; 
	  A	 L	  1.0; 
	  JNB   _007; 
	  L	 1; 
	  T	 #Digits[1]; 
	  SET   ; 
	  SAVE  ; 
	  CLR   ; 
_007: A	 BR; 
	  R	 #bChange; 
	  A	 L	  1.0; 
	  JNB   _008; 
	  L	 2; 
	  T	 #Digits[2]; 
_008: NOP   0; 
	  A	 L	  1.0; 
	  JNB   _009; 
	  L	 3; 
	  T	 #Digits[3]; 
_009: NOP   0; 
NETWORK
TITLE =if non valid code then init to 123
	  A	 #bChange; 
	  =	 L	  1.0; 
	  A	 L	  1.0; 
	  JNB   _00a; 
	  L	 1; 
	  T	 #Digits[1]; 
	  SET   ; 
	  SAVE  ; 
	  CLR   ; 
_00a: A	 BR; 
	  R	 #bChange; 
	  A	 L	  1.0; 
	  JNB   _00b; 
	  L	 2; 
	  T	 #Digits[2]; 
_00b: NOP   0; 
	  A	 L	  1.0; 
	  JNB   _00c; 
	  L	 3; 
	  T	 #Digits[3]; 
_00c: NOP   0; 
END_FUNCTION_BLOCK
 
Pity you did that really Simon.

I think its better help for a student to nudge them in the correct direction rather than do their homework for them.

He should have put up what he has done so far and told us what he thought he should do, it didn't matter if he made a mistake, we do learn from errors after all.
 

Similar Topics

Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,867
Hello, I’m currently working on a project using a unitronics samba plc, I need to create a program with a touchscreen start and stop button, that...
Replies
11
Views
2,280
Hello Experts, please help me out on programming. inputs tank full float switch tank empty float switch outputs inlet solenoid drain solenoid...
Replies
12
Views
2,450
Hello i need one of you fine gentlemen to help me with some ladder logic. I'm brand new to PLC's and admire you guys, i'm a long time stalker...
Replies
16
Views
5,090
I work for a small town company and we have been growing, they recently bought a few Panasonic performarc robotics that have manually operated...
Replies
0
Views
1,421
Back
Top Bottom