ceckert

Using a variable array index in FBD in Studio 5000?

3 posts in this topic

I'm trying to use a tag as an array index in FBD in Studio 5000, this works without issue in ST and LDD, but seems to not be allowed in function block. This seems incredibly short sighted to me which leads me to believe I must be doing something wrong. Is this possible? and if not is there a better way to accomplish what I'm trying to do?
 

Attached are two screenshots, one of my problem with the exact error and one with a (hopefully) temporary workaround that I'm using currently.

Thanks.

hack.png

problem.png

Edited by ceckert

Share this post


Link to post
Share on other sites

Looking at the MOV instruction, it appears your tag is a REAL. The MVMT instruction requires a DINT for the Dest. What are you trying to do?

Share this post


Link to post
Share on other sites

Wow that was stupid. Somehow I didn't notice that you could only move DINT with MVMT. Seems ... limiting. How can I move a REAL conditionally with fbd?

Also, regardless of that, the error message i am getting has nothing to do with that strangely enough, it could just be poor error checking, but it literally says that

Language element can not refer to a variable array index.

which, again, seems very strange to me.

Edited by ceckert

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