Alternate function in S7??

Dariusch

Member
Join Date
Sep 2003
Posts
284
Hi.
How can I make an "alternate" function and toggle the Q on/off in a Step7??
Is there a function to use or do I have to make it myself. If so, is there an easy way of doing that.??

see attach pic.

Thank you

Dariusch
 
Hi Ken

Ken M said:
Code:
A #TRIGGER
FP #ONESHOT
X #TOGGLE
AN #INHIBIT
= #TOGGLE

Stick this in a Siemens FC with TRIGGER, ONESHOT and INHIBIT as BOOL IN parameters, and TOGGLE as the BOOL OUT parameter. This gives you a flip-flop plus an inhibit switch, all in six lines of code. Take out the inhibit if you don't want it, and now we are five.
The secret's in the 'X'.

Regards

Ken

If I write it in a FC it wont work!?!?!
I have wrighten the exact code and put them in the right In / Out.
 
Yes I have calld the blok.

The "Toggle" only flickers, as if there is no "FP". But I have used the exact same code as that from Ken.

Dariusch

Edit//

Sorry not exact, I have not used the Inhibit, but as Ken said it was not nessasry.
 
"oneshot" should be an in/out variable that is either a static variable in a function block, a bit in a db or an M flag bit.
Same applies to "Toggle" but this could be a Q output as well.
 
With Siemens S7 I have actually had sucess with a simple function block.
  InOut              InOut
---| |------|NOT|-----( )


Where InOut is a local input/output variable.

It is called like this:
                      FC??
Button Bit ---------
---| |----|P]------| Tog |
| |
InOut| |
---------

 
Damn it - you turn you're head away for 5 minutes and there's a whole thread grown in front of you.

Simon's quite correct - in the original link I'd said ONESHOT should be an INPUT whereas it should be an IN_OUT. No-one corrected me then, and I'd just copied the link across. It wasn't that I meant to perpetuate my 'solution' - just to indicate that the topic had been touched on at least once before. Thanks, Simon.

regards

Ken
 
Shouldn't "Toggle" be an in_out as well? Your FC uses the state of toggle to invert it with the x instruction. In an FC, "toggle" will be random if you use an output before it has been written to.
 
Grrrnnnngghh!! (I think that's how it's spelled!)

I've just had a look in my library and, yes, sure enough, there are two IN_OUTs in my actual working version.
Apologies all round for pointing to this old thread which contained the original errors. I can only offer the excuse that it was errors brought about by typing enthusiasm rather than total ignorance. 'Ignorance' I'll accept, but not 'total' - there must be something I know. And hopefully, whatever it is, will be correct.

Regards

Ken
 
Just to understand how the FF works using the FC, why is it that it will work when using the "IN-OUT", but not when using the "TEMP"????

Could I have an explanation please??

Thank you

Dariusch
 

Similar Topics

Hello All, I want to publish my data in sql server in Excel format as daily report. And xl reported pro version seem to be much expensive which...
Replies
1
Views
494
I'm looking for alternate module that I can use in place of Rockwell 5069-IO mainly for safety output card (OBV8S). Looking at the lead time, I...
Replies
2
Views
1,198
Good morning everybody, I hope you are very well. I share with you the information of the PLC LOGO! Siemens and expansions that we have...
Replies
4
Views
1,088
Hello All, Currently I am migrating S7 300 to S7 1500 & I am unable to use DP send & receive data from Master PLC. Which instruction is...
Replies
4
Views
1,638
Hi guys Do you have some experiences with Power Analyzers such as Siemens SENTRON PAC4200?.. I have alternative analyzer installed on machine...
Replies
6
Views
2,055
Back
Top Bottom