More Tidbits, a challenge.

msinclair said:
Peter:
I think that 16 XIC's or using LN functions aren't such bad ideas. Am I missing something simple?
I would go for the 16 XICs. The 68000 in the PLC5 can do these relative efficiently. DON'T USE A LOG FUNCTION!

How natual logs are calculated

16 XICs are much faster than a LN on just about any CPU unless it has a natural log function in hardware.

The S7 example looks simple because a S7 excels at register operations and programs almost like a regular microprocessor. The S7 doesn't need to load and then store data at each block as these are just instructions in STL.

The question PLC5 programmer should ask is what can be done with the compute block. Is a compute block efficient? I don't have a PLC5 to know.
 
;-)

Ok i guess i read only every fifth word or so.
#4 in original post WAS saying no encode instruction (mea culpa...).
Thanks for interesting solution. If I had to do this
on a system without encode instuction, I would probably use
log functions or lookup table. Once my program is functional
I would look into ways to improve performance IF needed.
Chances are one of the two method (lookup table) would
probably be fast enough for any application. Another benefit is
that it would work on all systems (with or without floating point
math).
 
panic mode said:
;-)
If I had to do this
on a system without encode instuction, I would probably use
log functions

NO, NO, NO! The log instruciton looks like one instruction to you but it uses a Taylor series to compute it. A LN is very math intensive.
You must look under the hood and see how these instructions are implemented. See the link above.

panic mode said:

or lookup table.

Yes, this is MUCH better. I use lookup table when programming with micros that don't have hardware floating point. I use the trick above when the microcontroller or DSP has built in floating point instructions.
 
Ahhh Peter,

Who cares if PLC sweats a bit? Let it run. It's a shame
to have all this processing power and use 5% of it :D
Once the application runs slow, THEN it's time to optimize.
Until then... use macros to insert tons of NOPs :p

(remember "windows source code"?)

Bill : 640kB used to be enough for everybody...
 
(Quote:)
Bill : 640kB used to be enough for everybody...

Get your quotes straight
``640k Should Be Enough for Anybody.''

This was made in 1981 when IBM contracted to Micro-Soft for an OS...it was named Disk Operating System.

YES this part of an OS did in fact LIMIT the power of the processors. Windows wasnt a part of that at the time.
 

Similar Topics

I didn't want to hijack the thread so I started this one. It isn't strictly related to PLC but the techniques could be useful in PLCs too...
Replies
3
Views
5,996
Assume there is a set of 16 bits in N7:0. What is the result in N7:1 SUB 0 N7:0 N7:1 AND N7:0 N7:1 N7:1
Replies
8
Views
5,604
Hello, i need to use P_Intlk and feed the Status interlock OK bit to a P_DOut block. However, there's 17 interlocks for this output. How can I...
Replies
1
Views
109
Hi everyone, recently i worked with a cmore panel and have the question that how can clear alarm list whit remote form,right now only can with...
Replies
0
Views
111
Hello, friends, I am trying to upgrade a system that uses an Onrom incremental encoder (E6B2-CWZ6C) connected to a Danfoss VFD (FC360), but now...
Replies
4
Views
276
Back
Top Bottom