You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 3rd, 2018, 11:39 AM   #16
sparkie
Lifetime Supporting Member
United States

sparkie is offline
 
Join Date: Nov 2014
Location: KS
Posts: 838
Quote:
Originally Posted by Kkona View Post
Thank you very much! I have never seen the boxes that is called ''='' and ''MOVE''. What are those?

They are function blocks. The = compares the values of two inputs and determines if they are equal. It is very much like a mathematical function. It gets some INPUT and then does some OPERATION on the INPUT then gives an OUTPUT. In the case of the =, or any other comparison block, the output has two possibilities. They can be TRUE(1) or FALSE(0) and then execute the following logic based on that.


This is a video for excel, but the exact same principals being illustrated here hold true:


https://www.youtube.com/watch?v=eWMD0pKmg48
  Reply With Quote
Old December 3rd, 2018, 12:07 PM   #17
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,381
Quote:
Originally Posted by Kkona View Post
Thank you very much for your video!

Sorry, im a bit confused. Because I thought that using SR was correct, but then I heard using RS is the correct one. I know that the SR is start dominance, and RS is reset domincance, but I dont know when to use which one.. And I dont now any other method that is easier for me than using that.
Using SR is not incorrect. I just said that I would not do it that way. Perhaps this is because I mostly program in Ladder logic. I made another version of my example using Set/Reset. Note that the Equal and Move mentioned above are more correctly called functions and not function blocks. They do not have to be defined because they do not store any information in them.

Function blocks like SR, and timers, have internal data and so they must be declared like variables and given names. You will see in my video that I declared an SR function block named SR_H0. I moved all my variables to the global variable file so that I could call them from multiple routines. The SR function block has to 'remember' that you energized the SET1 input and keep the Q1 output on until it sees a signal on RESET.

One would say that I have declared SR_H0 to be an instance of an SR function block.

https://youtu.be/UCHUsKSKP2w
__________________
nOrM
======================
nOrM=Norman Dziedzic Jr.
"I decry the current tendency to seek patents on algorithms. There are better ways to earn a living than to prevent other people from making use of one's contributions to computer science." Donald Knuth
  Reply With Quote
Old December 3rd, 2018, 01:23 PM   #18
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Quote:
Originally Posted by ndzied1 View Post
Using SR is not incorrect. I just said that I would not do it that way. Perhaps this is because I mostly program in Ladder logic. I made another version of my example using Set/Reset. Note that the Equal and Move mentioned above are more correctly called functions and not function blocks. They do not have to be defined because they do not store any information in them.

Function blocks like SR, and timers, have internal data and so they must be declared like variables and given names. You will see in my video that I declared an SR function block named SR_H0. I moved all my variables to the global variable file so that I could call them from multiple routines. The SR function block has to 'remember' that you energized the SET1 input and keep the Q1 output on until it sees a signal on RESET.

One would say that I have declared SR_H0 to be an instance of an SR function block.

https://youtu.be/UCHUsKSKP2w
Thank you, I will take a closer look! By the way, I can't add 3 outputs using only 1 SR/RS? do I have have to make 1 SR for every output?
  Reply With Quote
Old December 3rd, 2018, 05:27 PM   #19
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,381
To answer your question, you can have more than one output to a block. You right click on the line coming out of the block and choose Insert assignment. It will add a branch and area for you to type another tag name. Like this:



Now for the real fun. Why, just because. I have created a simulation of your application from your description. Here's the thing in action with a program I wrote.

https://youtu.be/407T8KZ_09s

I also exported the relevant files so that you could play with it too. The file you need to import into your CoDeSys project is attached to this message as a zip file. You need to unzip it ant then import it as shown here:

https://youtu.be/QP431WuTVm4

Once you have done the import, Use the tags in the Global Variable file GVL in your PLC_PRG. Make sure you are in simulation mode (see video) and then go online and run the project. You can see if you are doing things right.

It would be no fun it I give you my program right away since you want to do this as a learning exercise. Start slow. Just run it with the one network shown in this post and you should see the light come on and M2 come on. The tank won't fill because you haven't turned on a valve yet. Once you get that one network working, then try to open the first valve and start filling.
Attached Images
File Type: png 2Outs.PNG (10.4 KB, 100 views)
Attached Files
File Type: zip Kkona.zip (59.4 KB, 1 views)
__________________
nOrM
======================
nOrM=Norman Dziedzic Jr.
"I decry the current tendency to seek patents on algorithms. There are better ways to earn a living than to prevent other people from making use of one's contributions to computer science." Donald Knuth
  Reply With Quote
Old December 4th, 2018, 04:03 AM   #20
jacoffey85
Member
United States

jacoffey85 is offline
 
Join Date: Nov 2016
Location: NC
Posts: 70
Quote:
Originally Posted by Kkona View Post
Thank you very much for your video!

Sorry, im a bit confused. Because I thought that using SR was correct, but then I heard using RS is the correct one. I know that the SR is start dominance, and RS is reset domincance, but I dont know when to use which one.. And I dont now any other method that is easier for me than using that.
I'm speaking from Siemens experience, but with with RS/SR, whatever is on the bottom is dominant, since that's how the scan cycle sees it. I'm not sure if CodeSys is the same way though.
  Reply With Quote
Old December 4th, 2018, 09:57 AM   #21
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Quote:
Originally Posted by jacoffey85 View Post
I'm speaking from Siemens experience, but with with RS/SR, whatever is on the bottom is dominant, since that's how the scan cycle sees it. I'm not sure if CodeSys is the same way though.
SR = Set dominant and RS = Reset dominant in Codesys. The block looks equally, but it says RS instead of SR inside the block and vica versa if that is a good answer to you!

The real problem for me, is that I dont know when is it properly to use SR or RS, and what factors decides what to choose?
  Reply With Quote
Old December 4th, 2018, 10:04 AM   #22
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Quote:
Originally Posted by ndzied1 View Post
To answer your question, you can have more than one output to a block. You right click on the line coming out of the block and choose Insert assignment. It will add a branch and area for you to type another tag name. Like this:



Now for the real fun. Why, just because. I have created a simulation of your application from your description. Here's the thing in action with a program I wrote.

https://youtu.be/407T8KZ_09s

I also exported the relevant files so that you could play with it too. The file you need to import into your CoDeSys project is attached to this message as a zip file. You need to unzip it ant then import it as shown here:

https://youtu.be/QP431WuTVm4

Once you have done the import, Use the tags in the Global Variable file GVL in your PLC_PRG. Make sure you are in simulation mode (see video) and then go online and run the project. You can see if you are doing things right.

It would be no fun it I give you my program right away since you want to do this as a learning exercise. Start slow. Just run it with the one network shown in this post and you should see the light come on and M2 come on. The tank won't fill because you haven't turned on a valve yet. Once you get that one network working, then try to open the first valve and start filling.
Quote:
Originally Posted by jacoffey85 View Post
I'm speaking from Siemens experience, but with with RS/SR, whatever is on the bottom is dominant, since that's how the scan cycle sees it. I'm not sure if CodeSys is the same way though.
Thank you very much for your videos, I will take a closer look at it! Also, I have almost completed the program now. But it its 2 things I need help with, that I dont understand.

1. Is negation the same as True-false or false true or is negation something else?

2. I know that in the task, I have to set some inputs from true to false. But how do I know what to set as false? Please explain.

3. I tried to add the timer (TOF-block) to the RS block for M1, so M1 can stop after 6 seconds. But it didnt work. I dont know what I should put in the ''IN'' ADN ET. Here is the picture: https://ibb.co/Vgfp8VF

Last edited by Kkona; December 4th, 2018 at 10:25 AM.
  Reply With Quote
Old December 4th, 2018, 10:17 AM   #23
geniusintraining
Lifetime Supporting Member + Moderator
United States

geniusintraining is offline
 
geniusintraining's Avatar
 
Join Date: Jun 2005
Location: SC
Posts: 5,895
Quote:
Originally Posted by ndzied1 View Post
Now for the real fun. Why, just because. I have created a simulation of your application from your description. Here's the thing in action with a program I wrote..
Very nice!
__________________
www.PLCCable.com PLC Communication Cables, PLC Trainers, Fluke Meters, MicroLogix, ControlLogix, Siemens, Allen Bradley and more... all your automation needs... ((NEW)) After Market 1784-U2DHP Allen Bradley USB to DH+ and Gateways
  Reply With Quote
Old December 4th, 2018, 10:47 AM   #24
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 5,583
Highlight the instruction and press F1 to read the online help:
Attached Images
File Type: jpg tofhelp.jpg (173.3 KB, 77 views)
  Reply With Quote
Old December 4th, 2018, 12:21 PM   #25
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Do anyone know why I am getting the errors located in the link?
And also, I can't find the true-false in my program/gvl-list? By that I mean what is shown in the other linkhttps://www.google.no/search?q=true+...cMjpsgEqSIaQM:

Link for the errors: https://ibb.co/xJyNz1d
  Reply With Quote
Old December 4th, 2018, 01:00 PM   #26
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,381
The Image showing TRUE and FALSE is a picture of the ONLINE view of a RUNNING program. In CoDeSys you would have to Login (From the menu Online, select Login). Then you have to run the program (From the menu Debug, select Start). You can't see the TRUE/FALSE state of anything because your program still has errors so you cannot login and run the program until all the errors are fixed.

You are getting the errors because you have not declared RS_1 anywhere OR you have declared it somewhere that your program cannot 'see'. If you declared RS_1 in the global variable file (and you left the default name GVL) then you will have to reference it as GVL.RS_1 (there is a way around this but the default behavior is to have to reference global variables with their full name which by default is GVL.xxxx where xxxx is the name given in the Global variable file.)
__________________
nOrM
======================
nOrM=Norman Dziedzic Jr.
"I decry the current tendency to seek patents on algorithms. There are better ways to earn a living than to prevent other people from making use of one's contributions to computer science." Donald Knuth
  Reply With Quote
Old December 4th, 2018, 01:59 PM   #27
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Quote:
Originally Posted by ndzied1 View Post
The Image showing TRUE and FALSE is a picture of the ONLINE view of a RUNNING program. In CoDeSys you would have to Login (From the menu Online, select Login). Then you have to run the program (From the menu Debug, select Start). You can't see the TRUE/FALSE state of anything because your program still has errors so you cannot login and run the program until all the errors are fixed.

You are getting the errors because you have not declared RS_1 anywhere OR you have declared it somewhere that your program cannot 'see'. If you declared RS_1 in the global variable file (and you left the default name GVL) then you will have to reference it as GVL.RS_1 (there is a way around this but the default behavior is to have to reference global variables with their full name which by default is GVL.xxxx where xxxx is the name given in the Global variable file.)
Okay, I think I understand, but I can't figure out what to do to solve it.. it still says error!
  Reply With Quote
Old December 4th, 2018, 02:23 PM   #28
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
I solved it, so now I have 0 errors.

So now I am at the point to decide what inputs/outputs i should set to True or false. I dont understand that yet.

Like, what factors do come in mind when using True, and in which situations do I use false?
  Reply With Quote
Old December 4th, 2018, 10:18 PM   #29
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,381
Quote:
Originally Posted by Kkona View Post
I solved it, so now I have 0 errors.

So now I am at the point to decide what inputs/outputs i should set to True or false. I dont understand that yet.

Like, what factors do come in mind when using True, and in which situations do I use false?
That's the whole idea of programming. You need to think and decide what has to happen to get the machine or system to do what you want. Then translate those ideas to the format of your PLC programming software.

It will probably help you a lot if you make a flow chart for each output.
__________________
nOrM
======================
nOrM=Norman Dziedzic Jr.
"I decry the current tendency to seek patents on algorithms. There are better ways to earn a living than to prevent other people from making use of one's contributions to computer science." Donald Knuth
  Reply With Quote
Old December 5th, 2018, 02:01 PM   #30
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
1
Quote:
Originally Posted by ndzied1 View Post
That's the whole idea of programming. You need to think and decide what has to happen to get the machine or system to do what you want. Then translate those ideas to the format of your PLC programming software.

It will probably help you a lot if you make a flow chart for each output.
Okey, thanks! I think my program is complete now, but I can't see the timer count to 6 seconds and then stop the Mixer_M1? Have I done anything wrong? Because after 6 second, M1 should stop.. But I cant see the block counting. Please see image.

https://ibb.co/6Z6mhZx
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PLC and HMI Programming using PackML and PackTags allenreyes LIVE PLC Questions And Answers 1 August 31st, 2016 06:53 AM
Programming Omron PLC, some basic help is needed arbj LIVE PLC Questions And Answers 3 June 14th, 2015 03:00 PM
Remote programming of a Click PLC bluffit LIVE PLC Questions And Answers 0 October 29th, 2014 07:25 PM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 07:24 AM
PLC programming software workarounds jdbrandt LIVE PLC Questions And Answers 17 April 12th, 2003 10:51 AM


All times are GMT -5. The time now is 11:57 AM.


.