5/05 won't update S:13

Firejo

Member
Join Date
Jun 2008
Location
Redmond, WA
Posts
1,507
I’ve got a SLC5/05 (Series C, Firmware 11) and I’m trying to use the S:13 register. I’m using an MUL block multiplying an “N” register by 2.97 needing to use the results that are supposed to be in S:13. But they aren’t. Anybody ever come across this? I know the S:13 won’t update when using a float but according to everything I’ve read (and been told) anytime you use a math function the results are stored in S:13/14 as well as where the function block puts it. o_O
 
I’ve got a SLC5/05 (Series C, Firmware 11) and I’m trying to use the S:13 register. I’m using an MUL block multiplying an “N” register by 2.97 needing to use the results that are supposed to be in S:13. But they aren’t. Anybody ever come across this? I know the S:13 won’t update when using a float but according to everything I’ve read (and been told) anytime you use a math function the results are stored in S:13/14 as well as where the function block puts it. o_O

Well, I have never really used S:13/S:14 for anything. However, reading through the Instruction Reference, it specifically states that they will not change for a Floating Point Operation. The example you give of 2.97 is the definition of Floating Point.

Stu....
 
Last edited:
Anybody ever come across this?
Not with the SLC 5/05, but other brands use simlar instructions, and I had a case in the Automation Direct 205. I was trying to use the results of a Multiply, but the stack register did not contain the right value. I was doing some other math operations that were changing the stack before I needed the value. I think you have to use (or save) the S:13 value immediately or it will get changed by other math operations. That is, if it contains a result in the first place.
 
Like Stu said, the math register isn't used for floating point multiplication. The value in the N register is fetched from memory, converted into an IEEE754 float, and then multiplied by the 2.97 float. The result is a float, not an integer. Even if the target is a N file the processor first performs a floating point multiply and then converts it to an integer. If it were to save anything in S:13/14 the bit pattern would be that of a IEEE754 float and the integers values in S:13/14 would be meaningless.

If you want to use S:13/14 then multiply the N address by 297 and then do a double divide (DDV) by 100.
 
Last edited:
The info on the "float" fixed the problem. I had to take a different approach (multiplying by 297 then dividing by 100 didn't work) but I was able to get the S:13 register to do what I needed it to do.
Thanks all!
 
The info on the "float" fixed the problem. I had to take a different approach (multiplying by 297 then dividing by 100 didn't work) but I was able to get the S:13 register to do what I needed it to do.
Thanks all!

Care to share your solution. It may help someone else in the future.
 

---------+-MUL----------+
| N7:0|
| 297|
| GARBAGE|
+--------------+

---------|-DDV----------+
| 100 |
| N7:1|
+--------------+


didn't work? If this is a 5/05 and not a Mircrologix which has 32 bit capabilities then it should have worked (use L files on MLs) What exactly were you wanting then?
 

Similar Topics

I'm using a MicroLogix 1400 controller to communicate with a piece of equipment that takes measurements once every 60 seconds. The piece of...
Replies
6
Views
3,120
I have a managed InTouch Application that I deployed changes to through Archestra IDE yesterday. The only changes I made was adding a solenoid...
Replies
3
Views
93
Does anyone have any experience of using an ***** Flexy for remote programming/maintenance of a Codesys based controller? Rather than using the...
Replies
6
Views
231
So I'm pretty green when it comes to troubleshooting in the field so bear with me. We have a Danfoss valve that opens/closes from an analog output...
Replies
23
Views
957
HI i have a delta VFD M-series in the manual, in order to enter the motor rated current you set the parameter P,52 =the motor rated current my...
Replies
7
Views
665
Back
Top Bottom