Wonderware & Unsigned Integers

Hakutsuru

Member
Join Date
Nov 2005
Location
Texas
Posts
168
Is there any way to force Wonderware to see a number as an unsigned integer?

I have Wonderware 9.5, getting numbers from an AB PLC5/80E, and we're using RSLing Classic for communications. We are using the PLC to transfer data between various computers, and a couple fo the numbers we have need to be able to go up to 65535. The PLC only seems to be able to handle -322767 to 32767. When i set all the bits, I get -1 instead of 65535. Thats not really a big deal because we are not manipulating those numbers in the PLC at all, we're just storing them to be viewed on the MMI. But, I cannot figure out how to tell wonderware that the number is supposed to be unsigned. I remember in the past using some special syntax to control the datatype. For instance N7:0 as UINT (or maybe N7:0U?) in the item name field. That doesn't seem to be working, and I'm not sure if I simply have the wrong syntax, or if it only worked in the past because I had a driver that supported it. I doesn't make sense that the driver should have to 'support' different datatypes, I mean its all just a set of 16 1's and 0's. No real reason ww shouldn't be able to treat it however you want it treated.


Any suggestions?


-jeff
 
Integers are only ranged between -32768 and 32767.


Use Real (Or Float) data type. Those are the F registers in the PLC5.
 
There is indeed such a critter as an unsigned integer. An unsigned 16 bit integer rages 0 to 65535. It can be manipulated and used in calculations in a PLC/5 or SLC - AB has some technotes in its knowledgebase about how to do it for those who are so inclined - but its not too often that one comes across it.


I've not touched Wonderware since version 4, so I don't recall exactly how. I know that in RSView when you create a tag and you need it to be an unsigned integer you must specifically designate the tag as unsigned and cannot leave the tag data type at default as default assumes that anything that is assigned to a N file is a signed integer. Look for something similar in Wonderware. I can't imagine that it doesn't have an unsigned integer data type.

Because most programmers never come across unsigned integers in PLCs make sure you comment the address explaining what it is.
 
Last edited:
What driver are you using? Check the IO servers manual on the driver you are using with WW 9.5 I had to use an R to get my application to view a float, but I was using the TIDIR driver.
 
We're using RSLinx Classic as the Driver. You said you had to use R. Where did you put it? Do you mean that instead of telling it to look at F8:0 you had to tell it R8:0? Or do you mean the item name was F8:0R?

Alaric, I cannot find an option to make it an unsigned integer. WW basically has two options, real (float) or int. Neither works. I don't suppose you have a link to one of those knowledge bases articles handy do you? I have a heck of a time searching through thier KB for anything useful. That little question at the bottom "Was this article helpful?" almost seems like it was put there to mock me.



-jeff
 
Hakutsuru said:
We're using RSLinx Classic as the Driver. You said you had to use R. Where did you put it? Do you mean that instead of telling it to look at F8:0 you had to tell it R8:0? Or do you mean the item name was F8:0R?

Alaric, I cannot find an option to make it an unsigned integer. WW basically has two options, real (float) or int. Neither works. I don't suppose you have a link to one of those knowledge bases articles handy do you? I have a heck of a time searching through thier KB for anything useful. That little question at the bottom "Was this article helpful?" almost seems like it was put there to mock me.


-jeff

I don't think you can force WW into treating the data as being unsigned.

To work around this you can simply move the data from the N table in the PLC into an F table. Then you configure the WW tag as Real and point it to the F address in the PLC.

Not sure how else to do it.

This isn't as efficient as you want to do but you said it was just for a couple of addresses.
 
That would be most unfortunate if WW can't handle an unsigned integer.


The problem with a simple move to a float is that MOV will convert the unsigned integer into a signed float. Thus 50000U becomes -15536.0 when a simple MOV to a float is used.

The work around is:
If N7:0 is where the unsigned integer is stored and N7:0/15 is set then
AND N7:0 7FFFH N7:2
ADD 32768.0 N7:2 F8:0

If N7:0/15 is clear, then simply MOV N7:0 to F8:0

F8:0 now contains a floating point equivalent value of the unsigned value in N7:0
 
Thanks alaric, thats sort of what I was thinking / afraid of, though I wasn't sure how to do it. I was still working on a formula I could use in the WW display, but I can't get around the fact that you gotta treat the numbers completely different depending on whether that msb is set. The only other option I can see is to figure out a way to make the other application write to a float. Maybe thats the easiest solution, but only because I wouldn't have to do the work then. heh


-jeff
 
Jeff, maybe you could do it in the display expression with something like

If Tag >= 0 then Tag Else 65636 + Tag
REM if tag is positive then use tag
REM if tag is negative then add negative value to 65536

(don't remember the syntax for WW but you get the idea)
 
What about scaling in the analog parameters?

Raw = -32767 to 32767

Eng - 0 to 65535

I don't have a PLC handy to try this right now. Other than that, you could do the F type number conversion. Or just add 32767 to the signed integer... You might be off by 1 at zero, but I'm sure there's a workaround. :D
 
You might check the "RSLinx Online Help" under the following topics. If there's a way to do it in RSLinx, you would add formatting parameters to your tag definitions in your tag dictionary. It's a little pesky in that they want signed ints as the format, or unsigned ints via an expression for Excel/DDE communication (gee...thanks). For example, N7:0(B), might do it. That reads it in as a string of bits instead of a signed int. There are other options (of course, none being the obvious unsigned int). It may depend on how Wonderware interprets the results. You'll probably have to play with options in both the RSLinx formatting and the WW tag settings.

generic item format
handling signed/unsigned integers in PLC-5 and SLC 500

This does not preclude the option of Wonderware tags having a user definable data type. A 16 bit unsigned int should be pretty standard.

Hakutsuru said:
Is there any way to force Wonderware to see a number as an unsigned integer?

I have Wonderware 9.5, getting numbers from an AB PLC5/80E, and we're using RSLing Classic for communications. We are using the PLC to transfer data between various computers, and a couple fo the numbers we have need to be able to go up to 65535. The PLC only seems to be able to handle -322767 to 32767. When i set all the bits, I get -1 instead of 65535. Thats not really a big deal because we are not manipulating those numbers in the PLC at all, we're just storing them to be viewed on the MMI. But, I cannot figure out how to tell wonderware that the number is supposed to be unsigned. I remember in the past using some special syntax to control the datatype. For instance N7:0 as UINT (or maybe N7:0U?) in the item name field. That doesn't seem to be working, and I'm not sure if I simply have the wrong syntax, or if it only worked in the past because I had a driver that supported it. I doesn't make sense that the driver should have to 'support' different datatypes, I mean its all just a set of 16 1's and 0's. No real reason ww shouldn't be able to treat it however you want it treated.


Any suggestions?


-jeff
 

Similar Topics

Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
149
Hello everyone, Recently, my Archestra IDE shut down while I was editing. After restarting the IDE, I noticed warning symbols under my opened...
Replies
1
Views
102
Good morning all. I'm working on a rehab where they had a standalone InTouch 2014 HMI that they called a SCADA, but it's really basic stuff. The...
Replies
4
Views
183
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
179
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
162
Back
Top Bottom