Sign in to follow this  
Followers 0
wizard

inserting a reference pointer in structured text

13 posts in this topic

I am using GX IEC Developer 7.00 and programming in Structured Text. Unfortunatelly there are few manuals for structured text and I don't have answer to very simple questions. If anyone have a detailed manual for structured text in GX IEC Developer, please share it. My amateurish question is: how can I insert a pointer at specified line in a program. I've tried Ctrl+J, Ctrl+Shift+J, etc, but with no success. I want to use CJ and CALL instructions but I cannot do this because I cannot insert a pointer. Please help.

Share this post


Link to post
Share on other sites
Why use structured text? If the manual doesn't exist, you can be pretty sure that almost no one uses it. Which means that you'll be the only person who can understand it....... which can lead to a lot of problems. IEC is very good at graphical ladder ..... why would you not use it?

Share this post


Link to post
Share on other sites
There are 2 manuals for GX IEC Developer, a beginner and reference manual. Have you checked both? Also, try to get the programming manuals for the specific PLC you're using. There is a dedicated manual for structured text programming on the Q Series, not sure about the others.

Share this post


Link to post
Share on other sites
The instruction: cj_m(X0, K1); is compiled by GX IEC Developer. But I have no ideea how to insert the label_1 and the instruction(s) asociated with it. I have read all the manuals, but nothing. Edited by wizard

Share this post


Link to post
Share on other sites
nobody uses structured text and CJ_M instruction?

Share this post


Link to post
Share on other sites
In the US we typically use GX Developer, not GX IEC Developer. Which means we program in ladder logic. I could tell you how to do it in Mitsubishi ladder, but not in structured text.

Share this post


Link to post
Share on other sites
crossbow, please do. maybe it will work in GX IEC.

Share this post


Link to post
Share on other sites
Sorry to get this older topic bumped up but I just need to ask what you mean when you're refering to "pointer"? I get it to as you're refering to a variable? Probably way off with this but considering you tried to use CTRL+J which makes me think of Siemens variable list. Anyways I do use Structured text with math calculations as it's simpler in my opinion. If it's variables you're refering to: 1. Insert the variable in the Global or local Variable list depending on the type of variable. 2. Open the structured text POU, write the first part of the variable and it will "fill in" the rest of it. To asign a value to a variable you do this: variblename := 1; Probebly already knew that. Hope this was helpfull! Edited by Alexander K

Share this post


Link to post
Share on other sites
in GX Developer, just place curseor to the far LEFT side of the rung and type pointer address (such as P4). below is just an idea, i used it only once so check manual for type of return instruction... (i think but just don't remember for sure if P1 and P2 subroutines have to end with RET instead of FEND etc.)

Share this post


Link to post
Share on other sites
I was defenetly way off! Pointer is somewhat of a jump in GX Developer?

Share this post


Link to post
Share on other sites
Pointer isn't somewhat of a jump, it's the destination marker for a CJ (conditional jump) or CALL instruction. So the pointer is a target, the CJ or CALL instructions are the commands that actually change the program execution order.

Share this post


Link to post
Share on other sites
I would defenetly put that under the "Somewhat of a jump" category considering it's part of a conditional jump I admit that I should of said that I wasn't refering the pointer it self as a "somewhat of a jump", I was refering to it as part of a jump as on the example screenshot that was posted above, but as I did not see the function that was using the pointer I had to use the "pointer" word to refere to it. I didn't think anyone would get stuck on the "pointer" part. But I guess I should never take that for granted again Edited by Alexander K

Share this post


Link to post
Share on other sites
Don't sweat using IEC Developer, you can do just about anything in it that you can do in regular GX developer, but better. I suspect if you are trying to make subroutine calls from within structured text you are not taking full advantage of the power of IEC developer. Take a look at functions and function blocks. If you want to do something repetitive and call it in several places, Functions and Function blocks are the main intended way to go, and will get you into less trouble. I mainly use Structured text for math and logic that takes more than a few ladder instructions. I use ladder for sequencing becuase it is fast and efficient for the PLC.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0