You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old April 7th, 2020, 06:01 PM   #16
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
But shouldn't the .POS go from 70 to 100 once it goes true?
  Reply With Quote
Old April 7th, 2020, 06:02 PM   #17
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
I am reading the description of the FAL instruction in the ref manual over and over, and I still have no idea what it does.


Use the AVE instruction and multiply the result by 30.


Assuming AVE can write to a REAL destination, there should be enough bits in the mantissa to lose no resolution.
  Reply With Quote
Old April 7th, 2020, 06:03 PM   #18
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
Is a FAL like a compute statement in a loop?
  Reply With Quote
Old April 7th, 2020, 06:04 PM   #19
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
the end goal is to look for any change of value within that section, I may try average if this just doesn't work. But it should!
  Reply With Quote
Old April 7th, 2020, 06:05 PM   #20
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,392
Quote:
Originally Posted by TheWaterboy View Post
But shouldn't the .POS go from 70 to 100 once it goes true?
I'm sure it does happen, it starts at 0, rung goes true, we set the position to 70, iterates to the length, then goes back to 0 once complete. I believe it happens in 1 scan, which is probably why you don't see it in the trend.
  Reply With Quote
Old April 7th, 2020, 06:06 PM   #21
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
Quote:
Originally Posted by drbitboy View Post
Is a FAL like a compute statement in a loop?
Yea in one mode is but its configurable to do other things as well, moving value between arrays etc.
  Reply With Quote
Old April 7th, 2020, 06:08 PM   #22
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
Quote:
Originally Posted by dmroeder View Post
I'm sure it does happen, it starts at 0, rung goes true, we set the position to 70, iterates to the length, then goes back to 0 once complete. I believe it happens in 1 scan, which is probably why you don't see it in the trend.
I'm not as convinced, the section I am looking for (70-100) is static and the section before that (0-69) is moving around and the value I get is moving around so I know its not looking at the right part of the array.
  Reply With Quote
Old April 7th, 2020, 06:13 PM   #23
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,392
Quote:
Originally Posted by TheWaterboy View Post
I'm not as convinced, the section I am looking for (70-100) is static and the section before that (0-69) is moving around and the value I get is moving around so I know its not looking at the right part of the array.
Set up a simple example like mine with known values. I have a 666 in [0], a 5 in [70], 10 in [71] and a 40 in [86]. The result is 55 when I run it.
  Reply With Quote
Old April 7th, 2020, 06:16 PM   #24
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
I do have an array like that... any chance its version specific? I'm on 32.11 on a L16ER.

< grabs at straws >
  Reply With Quote
Old April 7th, 2020, 06:32 PM   #25
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,392
Quote:
Originally Posted by TheWaterboy View Post
I do have an array like that... any chance its version specific? I'm on 32.11 on a L16ER.

< grabs at straws >
I just flashed my L30ER to v32 and tried it, I get the same result I posted before.
  Reply With Quote
Old April 7th, 2020, 06:40 PM   #26
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,136
"The done bit is set when the instruction has operated on the last
element (.POS = .LEN)."
So to do all from 70 to 99, you need to do .pos=70, .len=100
I know, confusing right?
Also, if you start with .pos>=.len, it resets .pos to zero for you.
I regret ever using this instruction.
  Reply With Quote
Old April 7th, 2020, 06:41 PM   #27
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
I'm doing something dumb then...
  Reply With Quote
Old April 7th, 2020, 06:51 PM   #28
chelton
Member
Australia

chelton is offline
 
Join Date: Jan 2012
Location: melbourne
Posts: 106
I agree with Mispeld, Length should be 30

Quote:
Originally Posted by Mispeld View Post
If always 70 to 99, length set to 30 and use [x.POS + 70] as the index.

Expression would be something like:
Total+Array[x.Pos+70]
  Reply With Quote
Old April 7th, 2020, 06:54 PM   #29
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,025
Quote:
Originally Posted by AustralIan View Post
"The done bit is set when the instruction has operated on the last
element (.POS = .LEN)."
So to do all from 70 to 99, you need to do .pos=70, .len=100
I know, confusing right?
Also, if you start with .pos>=.len, it resets .pos to zero for you.
I regret ever using this instruction.
That's what I am doing as well... Tech support said I was doing it right but its not working here. I gotta look through the files, I know I've used this before successfully .
  Reply With Quote
Old April 7th, 2020, 07:05 PM   #30
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 849
You could always do two FALs: one with .LEN=70 and .MODE=ALL; one with .LEN=100 and .MODE=ALL.


Your answer (sum[70 to 99]) is the difference.


But you do need to ensure they both have ALL as the .MODE.

Last edited by drbitboy; April 7th, 2020 at 07:06 PM. Reason: fix typo
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Practice: very first post: on EtherNet/IP solution Productivity PLC and ML1100/1400 GBolin1972 LIVE PLC Questions And Answers 4 August 31st, 2018 11:28 AM
FTV ME and 144 element array? dginbuffalo LIVE PLC Questions And Answers 5 January 23rd, 2018 06:20 AM
Part rejection down line Bob O LIVE PLC Questions And Answers 51 October 28th, 2004 09:20 AM
Building an S7 Array Move Questions DesertDog LIVE PLC Questions And Answers 19 June 17th, 2004 10:51 AM
help with a sorting problem Thyrn LIVE PLC Questions And Answers 37 May 2nd, 2004 01:37 PM


All times are GMT -4. The time now is 05:02 PM.


.