Sign in to follow this  
Followers 0
peplow

Forcing All Outputs On

5 posts in this topic

Hi all. New to the site so hello to everybody and thanks in advance for any help or advice given. I need a bit of help with a query ive got. Is it possible to use a special command or certain function to force all the outputs on at the same time. Basically i want a lamp test button on my test rig and want to use a dig-in to control all the outputs for as long as it’s pressed. I can’t seem to find any direct special function or command to do this so is it somehow possible to do it using the move command. I know you can group outputs into one big bunch but then how would you tell them all to turn on. Would this be done using a set word size for instance so that if say the hex word 'FFFF' is sent, all outputs of the specified group turn on? It guessing its simple to do and I’m pretty clued up on PLC's but I just cant get it to, or at least think how to make it do what I want. Any ideas or solution would be greatly appreciated and an example of the code would be even better. Thanks Mitch

Share this post


Link to post
Share on other sites
You are right you can use the MOV instruction MOV HFFFF K4Y0 (will activate Y0-YF) K1=4 K2=8 K3=12 K4=16 If you want more than 16 outputs you can use the FMOV instruction FMOV HFFFF K4Y0 K3 (will activate Y0-Y2F) Edited by Gambit

Share this post


Link to post
Share on other sites
Thats brilliant Gambit, thank you very much. One quick question, what does the H stand for before the actual hex word output FFFF? Also once thay have been activated, how do i turn them off and once turned off, i take it they will resume from whatever the programme is then asking of them? What i mean by that is when they are de-activated, it does not interfere with the rest of the programme and will carry on as normal? Cheers again Mitch

Share this post


Link to post
Share on other sites
nope... H means what follows is hexadecimal value K means it's decimal value E means it's real (float) etc. put FFFF (hex) into your calculator (or 65535 decimal) then convert it to binary. you will see that all bits are high. this means that MOV (or FMOV) can be used to turn on all bits in a range. and to turn them all off, use H0 (all bits reset). you could try H3333 or H6666 or HF0F0 and see the difference... by changing value you can specify which outputs you want high and which low. if you want to be able to force them one at a time without constantly editing program, don't use fixed value (such as HFFFF or K0) use block of memory (something that is free of course). by toggling bits in that block of memory when BMOV or MOV instruction is enabled you can play with outputs all you want... if you think this will be somehting you plan on using, copy comments as well and add one more rung, when forcing is not enabled, copy outputs back to the "force memory". in this case toggling that "force enable" bit will just freeze machine and everything will stay in current position instead of moving to programmed state. if you want to force outputs like this, make sure that this instruction is last in the program and have contact with some unused bit in front of it so you can enable it when needed. when not enabled this MOV or FMOV instruction will not interfere with your program.

Share this post


Link to post
Share on other sites
Cheers panic mode. I thought it would mean Hex but wanted to make my life easier and just ask. Looking at the manual it actually is pretty obvious, i guess it does pay to read the manual sometimes Cheers for the info about the programme issues as well, much appreciated Many thanks Mitch

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0