SLC MUL Instruction

lendyck

Member
Join Date
Feb 2006
Location
Cambridge, Ontario
Posts
59
I wish I had an AB SLC PLC that I could play with to answer these questions myself, but I don't!

I have a couple questions related to the MUL instruction for the SLC 5/05 PLC.
  • During integer operation, S:13 and S:14 contain the 32-bit signed result of the multiply instruction.
What constitutes an integer (or Float) operation? For example, if Source A is an integer, and Source B is a float, and the Destination is an integer...is this an integer operation? Does it just look at what's in the Destination?

Will S:13 and S:14 contain the signed double integer result even if the MUL result is less than 32,767?

Does the Math Overflow bit (S:2/14) have to be set for the above to work?

  • Is it possible to use S:13 as one of the sources of a MUL instruction, or will the MUL instruction overwrite what's in S:13 before it reads the data there?
I appreciate any help! Many thanks!!

Len
 
The MUL instruction is capable of 32-bit math, if at least one of the Sources (A or B) are floating-point data type (F8:0, etc.). If you try to multiply a float with a constant and move the result to an integer (N7:0, etc.), it will fault the CPU on math overflow. If you put an unconditional OTU coil in a rung addressesd as S:5/0 (math overflow trap), the CPU will not fault, but since you are moving the result to an integer, it is truncated to the max value of a 16-bit integer (32768). If you multiply a floating-point address and move the result to a floating point address, you will get a 32-bit result (i.e. greater than 32768). You can use S:13 as one of the SourceA or SourceB values, but in any case, you should put in the unconditional OTU I mentioned to prevent CPU fault on a math overflow. I have attached examples of a SLC 5/04 program: the first is Float x integer = float; the second is integer x constant value = integer; the third is float x constant value = float; and the last is S:13 x constant value = integer. I hop this helps.
 

Similar Topics

I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
81
Hello all. I have a few SLCs in my plant and of late we've seen a weird issue: The system will be running normally and then randomly the outputs...
Replies
2
Views
95
I am working on setting up a Prosoft Datalogger model PLX51-DLplus-232. This unit will be collecting data from a SLC 5/05 on the DB9 port set to...
Replies
3
Views
103
I have a redundant ControlLogix being set up. This program reads a value from a remote site which happens to be SLC PLC. Rockwell mentions SLC...
Replies
2
Views
96
Hello, I have a ControlLogix redundant controller being set up. The program reads a value from a remote site which hosts a SLC PLC. Rockwell...
Replies
0
Views
80
Back
Top Bottom