Electrician Talk banner
1 - 20 of 59 Posts

·
Registered
Joined
·
72 Posts
Discussion Starter · #1 ·
I'm bored and wanted to write some PLC programs.

I'll start with a simple program and progress through advanced topics and techniques. Email me with real life examples to program.

If you have a better mousetrap, let me know.

Simple 3 wire control


Why the CR? I like to keep the outputs separate from the logic.
 

Attachments

·
Coaster Sparky
Joined
·
1,952 Posts
Two proximity sensors that have to be in agreement with each other within 5 seconds, or it throws a fault.

Just something I see on a daily basis. I don't write program though, interested in picking it up.
 

·
Coaster Sparky
Joined
·
1,952 Posts
dronai said:
This is not correct yet, still working on this one.
I've got it drawn out in our shop, I'll take a look at it tomorrow. I'll throw it together in MSpaint when I have the chance and post it back here.
 
  • Like
Reactions: dronai

·
Premium Member
Joined
·
7,413 Posts
Why did you use an error state, and a fault light ? I'm loading yours now to test
And what is the clear on rung 1 ? Never used that
 

·
Registered
Joined
·
72 Posts
Discussion Starter · #13 ·
Why did you use an error state, and a fault light ? I'm loading yours now to test
And what is the clear on rung 1 ? Never used that
It clears the memory.

Its good programming practice to use a binary bit instead of going directly to output.

You wanted the fault light to come on if the 2nd prox sensor did not detect an object within 5 secs.
 

·
Registered
Joined
·
72 Posts
Discussion Starter · #14 ·
Run Jog Selector Switch

Run and Jog Control

We use a selector switch to set run or jog mode.
Run mode will set the seal in bit 1:1/4 to 1 (on)
Jog mode will set the seal in bit 1:1/4 to 0 (off)
 

Attachments

·
Premium Member
Joined
·
7,413 Posts
It clears the memory.

Its good programming practice to use a binary bit instead of going directly to output.

You wanted the fault light to come on if the 2nd prox sensor did not detect an object within 5 secs.
Your reset button does the same job as the clear memory doesn't it ?
 

·
Premium Member
Joined
·
7,413 Posts
Just clears the fault light. You don't want that light on all day long.


Regarding the Clear instruction:
I see that, I just couldn't find any logic that would stay in the memory after the seal in circuits are dropped out by the NC contacts.
 

·
Registered
Joined
·
72 Posts
Discussion Starter · #18 ·
Regarding the Clear instruction:
I see that, I just couldn't find any logic that would stay in the memory after the seal in circuits are dropped out by the NC contacts.
s:1/15 the rung will only run once when the program first starts. It is called a initializing bit.

clear == MOV 0000H --> B3:0

so for example:
my B3:0 has some random data 1001 0001 1111 1000
the clear instruction will do this 0000 0000 0000 0000
 

·
Registered
Joined
·
26 Posts
You guys are thinking like electricians. U gotta think like a programmer. Just cause its ladder logic doesnt mean relay logic.
Put the two prox switches in seris with xic`s with a tof instruction. then use the dn bit to trigget the alarm.
 

·
Registered
Joined
·
72 Posts
Discussion Starter · #20 ·
You guys are thinking like electricians. U gotta think like a programmer. Just cause its ladder logic doesnt mean relay logic.
Put the two prox switches in seris with xic`s with a tof instruction. then use the dn bit to trigget the alarm.
Can I see some code.
 
1 - 20 of 59 Posts
Top