negative numbers

Stationmaster

Member
Join Date
Aug 2007
Location
Florida
Posts
577
Am using an IDEC MICROSMART PLC, have a good deal of experience, but am having trouble getting it to read out negative numbers. I am using the (INTEGER) option for the ADD instruction but the sum keeps coming out in very high positive numbers for what should be a negative result. Positive sums display just fine. Any one had experience with this? I have scoured the manual, and the "help" pages and find nothing that helps. The manual even has an example:

-4 + -11 = -15

I put in the same values and get "65521" which apears to be the "maximum" less the sum (15)?

any help?
 
I've not used these plcs - just shooting ideas that might help. Is there a method to change the display format when monitoring ? e.g. binary/hex/16bit signed decimal/32 bit signed decimal ?

The number being displayed is correct - it's just not being displayed in the format you want on the programming device.

Looks like this might help:

monitorit.JPG
 
Last edited:
Your perception of the promblem is "spot on". I have tried but cannot find an option to "change data display type". I am working now on downloading the newest version of Windldr, if I can get my disk burner to work I should be up-to-date on the "version" in a few minutes". Thanks
 
OK, As you observed, the data register contains the correct data, just represented by the "large positive number". Thanks to a comment by my brilliant 16 year old, I have come to realize that if I USE the register contents in any other "integer" operation, the operation treats the contents as the "negative integer". So now I'm back on the road again, and thanks very much for your input.

Stationmaster
 
I've just downloaded the demo software and here's some screen shots showing the monitor - hope this helps.

monitorit2.JPG

monitorit3.JPG
 
Last edited:
The reason for this is the different data types as highlighted in the Idec FC5 and FC4 manual.

If you select it as a word register it stores it as two consecutive 16 bit registers to give you a maximum decimal value of 65536, which is why your example was returning 65521(65536 - 15), as if it is below 0 it rolls the value from 0 to 65536.

If it selected as an integer one register acts as an area for -32768 to 0 and the other register stores values from 0 to 32768.

You just have to make sure you select the correct data type as you have found out.

Cheers,

Jon.
 
Thanks again guys.......I fully understand the different data types, got it, no problem. The negative operations are working fine in my program. I still don't see a way to designate a register to read out the data type I need when in the "monitor mode" without setting up the pop-up window for "direct monitor" each time. That's a minor thing though, maybe just a short coming of my "version" of Windldr. I can work with it. You guys got me going again when I was stuck, on a week-end, and I greatly appreciate it.

Thanks again,
Stationmaster
 

Similar Topics

I am using a 1769-IF8 analog input with a 0-10volt load cell input. When I configure the input to 0-10v, it always reads as 0. When I configure...
Replies
12
Views
3,906
The current project involves resetting boiler temp higher with a drop in outdoor temp. This makes the slope negative. I have the y=mx+b thing down...
Replies
6
Views
3,651
I am troubleshooting an actuator which is not responding to the plc code. The range in the channel of the Allen Bradley 1756-OF8 Analog card is...
Replies
1
Views
606
I have 3 koyo PLC's in series. The 1st and 3rd are reporting values correctly but the 2nd is reporting negative values. The values in the PLC and...
Replies
3
Views
1,352
Hi, I am connecting an Autonics make stepper driver type, MD5-ND14 to a Kinco PLC (K205 series) this has a sourcing output which cannot be...
Replies
2
Views
1,102
Back
Top Bottom