 # paulusB

MrPLC Member

9

1 Neutral

• Rank
Newbie

## Profile Information

• Country Netherlands
1. Hello, just read an old post from you regarding sum floating points.

" You are welcome. And just for laughs here is how to add 25 words of FLOAT [4 WORD at a time]. Note that the index register is double incremented twice, once in the +F +D instruction and immediately afterwards with an output instruction. This moves the index pointer four words for each pass of the FOR/NEXT routine. First pass D100, Second pass D104 etc. etc. SUM FLOAT.pdf Edited 29 Sep 2011 by BITS N BYTES "

Would love to see how you solved this

2. where can I find the attachement? Also want to use this?
3. where can I find the attachement? Also want to use this?
4. Hello, I am looking for some help to build a linear regression formula (https://en.wikipedia.org/wiki/Simple_linear_regression). The scope is to write a function block with a variable "n". The measured "y" will be a real value. The "n" can be 5, 10, 20 or 40. In Excel I have the formula working and made function block without a variable n. I just sum the totals and do the calculations Looking for a way to easy sum the results for different "n". Not much experience with structured text. Please advice. 200727 - Regression_Test_V1.0.cxp 200727 - Regression_Test_V1.0.opt 200727 - Regression_Test_V1.0.bak 200727 - regression - v1.0.xlsx
5. To calculate a walking or moving average I want to use WSFT and SUM in a function block. Does anybody have experience with this? The idea is to take a 1 hour average of a proces value and store this average value each hour. The software then have to calculate the walking or moving average over say 4 hours or 12 hours with a maxium of 24 hours. See attached files with logic but then not in a function block     Walking_AVG.cxp Walking_AVG.opt Walking_AVG.bak
6. ## Split long word for average function in function block

I totally missed the "D" instructions. Thanks
7. ## Split long word for average function in function block

Thanks for the replies. I thought 64 bit real math wasn't available in CX-programmer. But it is.
8. ## Split long word for average function in function block

Because the total amounts can become big and real then les accurate
9. ## Split long word for average function in function block

Figured it out. You have to work with arrays and move them (as discribed in the help )
10. ## Split long word for average function in function block

I'm building a function block to sum flow and production hous and calculate average flow based on a REAL input. For avering I use /L function. The Result R is a LWORD To get a more acurate result I want to convert the result to a REAL. The first two words of the LWORD is the Quatient in DINT The last two words of the LWORD is the Remainder in DINT How do I read out the remainder in a function block. A bit shift is nog working (NASR/NSRL) is only availabe to 32 bits,'. When not in a function block and using de D channel you simply pick the 3rd channel LWORD = D100 D100 = DINT for QuatientA D102 = DINT for remainder. m3_test.opt m3_test.bak m3_test.cxp