1

I have some old C code that is used to perform tasks on top of the PLC. I am wanting to convert this code into Structure Text on GEs Proficy Machine Edition. Is there any special tools or etc. that can help me to better understand how to convert the C code into structure text? Is there any software that can find syntax errors or anything of that matter since there is no color changes in this to show I used a keyword or etc.? I am starting to translate my global double variables into real variables in structure text but I am not sure if this is correct since I have never used Structure Text before.

CONFIGURATION DefaultCfg
     VAR_GLOBAL
        variable : REAL;
     END_VAR

     PROGRAM MAIN : MAIN;
END_CONFIGURATION

PROGRAM MAIN
     VAR
        nonglobal : REAL;
     END_VAR
END_PROGRAM
  • Not an answer but I asked a similar question a while ago http://stackoverflow.com/questions/757543/c-to-iec-61131-3-il-compiler – Peter M Dec 02 '15 at 18:05
  • @PeterM What tools did you use for structure text? –  Dec 02 '15 at 18:23
  • @PeterM What also are the best variables to use to store registers? I got a about 20 of them and need to be able to store and use them –  Dec 02 '15 at 18:27
  • The only tool really is Machine Edition. Write the code and build it and see if there any errors. As for variables, you can use whatever datatypes you feel you need (that are supported by ME and the specific PLC). – Peter M Dec 02 '15 at 18:50
  • @PeterM are you only allowed to have variables that reference variables that on under variables list on the PLC? REAL was black till I created a variable called REAL and now they are lit up. I can put VARIABLE : R05555; which points to my variable for that register. Does this mean I can't make variables that are only accessible to this MAIN PROGRAM? –  Dec 02 '15 at 19:05
  • Creating a variable called `REAL` doesn't make sense. You should have access to the `REAL` data type (BTW `LREAL` should be the the GE equivalent of `double`). I suspect in doing so that you created a linked variable eg your variable was linked to the variable called `REAL` in the PLC. And I think that the answer to your last question is that you are correct. All variables in GE PLCs are effectively global. However variables do not have to be backed by registers (or bits etc) – Peter M Dec 02 '15 at 19:58
  • Also it maybe better asking your questions on http://www.plctalk.net/ or http://forums.ge-ip.com/ – Peter M Dec 02 '15 at 20:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/96829/discussion-between-dark-shadow-and-peter-m). –  Dec 02 '15 at 20:07

1 Answers1

1

Structured text is for all intents and purposes Pascal. Newer PLC's which are IEC 61131 compatible support local variable scopes and since you mentioned GE Proficy ME that means it's not one of them. The newer I#XI processors are IEC 61131 compatible but the older ones predate this standard.

There is no "translator" and no real compatibility with anything else. Other than the older Logicmaster software which is DOS based, what you see is what you have to work with. This series of PLC's was originally rebranded Toyo PLC's until later when the GE/Fanuc joint venture began building their own.