Peter Nachtwey said:
I am not talking about the language, I am talking about the IDE or integrated development environment. I do most of my programming in C and Mathcad. I use Microsoft's Visual C to do most of the C work. I have a TI ( Texas Instruments ) C compiler and IDE for programming DSPs. It isn't near as nice as Microsoft's IDE or even Apples Xtools. The TI development tools are lame in comparison. The difference is not the C that I use to program. Unlike PLCs I can copy my files from MS development system to the TI development system and the code complies and runs. The C is the same. The development tools and environment tools are different.
I'm not talking about the language either. Code is code, logic is logic. The programming environments are different, but ultimately one has to come up with a logical sequence to perform a task.
My "supermarket bagger" comment was made in response to someone saying a software package wasn't intuitive. What I meant is that if it was intuitive, the bagger would be able to start it up, automatically go through some wizard that made an OB1, an FC, and a DB, and help him write logic. He wouldn't have the knowledge to write
good code, but at least he could write code. But instead, even someone like yourself struggled. You don't have a problem with Microsofts IDE because you are used to it. But if I had to start using it tomorrow, it would be no more intuitive to me than the Simatic Hardware Configurator was for you yesterday.
A goood example would be AutoCad. Now, I consider myself a fairly bright guy, but last year I had to do a little bit of drawing with it, and let me tell you, it sucked. All I wanted to do was extend a couple of lines make a radius with the intersection, but I had to pour through help files and search help forums to do even this simple task. I don't blame AutoCad though.
So tell me why is C difficult?
I didn't say it was difficult. I don't think
any programming language I've learned was difficult. Now that I've learned Python, C wouldn't be my first choice for a lot of apps, but it's still the programming problem that makes the task difficult, not the coding language.
Try the Microsoft Visual Studio or Xtools. These are very easy to learn but then they don't have to configure Profibus DP I/O.
That's subjective. If you took someone that had never seen either environment before, I don't think one would be easier than the other.
The IDE should help you with meaningful error messages and wizards to help one through procedures.
Siemens could be better at their messages. I was very regrettably using ProTool to change a screen recently, and had a question about configuring passwords. In the help, it said, paraphrasing, "Configure passwords as you are used to in ProTool". Thanks a lot.
Would you know about all the different places to click and make entries that I listed in that procedure above?
Yes. But I've used S7 since 1996, so it has become second nature.
When the USB-MPI adapter says it is damaged, is there a simple trick you use like a ping that lets you know that the hardware is working and the problem is really someplace else? I had a pretty good idea that my USB-MPI adapter was OK and the Step7 was lying to me. Perhaps they want me do get an new adapter when it really isn't necessary. The Step7 didn't tell me exactly what was wrong so I just reinstalled the USB-MPI adapter drivers and went though the whole configuration procedure which took time It could be that a simple parameter needed to be changed but the Step7 didn't tell me that.
There is sort of a ping function. From Simatic Manager, there is a "Display Accessible Nodes" function. If you can't see the PLC there, then you simply don't have a connection. From my experience, USB MPI adapters are not that reliable. The serial and pcmcia adapters always seem to connect, as does my new ethernet adapter. And if your PLC has an ethernet card, you don't need MPI at all anyway.
When I finally downloaded my code, the S7 stopped without providing an error code.
That's impossible. The disgnostic buffer will give you an error code and description, and lead you to the exact line of code that caused the problem.
I have no clue as to what caused the S7 to stop except that it was my code. When the PLC stops without providing any error codes what do you do? One can remove code until the offending code is removed. I can do that because I have only a few rungs. What about the rest of you with your much bigger projects?
In the diagnostic buffer screen, click on IStack. This probaly the most useful debigging tool in S7. I've never had to remove lines of code to troubleshoot code.
Why didn't the compiler say there was an error before the code was downloaded? Couldn't the PLC at lest indicate the last rung or network that was executed before a crash?
Sometimes it's hard to tell if what you are doing is always an error, just as it is in C. S7 will catch the obvious errors (mismatched jump markers, wrong variable names, etc), but other things may not show up until run time. Hell, Bill Gates has had billions of dollars to get Excel to work over the years, but it still locked up on me last night.
Are these ANY pointers allowed to point anywhere and cause crashes? It looks like it.
Well, yes, that what a pointer does. How could S7 possibly know in advance what you plan on doing with a pointer? For instance, a data block can be created dynamically at run time, but I still would need to create a pointer or address in my code in order to use it.
You imply that all IDEs are the same.
I didn’t imply that at all. When I was learning Python, I tried three different IDEs until I found one I liked. Some are more intuitive and useful that others for whatever reason.
In any event, that’s what forums like this are good for. Next time you get a red light and a stopped PLC, shoot a message over here and we’ll walk you through it. Or just give me a call.