Mathematical operation

A

Thread Starter

Anonymous

For OMRON PLC, I want to perform a methematical operation. If D > 20000, then the lower four BCD numbers of D are stored in 207 data channel, the middle four stored in 208 data channel and the highest four are stored in 209 data channel. How am I suppose to do it??

Example:
if D = 2563021457
then: 0025 to 207
6302 to 208
1457 to 209
 
I'm not overly familiar with Omron's instruction set but it looks like you can make this happen with a MOVD or XFRB instruction. I'm sure that there are other methods as well...
 
C

Curt Wuollet

What I mean is to take long sequences of BCD apart and assemble them again, you mask them off in the source register and load them to the destination then shift them to the weight they belong at. So if you have 4 sources you would use intermediary regs to take each and shift it to it's proper weight and AND them into the long register. Do your math and take the resulting long result and mask off each four to load to an intermediary and shift them back to short format then put them back. Exactly which instructions you use is machine dependent but the method is boilerplate.

Regards

cww
 
Top