BobLfoot

FAL Instruction - Understanding What Previous Programmer was doing

7 posts in this topic

TopEncoderFAL.thumb.PNG.c343a4337edcb9a1I am trying to figure out why the previous programmer used a FAL Instruction and not a CPT instruction.

The destination is a single REAL not an array.  The FAL.POS tag is not used anywhere else in the program.

I can't find a reason for using FAL.  Any Thought?

Share this post


Link to post
Share on other sites

Copied this from the help file

Description

The FAL instruction performs the same operations on arrays as the CPT instruction performs on elements.

Added rambling thoughts-

Length 520 double integers. It's set to INC so it's going to step through every time the HSC see new data. 

So where's the math (computation) that's being performed? 

This is why I prefer a clear and concise description to blah_blah_blahty_blah tag structure :/

Share this post


Link to post
Share on other sites

@Michael Lloyd if you examine the FAL Instruction you'll see an Expression Field.  This is where the math is done.Top_Stored_Value * Encoder_Top .

My question is the destination makes no reference to an array, but is a single REAL.

If he had used TOP_NEW_VALUE [FAL_Top.POS] for the destination , I could see using it.

1 person likes this

Share this post


Link to post
Share on other sites

Certainly saves memory :shrug: Don't need to use an ONS doing it that way

Share this post


Link to post
Share on other sites
3 hours ago, BobLfoot said:

@Michael Lloyd if you examine the FAL Instruction you'll see an Expression Field.  This is where the math is done.Top_Stored_Value * Encoder_Top .

My question is the destination makes no reference to an array, but is a single REAL.

If he had used TOP_NEW_VALUE [FAL_Top.POS] for the destination , I could see using it.

I hate when something is right in front of me and I don't see it :)

It looks like it performs the function on the array variables (FAL_Top or does that point to an array?), one at a time every time Top_New_Data cycles, and updates the single Real value?

Share this post


Link to post
Share on other sites

@BobLfoot does a cross ref of FAL_Top

Bring up any .dn or other flags used? 

They might be using it as a counter and compute in one instruction 

1 person likes this

Share this post


Link to post
Share on other sites

Nothing found by Cross Referencing the FAL, but as I study the data it looks like they did not imagine they'd get out of range data and had to introduce a filtering mechanism and then save the datums to an FFL.  The FAL was probably the first pass storage attempt and they just changed from an array to a single real.

1 person likes this

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