Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
Hindsight is an exact science.
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the C++ Compiler for Siemens S7 PLC department...
C++ compiler for Siemens PLC
PLCs and related questions. topic
Posted by Andy on 21 November, 2006 - 2:05 am
I need to convert my C++ code into S7 for siemens s7-300. I just want to reuse my code so I need a C++ compiler which which takes the c++ code and converts it into Step 7. Any ideas?


Posted by Ken Emmons Jr. on 22 November, 2006 - 8:41 pm
It would depend a lot on your OS even if one is available. PLCs don't do multithreading, all programs are scanned sequentially, no round robin
scheduling, etc. So there are more issues than just compiling.

If your code is simple enough you may be able to convert your C++ code to a structured text language which Siemens supports, but again, it
executes structured text differently than the way a computer would execute the same code.

~Ken


Posted by BrianUK on 6 December, 2006 - 12:52 am
I believe there is a pascal -ish language for S7-300.

http://www.sea.siemens.com/automat/product/eng/auS7-SCL .html


Posted by Curt Wuollet on 22 November, 2006 - 8:45 pm
Unless your C++ code is very limited in scope and is suitable for parallel execution, etc, etc. this isn't very promising. However, if you can back up and express your program logic in pseudocode that can be split into rung equations, you can convert your _program_ to run on the S7 stuff. After all, only the last step in programming involves coding in a particular language. IL being pretty similar to assembler, you might try compiling the less obvious bits and look at the object code. My guess is that it would be just as easy to reimplement in your choice or a combination of the S7 language offerings. Don't worry though, Siemens provides the facilities to make your code every bit as confusing and obfusticated as under C++.

Regards
cww


Posted by Vladimir E. Zyubin on 22 November, 2006 - 8:47 pm
Hello automation,

1. To use C++ for control algorithms is not good idea.

2. AFAIK, S7 is a close system (there is no oppinion to program it in a system language, e.g. C language), so Siemens' clones of the IEC
61131-3 languages are the only possibility to produce an executable code. So, again, to use the IEC61131-3 languages as a portable level
is a bad idea (simply, there is no way to convert a C++ program into the languages).

Constructive idea:
To produce "reusable program" try to find other PLC at least (e.g., there is a plenty of controller with JM inside it on the shelf).

--
Best regards,
Vladimir E. Zyubin


Posted by tomislavj on 27 July, 2008 - 11:53 am
Not entirely true.

Check this out:
http://www.automation.siemens.com/doconweb/pdf/SINUMERIK_SIMOD RIVE_04_2008_E/FBP.pdf?p=1

I haven't read it thoroughly, but it sure seems like you can put in C based code into the S7 plc ... as a matter of fact, the Sinumerik 840D CNC controller (which has a full S7 PLC embedded in it) contains a function block that is C encoded and cannot be viewed or opened (FB15) and it is only listed in the blocks folder when you go online.

Hope that helps.


Posted by Martin Zborovjan on 8 May, 2009 - 4:24 am
To use/reuse the C program, you have pretty much 2 options:

1. Use a SoftPLC from Siemens: 6ES7671-0RC06-0YA0 SIMATIC WinAC RTX 2008, EL, for Win2000/XP+RTX

Or Allen-Bradley SoftLogix 5800 (prefered)

OR

2. Use PLC like B&R PLC2005 range which supports C code natively, but not C++ with classes.

As it been already told, the PC code and PLC code constructions are not interchable without alterations due to differences in code execution (scanning(PLC), Sequencial(PC)).

Cheers,
Martin


Posted by Ed Wells on 24 October, 2009 - 12:33 am
For using a nice version of C/C++, you might want to consider using a product line, like www.tern.com. The TERN series isn't as heavy duty on the outside, but it can be easily added. It is a very flexible product line, has much more I/O ability for the buck, and many choices for what you and me look for at times.

If you call them (570-758-0180), ask for Tom and tell them Ed Wells sent you.

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2009 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!