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 November 30th, 2018, 12:01 PM   #1
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
PLC Programming

Hi!
Im totaly new within mechatronics, since I have a mechanical background. Im wondering if anyone could help me out with a task? Its about PLC programming in the software called Codesys. The task is to make an automatic liquid dispenser, that includes valve etc. I do have a drawing off it as well, and will be offering better instructions.
  Reply With Quote
Old November 30th, 2018, 12:35 PM   #2
geniusintraining
Lifetime Supporting Member + Moderator
United States

geniusintraining is offline
 
geniusintraining's Avatar
 
Join Date: Jun 2005
Location: SC
Posts: 5,889
Here is a place to start but I think you may have a long way to go.... Youtube has a lot of videos and they may help first you need to decide ladder or statement or both

https://www.youtube.com/watch?v=2tX6gumm2zg
https://www.youtube.com/watch?v=GP_3n8GgjOE

Statement List https://www.youtube.com/watch?v=WiYZ...WgMseMaW-2k5zH

Then right out what your machine will do and break it down one section at a time
__________________
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 November 30th, 2018, 12:51 PM   #3
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Thanks, I will check them out! I have mostly tried to learn Function block diagram. The task is as follwing:

a two color mixer must be controlled with PLS. The device works like this:

- When start switch S0 is operated, lamp H0 (refill) lights up. valve Y1 opens and pump M2 starts

- When sensor S1 is covered with liquid, valve Y1 closes and valve Y2 is opened.

- When sensor S2 is covered with liquid, close valve Y2, pump M2 and lamp H0 turn off and M1 starts

- After 6 seconds, M1 stops

- The unit can be switched off at any time with switch S6, thermal relays F1 or F2 (motor protection) or limit switch S4

- The ready-mixed liquid can then be manually withdrawn from the drain valve located at the bottom of the mixer

- The process can then start over again
  Reply With Quote
Old November 30th, 2018, 01:02 PM   #4
Greg7683
Member
United States

Greg7683 is offline
 
Join Date: Jun 2018
Location: Plainfield IN
Posts: 303
Heres a question if you don't mind me asking in your thread if you have to add some stuff like photo eyes and a line to an already existing program how do you know where to add it in the program or does it matter where you would insert it......?
  Reply With Quote
Old November 30th, 2018, 01:12 PM   #5
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Ask ahead, but I can't answer that for you since Im a beginner.
  Reply With Quote
Old November 30th, 2018, 01:15 PM   #6
Greg7683
Member
United States

Greg7683 is offline
 
Join Date: Jun 2018
Location: Plainfield IN
Posts: 303
I am as well
  Reply With Quote
Old December 1st, 2018, 08:09 PM   #7
sparkie
Lifetime Supporting Member
United States

sparkie is offline
 
Join Date: Nov 2014
Location: KS
Posts: 838
Quote:
Originally Posted by Greg7683 View Post
Heres a question if you don't mind me asking in your thread if you have to add some stuff like photo eyes and a line to an already existing program how do you know where to add it in the program or does it matter where you would insert it......?
It depends on if your PLC is running a synchronous or asynchronous scan cycle.

In synchronous:
1. Scan all IO -- > store states in memory
2. Run logic using the information in memory
3. Write to the output memory (then the hardware switches on the outputs)
4. Housekeeping (the PLC clears the "temporary" data from step one so that it can be scanned again)

In asynchronous, the processor effectively reacts immediately. I would love to hear more specifics about that type of scan cycle.

Next: Ladder logic is interpreted left to right, top to bottom. I'm not sure on FBD flow.

Routines and tasks: generally speaking, you can divide up program execution into tasks and routines to be called at certain events / times / certain orders. For a small job like you have going on I wouldn't worry too much about tasking.

So the answer for Greg is this: Yes it matters where and how you add equipment to the program, but not in the ways you might think.

The following videos also helped me quite a bit:

https://www.youtube.com/playlist?lis...PxGunBTtPcS3Ez

Kkona: You are on the right track. Now you need to start implementing that list in code.
  Reply With Quote
Old December 2nd, 2018, 09:07 AM   #8
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,381
Kkona: What stage are you at? Do you have the CoDeSys software? If not, you can download it at the CoDeSys Store. It is free to download the development system. With this you can run simulations on your computer but not download to any hardware.
https://store.codesys.com/tag/product/list/tagId/38/

Are you doing this for a class? Has the instructor given you a simulation to use with your program or are you working with real hardware? If you are a student, you will get a lot more help if you post what you have already done and show a willingness to try things on your own.
__________________
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 2nd, 2018, 10:43 AM   #9
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Hi there!
Yes, Im using the software called Codesys. I've tried to solve the task given in this thread, by using funtion block diagram. I've managed to almost create the program, but im stuck right now. Maybe you could help me out with the things i dont understand?

Also, im at a completely beginner stage in mechatronics.
It is a self study task from the school, and it would really help to complete it, so im prepared for any tests that may come.
  Reply With Quote
Old December 2nd, 2018, 11:02 AM   #10
ndzied1
Lifetime Supporting Member
United States

ndzied1 is offline
 
ndzied1's Avatar
 
Join Date: Aug 2002
Location: Chicago, Illinois
Posts: 2,381
Take a screen shot of your function block diagram so far. If your variables don’t have descriptive names, let us know what each one represents.
__________________
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 2nd, 2018, 11:15 AM   #11
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Here is the 2 pictures. Also, some of the words are in norwegian, but in the info given further up in this thread, you can see which component is which. Also, I havent added the timer for M1 yet (6 sec)

Also, here is my questions:

- Have I done it right so far?
- I dont know when to use RS/SR..
- Should I set the lamp H0 as output or input? I sat it as input in my diagram..
- I dont know when I should invert the signal.

Here is the link for the pictures:
https://ibb.co/YQSGHhK
https://ibb.co/NyV0jN5
  Reply With Quote
Old December 2nd, 2018, 07:21 PM   #12
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,581
Here's a partial example using an integer as a step counter.
Attached Images
File Type: jpg pmx.jpg (183.0 KB, 165 views)
  Reply With Quote
Old December 3rd, 2018, 01:05 AM   #13
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
Here is the 2 pictures. Also, some of the words are in norwegian, but in the info given further up in this thread, you can see which component is which. Also, I havent added the timer for M1 yet (6 sec)

Also, here is my questions:

- Have I done it right so far?
- I dont know when to use RS/SR..
- Should I set the lamp H0 as output or input? I sat it as input in my diagram..
- I dont know when I should invert the signal.

Here is the link for the pictures:
https://ibb.co/YQSGHhK
https://ibb.co/NyV0jN5
I would not use Set/Reset myself for this. Remember that while inside the PLC, everything is just data. Any boolean value can be used as an input or an output. Where is really makes a difference is when you connect to the hardware. A lamp is an output because the PLC sends an electrical signal out to turn it on and turns the signal off to turn the lamp off.

Inverting a signal us used when the logic makes more sense if you use the inverted value.

You should take some time to look at the attached function block network and see how it works. You can use simulation mode in CoDeSys to make virtual switches and lamps. I made a quick video showing this rung work with some simulated controls.

Note that it's not complete but intended to get you started.

https://youtu.be/GPAOataRL6Q
Attached Images
File Type: png Rung1.PNG (39.3 KB, 154 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 3rd, 2018, 11:04 AM   #14
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
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.
  Reply With Quote
Old December 3rd, 2018, 11:06 AM   #15
Kkona
Member
Norway

Kkona is offline
 
Join Date: Nov 2018
Location: Norway
Posts: 14
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
Here's a partial example using an integer as a step counter.
Thank you very much! I have never seen the boxes that is called ''='' and ''MOVE''. What are those?
  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 01:01 PM.


.