rs 500 long word data type use

Controls Tech

Member
Join Date
Jun 2014
Location
Inside a OR gate
Posts
54
Hello everyone, I am attempting to "test" some logic with the SQO instruction in RS 500 and using Long Word data type and when I attempt to verify the program I receive ERROR operand sizes do not match. The SQO instruction is set up as so


File #L15:0
Mask B9:100
Dest #L16:0
Control R11:0
Length 20
Position 0


I have the elements in the properties window set on each long type file to 21. Processor is also the Micrologix 1500
I have also attemted to use float type data to no avail, cant really use this type for what I am testing as I want info at word level.
 
Last edited:
...or multiples of 16-bit data?...

Controls Tech said:
File #L15:0
Mask B9:100
Dest #L16:0
Control R11:0
Length 20
Position 0

Interestingly, I've never used the Long data type in RSLogix 500 with a Sequencer instruction before, so I wasn't sure if it only supported 16-bit word elements. I too suspected it might not and went to check the "Help". But one other thing I noticed with your operands was the fact that your Mask operand is a 16-bit Binary Data File element. Masking 32-bit words through a 16-bit Mask word is certainly not going to work as intended, even if it did Verify successfully.

So which of the above is the issue here - lack of 32-bit operand support or incorrect Mask operand?

The "Help"...

RSLogix 500 Help said:
Sequencer Instructions

...These instructions monitor and control multiples of 16 discrete outputs at a time in a single rung...

...If you want to: Transfer/Compare/Load 16-bit data...you can use user-defined integer files with sequencer instructions...

...When your application requires more than 16 bits, use parallel multiple Sequencer instructions...

Here, "multiples" might suggest that they can process multiples of 16 discrete bits of data at a time, meaning they can process the Long data type, which is effectively a 2 x multiple of 16 discrete bits in 1 words.

Also, "user-defined integer files" does include the Long data type, which is a 32-bit integer data type. So maybe all that is wrong here is the Mask operand?

However, "more than 16 bits, use parallel multiple Sequencer" suggests that a single Sequencer instruction cannot handle more than 16 discrete bits at a time, and so you must use subsequent instructions to handle the remainder?

That is not entirely clear. So of my thinking, which is correct?...

1. The Sequencer instructions only support 16-bit data type operands, and not data types with multiples of 16-bit data, such as the Long data type.

...Or...

2. The Sequencer instructions do support data type operands with multiples of 16-bit data, and the actual problem is the 16-bit Mask operand.

Having a route around the Knowledgebase I found this...

1016408 - Error when using Long file in SQO in RSLogix 500
Access Level: TechConnect

"...Words from a long file are able to be used in the SQO instructions..."

Aha, so this tells us that the answer to the above is apparently No.2?

For a MicroLogix 1400 project I happened to have open this morning, I added an SQO instruction and entered 32-bit Long data type addresses for the File and Destination operands. I also entered a 16-bit Mask operand and then performed a "Verify File". The rung verified OK. I then performed a "Verify Project" and received the error "Operand sizes do not match!", which is the same as you received.

I then changed the Mask operand to a 32-bit Long address and performed another "Verify Project". This time it verified successfully.

This very simple offline test would support the technote in saying that the Sequencer instructions do indeed support data types with multiples of 16 bits of discrete data.

To finish it off -

I downloaded this rung with a preceding XIC instruction to toggle it ON/OFF during testing. Even though the Sequencer instructions are intended for purely discrete data processing; to more easily see that the SQO instruction is referencing all of the 32-bit discrete data through the Mask as intended, I'm viewing the Long Data file in Decimal radix.

I set the File operand Long address to "1431655765", which sets every second bit to "1" (bit 0=1, bit 31=0) ensuring we are involving both 16-bit "halves" of the 32-bit Long address.

I set the Mask operand Long address to "-1431655766", which sets every other bit to "1", with respect to the File operand discrete values.

For the Destination operand Long address the value is "0".

When I toggle the XIC and the SQO executes, the Destination operand address value changes from "0" to the same value as the Mask - "-1431655766", which is as expected for the SQO instruction.

If we can say that the Sequencer Output (SQO) instruction does support 32-bit operands (you should verify it does in your MicroLogix 1500) then the next question is why have you used a 16-bit Mask operand with 32-bit data words? If you only need to Mask 16 bits of discrete data to the Destination then the File and Destination operand addresses need only be 16-bit word addresses. If you need to Mask 32 bits of discrete data then the Mask must be changed to a 32-bit Long word address.

Whatever that means you need to do with the existing 16-bit Mask address, and how it is provided its Mask value (fixed, written to before Sequence start, or for each Sequence Step), you will have to figure out in its 32-bit iteration...or ask here if not sure.

Regards,
George
 
Last edited:

Similar Topics

I am getting data from a modbus device and I need to combine 2 16 bit N registers in to 1 32bit L register. I have tried a CPW N242:2 -> L245:0...
Replies
5
Views
2,115
I have a 1747-L552 that has been getting occasional scan times over 1 second. The normal average on this processor is around 20ms but about once a...
Replies
3
Views
1,552
Not sure if this is the right place to post this, but wanted to see if this software was still worth anything to anyone. My father recently...
Replies
1
Views
3,586
Hi Friends I wanted to ask if there is a equivalent data file to LONG in logix 500. I see that the data file LONG can only be used in MicroLogix...
Replies
13
Views
8,884
from a best practice point of view, what is the best way to time events over a long period. I realise that the SLC clock can drift, however 3 or...
Replies
1
Views
1,621
Back
Top Bottom