19 posts in this topic

I ran across something in the software i'm working on. and I don't quite understand it. So the program uses a XCALL function to call a Pointer. What i don't understand is what happend to the Y after the call. When I went to see the Pointer it has a set and reset FY0 And FY1. What are they and what are they used for?

1.jpg

2.jpg

Share this post


Link to post
Share on other sites

The Y1107 is passed to the FY

Share this post


Link to post
Share on other sites

What am I doing wrong in this simulation? It goes into error once M1 and M2 are ON.... I don't understand it ..

1.jpg

Share this post


Link to post
Share on other sites

There should be a FEND instruction between the standard program and the Pointer subroutine.
 

Share this post


Link to post
Share on other sites

You common pointer in the PLC parameters is probably set to 2048. So change the pointer in the program to 2050.
IF not then What is the Error?

Edited by Gambit

Share this post


Link to post
Share on other sites

Change the P1 into P2050 in the XCALL and after the FEND instruction  at the begin of the sub routine

Share this post


Link to post
Share on other sites

What is the Error?

Share this post


Link to post
Share on other sites

 

I see you also have no RET instrcution at the end of the Sub routine

Share this post


Link to post
Share on other sites

That was the issue. Now it works. I have just one question now. I have in a different part of the project XCALL P1 Y1 Y2

Does it turn both the Y's ON? (with the same subroutine)

Share this post


Link to post
Share on other sites

 

 

fy.PNG

Edited by Theuns
1 person likes this

Share this post


Link to post
Share on other sites

I have another problem again but this time with EFCALL. So i have two PUI's. P0 and P2049. In P0 i call a pointer called P2050 as in the images. The problem is it goes into error again before I even force X1 to ON. Why is that? i'm trying again to simulate a functionality in my sofware.

1.jpg

2.jpg

Share this post


Link to post
Share on other sites

I bet the problem is your program names.  Those names look like reserved pointer addresses.  You need to learn how to use pointers in the program, it's not done by making program names into pointer names.

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