PDA

View Full Version : PIC & Profibus DP



crhomberg
- 26th September 2008, 18:42
Hi All,

I am designing a clock that when it times out must shut down the program on a Siemens PLC.
I need to make it difficult for the technitions to override when it has shutdown so I need a "sneaky" way of sending the signal. I thought of a 4-20mA analog value that must be matched but it still is crude. I see the PLC has a Profibus DP connection.
Does anyone here know if we can send data from a pic via the profibus protocol to change a variable in the program. has anyone interfaced with profibus?

Regards

Chris Rhomberg

crhomberg
- 29th September 2008, 11:54
If any please help or just tell me I'm wasting my time.

Regards

Chris

Melanie
- 29th September 2008, 12:21
Interfacing via the Bus to your PLC is not for the inexperienced.

Your PLC may well have a number of I/O's free... it would be easier to set some High and some Low and only that valid combination would make it work... anything else would shut-down operation.

Remember the average techie is pretty thick... they'll play with one I/O to see what it would do... but if you've wired a bunch of them then it'll be beyond most to comprehend what it's overall purpose is...

If the shutdown is for something like a service-due timer (a guaranteed way of ensuring continued revenue after the warranty has expired), then program the PLC for say a five-minute delay after the state of the I/O's has changed before a shutdown occurs. That way if they're playing with them, setting them High and Low manually, it'll appear as if they don't do anything!

crhomberg
- 29th September 2008, 12:55
Thanks Melanie,

The device I'm making is to ensure that the customer pays, we have instances when we installed the system after they pay 2 thirds of the price and then never complete the payment, continuously making up new problems to avoid paying. This is a cruel way but only way to stay above water.
I think your way makes good sense but the PLC programmers there are not "so thick", they will see the LEDs showing the digital inputs and note them and then replace my unit with direct connections. I thought maybe analog values using a voltage to 4-20mA generator. Do you think this will be reliable enough. I cannot have this thing stopping without reason or I am toast!

Regards

Chris

Melanie
- 29th September 2008, 17:16
I assume you are programming the PLC?

Say you have four inputs... at Power-ON the PIC sets a combination, the PLC looks at this combination, checks it is valid, pulses an I/O to the PIC which then changes the combination, the PLC checks this is also valid, pulses the PIC which now sets a third combination. Finally the PLC verifies this and moves on. If this third combination (which thereafter remains constant) changes, the PLC shuts down. The only way to restart is to Power-On again. So the PIC and PLC exchange three sets of Data at Power-On which have to be valid (you can do this with TWO I/O's and a 'pseudo' Serial chain between the PIC and the PLC).

If the PIC times-out (ie they've not paid their bill), all you do is change the data interchange to something that the PLC will find invalid in the first or second verification.

Another (single I/O) way is to have the PIC perform HPWM Output... say to output a nominal voltage of 4v. The PLC looks to check that the voltage is in the range 3.75-4.25v. If it is outside this range, it can shut-down. All your PIC needs to do is to alter this voltage outside the 'good' band in ordder to shut-down the PLC. To prevent a techie simulating this voltage, at Power-Up, make it go 5v, 0v, 4v in a predetermined time period which the PLC will look for and do a different combination if they've not paid their bill.

crhomberg
- 29th September 2008, 19:56
You really are something Melanie, you just put it so simply. I think I will use the analog method.