Author Topic: Assistance Needed  (Read 11832 times)

gthomas

  • Newbie
  • Posts: 3
  • I'm great at hardware...suck at programming.
    • View Profile
Assistance Needed
« on: May 03, 2012, 05:51:31 AM »
How would I program a PLC to do the following:
?   Proximity switch is normally off ? it is clicked on ? it then sends a signal to my PLC ? I want to capture that signal as data for my base server PC ? then I want to output that signal to an LED light to light up, every time the proximity sensor goes ON.
?   Now part 2.  I want 12 proximity sensors set to light up one LED light, and still want to capture the data from each INDIVIDUAL proximity sensor.  (Prox 1 was clicked 423 times, Prox 2 was clicked 124 times, Prox 3 was clicked 0 times, etc)

?   Now Part 3. I want to have one proximity sensor just collecting data ? no outputs, just data collection - and output only to a webpage.

?   Now Part 4.  I havea sensor to measure distance, relay that to my PLC ? just for data collection ? and output only to a webpage.

That is the 4 different ways I need to use my PLC ? Inputs & Outputs (all digital I/O) ? and instead of an LED light, that signal is just used to count up on an LED Numerical Display.

That is the main thing here.  I need to collect the data from each individual proximity switch because each one of those proximity switches are actually different paint colors or different spray guns that we use.  Hope this makes it easier to understand.  I apologize again for my inexperience.


---------------------------------------------------------------------------------------------------------
Original message:

I am currently a cost accountant at a Fiberglass Company in Northern Indiana, and am attempting to create a counter system for our company.  

I have 2 FMD1616-10 PLC's with the extesions up to 40 I/O. 1 FMD88-10 PLC...
I have plenty of wiring, digital LCD counters, proximity switches (NPN), power supplies, etc.  I am fine on the hardware side of the project, but I am lost when it comes to Ladder+ Logic programming.

Simply what I want to do is have 40 proximity switches feeding into the PLC Digital Inputs and have those 40 PLC inputs feed back to my main PC via the ethernet connection on the board, in other words, monitor what information those inputs are receiving.  Then I want to have the digital outputs only read out to a minimal number of LCD displays.  (Per PLC) - meaning I don't want to have 40 inputs to 40 outputs (from the PLC), because my LCD display cannot accept more than 2 inputs.

What I mean by the minimal number of LCD displays is this:
I have a paint pump at my company, within each paint booth I want to put 1 LCD display so the painter can see how many strokes he is using on his part.  But within that paint booth, there are up to 12 different paint pumps (that will have proximity switches counting the strokes).  I would like to have those 12 proximity switches feeding into my digital inputs on my PLC, and have only 1 digital output for that LCD display.  And it's a Digital display that only accepts signals for counts.

Hope this makes more sense...sorry new to all this.

Expanded:
Digital plc input #1 prox to digital PLC output #1 which will go to my LCD monitor
Digital plc input #2 prox to digital PLC output #2 which will go to my LCD monitor
Digital plc input #4 prox to digital PLC output #3 which will go to my LCD monitor
Digital Inputs on PLC 7-18 are from Proximity Switches
I want those to go to Digital PLC Output #4 which will go to my LCD monitor
Digital Inputs on PLC 19-24 are from Proximity Switches
I want those to go to Digital PLC Output #5 which will go to my LCD monitor

***and that is just 1/2 of all my PLC inputs, but I figure, if I can get the big ones, the rest will just flow easy.  ***Attached is my architecture for my PLC's
« Last Edit: May 04, 2012, 01:46:14 PM by gthomas »
Greg Thomas
Senior Cost Accountant

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Assistance Needed
« Reply #1 on: May 04, 2012, 05:14:33 AM »
It wasn't clear what you mean by 40 switches feed back to the PC via Ethernet. Do you mean you want the ON/OFF status of these 40 switches? Or are these 40 switches incrementing some counters? Do you want to read the value of counters? (you mentioned something about it being a counter readout program).

Also what do you mean by "outputs only read out to a minimal number of displays.  (Per PLC)" - are you referring to the LCD display on the PLC. What do you mean by "outputs" here?

Since there are quite a number of hardware components involved it would be helpful to use the correct terminology to describe you intention. E.g. PLC digital inputs, PLC digital outputs. PC screen display. PLC LCD display.

Also for PC to display information about PLC via Ethernet there are two ways:

1) PC as client and PLC as server - you need a client program or use the built-in webpage to achieve this.

2) PC as server and PLC as client - you will need a server program running on the PC.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

gthomas

  • Newbie
  • Posts: 3
  • I'm great at hardware...suck at programming.
    • View Profile
Re:Assistance Needed
« Reply #2 on: May 06, 2012, 10:53:31 AM »


Am I getting close?
Greg Thomas
Senior Cost Accountant

TravisB

  • Newbie
  • Posts: 33
  • I am NOT a llama!
    • View Profile
Re:Assistance Needed
« Reply #3 on: May 07, 2012, 03:30:03 PM »
Hello gthomas,
I'm fairly new to all this as well, but I think I can be of some help.
First, are the LCD displays much different than the ones sold by TRi? If so, a link to a data sheet will help us understand what you are trying to achive.

For the LCD displays TRi sells, I would do the following:
If each thing you want to count can be measured via one of the PLC's digital inputs, then you can have a simple program that runs each time the input recieves a signal. For example, if a "stroke" is monitored by the proximity sensor you want the sensor to temporaraly close the Digital Input on the PLC. If that is connected to Digital Input 1, then the ladder code is something like:
--||--i1-----------------------------------------------------1-----{dCusF}
normally open input 1                                             custom function #1

and the function would include
x = x + 1 'Where x is the number of counts at input #1
as well as something to update the LCD screen
SetLCD 1,1, "Count for #1 =" + STR$(x)
Which translates to:
On line 1 of the LCD, starting at position 1, print the words "Count for #1 =" and the value of x.

I don't think there is a non-function way to display things on the LCD, so you might as well do the counting in the same function too.

Now, you have more than 26 proximity sensors, so you can't use letters for all of them. In this instance, replace "x" with the other type of variable used, which is DM[1]. I think you can use DM[1] through DM[4000] for a F1616, but at the very least you can use up to DM[1000], which is more than you need. For Digital Input #1 replace "x" with DM[1], for #2 use DM[2] etc.

And to keep a grand total, in each function you can have:
DM[999] = DM[999] + 1
so that anytime one of the sensors sends a signal, it also increments DM[999], keeping a count of the total number of strokes on ANY sensor.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Assistance Needed
« Reply #4 on: May 08, 2012, 03:30:44 PM »
Thanks TravisB for your help on this question.

As per TravisB suggestion, you can use a variable A to Z, or or DM[1] to DM[4000] as counters to count the number of times the proximity sensors turned from OFF to ON. A to Z can count up to 2 billion pulse but DM[1] to DM[4000] can count up to 32767 only. If you need more counters and need to keep count  > 32767 you can always use 2 DMs as one counter (carry over from one DM to the next when it exceeds a certain number). You also need a way to reset the counters which can be accomplished by a RESET command.

In your Part 2: Using 12 proximity sensors to turn on 1 LED - do you mean any of the proximity is ON the output is to be turned ON. What about when all proximity sensors are OFF? Is the LED to be turned OFF? If so then a simple OR (parallel ladder logic rung) of all these proximity sensors feeding to one output is all you need. But if all proximity sensors are turned from ON to OFF yet the LED is to remain ON then you need to use the [Latch] function to latch the output and you need to provide a way to reset it.

Part 3 - you can increment a value in DM[1] when the proximity sensor triggers. DM[1] can be viewed from the default built-in webpage.

Part 4 - again you can use a DM[1] to DM[4] to keep the distance data which is visible on the default webpage.

You can display any DM variables on the LCD display by executing the SETLCD command in your TBASIC function.


« Last Edit: May 08, 2012, 03:32:40 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

gthomas

  • Newbie
  • Posts: 3
  • I'm great at hardware...suck at programming.
    • View Profile
Re:Assistance Needed
« Reply #5 on: May 29, 2012, 09:22:42 AM »
Got, thanx to all that helped out
Greg Thomas
Senior Cost Accountant