View Full Version : testing and debugging
cindy
June 7th, 2002, 06:16 AM
Hello again plc world,
does anybody know of any hardware and software debugging methods for plc programs. An example would be great!. I'm using siemens step7 software and I'm not quite sure how to test or debugg with it, apart from running the program. I dont have access to a manual either.
Any help on this would be most appreciated:)
Steve Bailey
June 7th, 2002, 06:28 AM
The most effective way to debug a program is to run it on the actual machine or process to be controlled. Second best is to run it on the PLC and manually turn the inputs on and off the way the machine would in real life. If you have lots of time, you can write a simulation subroutine that mimics the real life behavior of the inputs.
My advice to you is to get to the lab, download your program to the practice unit, and see what happens.
BTW, you do have access to the manuals. Siemens posts them on their website.
Rverhoeven
June 7th, 2002, 07:32 AM
If you've got the complete siemens step 7 cd you also have PLCSIM installed. this utilitie simulates a fully functional PLC (NOT A NETWORKED PLC)
for manuals see
www4.ad.siemens.de
Peter Nachtwey
June 7th, 2002, 11:05 AM
The control logix has a trace. If use a FIFO queue and use it the opposite of a sequencer. It copies the state of the I/Os and registers. 8 scans deep is enough for most things. I use the COP instruction as TIM MOULDER is doing in another thread to implement the FIFO. I also and add instructions that increment a register every time an event occurs.
Since most if not all of my programming is for machine control, a well laid out state machine reduces the need for debugging.
Learn to use a scope. It is a must. A good scope meter is very handy. I can't believe how many places I go to that don't even have a scope. It is pitiful and shameful.
cindy
June 7th, 2002, 12:48 PM
Thanks to all that replied you have all confirmed my own suspicions that the debugging is basically running the program and whaching the inputs and outputs are doing what they should be. My program worked first time so I found this a bit odd and had to actually introduce a fault to find it. The program was to simply sort a conveyor and the products on it, I guess this is pretty low programming for you guys.
Anyway thankyou all.
Cindy;)
gbradley
June 7th, 2002, 03:55 PM
"My program worked first time"
Absolutely not!
This is one of those universal constants.
Murphy's law to the nth degree.
Nothing ever works the first time!
If I were you I go out and bet on the ponies this weekend.
Congratulations anyhow.
akreel
June 7th, 2002, 04:04 PM
Originally posted by gbradley
"My program worked first time"
Absolutely not!
This is one of those universal constants.
Murphy's law to the nth degree.
Nothing ever works the first time!
If I were you I go out and bet on the ponies this weekend.
Congratulations anyhow.
My programs always work the first time!
The first time after I've got all the bugs squashed.
.