Can't use long integers in assignment in RSLogix5000

Join Date
Nov 2009
Location
Maryland
Posts
11
Can't LINT (long integer) tags be used in assignment in RSLogix5000?

When I define any LINT tag and use it either as the source or the destination, or use LINTs as both source and destination, I get "Assignment to tag of specified data type invalid." as an error message. For example (in ST) two LINTs in "MuSecTotal := MuSec1970;" generates the error, but two DINTs in "SecTotal := SecToday;" is fine.

Other things that write into LINTs work, for example "GSV(WALLCLOCKTIME,,CurrentValue,MuSec1970);". The PLC will run the program and watching the tag shows reasonable values. But the assignment operator := does not seem to work with these. It works fine with INT and DINT, even when they are mixed.

"LINT" and "assignment" and ":=" all come up empty when searching the help system. The link for "Data conversion" in the help system is broken.

Thanks!
 
I noticed that after a LINT type tag is defined you can't expand it to its bit components like a DINT or SINT. Also the help files for a command like ADD don't show LINT as a valid type. It's like the type is defined to a name only. You can't really tell whether it's a 64 bit value as you would expect. Very curious.

Also LINT isn't in the list of 'atomic' types as the other numeric types are.
 
You can view the LINT value displayed as a decimal or a binary in Monitor Tags. As a binary, it has 64 digits. Most of them look used, and the ones towards the right are changing.
 
It looks like I have to buy a "TechConnect contract" to read that knowledge base entry - can you tell me anything about that? Or is it easier to construct my own time of day clock in hardware?
 
Thanks, Alaric, I found it too. Turns out the file unzips to a readable file that had this line in it:

<![CDATA[COP(TimeInMicroSeconds,TIME[0],2); (* convert LINT to DINT[2] *)]]>

This is great. The COP command works just fine with a LINT and I can also define an array of INT[4], COP the LINT into it, grab the middle two elements of the array, multiply by 2^16 / 1e6 = 0.065536, and get a REAL that gives seconds with better than millisecond resolution and a 9 year cycle time. I can also do other things with those 16 bit words.

I haven't tried the AOI itself yet...
 
Be careful with floats. The larger a float the lower the resolution.

You loose 1s resolution at 16.7 million. Tenths resolution at a little more than 8 million, and thousandths resolution at around 2 million. Its an artifact of the way floats are represented in a computer and all computers exhibit it. Thats why a LINT was used in the first place.
 
I get the bit about losing resolution; what I really wanted to do at first was to know the seconds since the first scan. Maybe I should turn things into a DINT of tenths of seconds (good for about 14 years) or something like that. Maybe an array of BOOLs.

The AOI outputs LINTs, so it doesn't help much with the difficulty in using LINTs, does it? Seems like it accomplishes rescaling of a still-unuseable number.
 

Similar Topics

I've been playing with Advanced HMI (great product!) to create a remote monitoring screen for a couple air compressors, using Modbus RTU through a...
Replies
5
Views
3,639
Have a Micrologix 1400 Have a lot of integers I am moving in to FIFO to do average speeds on Found out from reading a Q/A from Bernie Carlton how...
Replies
6
Views
2,864
Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
685
Hello all. This is a very lonnnnnnng shot but worth a try. I have an OMS Group Impact100 metering machine. At this customer it blows foam into 3d...
Replies
0
Views
167
Anybody have a recent experience becoming a UL508A panel shop? If so, how long did it take from initial contact to being able to apply stickers...
Replies
3
Views
1,157
Back
Top Bottom