SQO array: negative element values to destination

Run_PLC

Member
Join Date
Jan 2018
Location
North Carolina
Posts
3
I am new to PLC programming, so maybe this is a no brainer:

I am using a DINT array with a negative value of -34000 as one of the elements in an SQO. The destination is another DINT (it works fine when negative values are entered either manually to the DINT or by a MOV). However, the SQO outputs a different positive value into the destination DINT when that step is called.

This is on RSLogix5000 with a compactlogix PLC, advice on how to do this correctly or any workarounds for the same effect would be much appreciated.
 
What is the value of the mask in the SQO? If you are transferring the entire DINT, all the mask bits should be a 1.
 
I entered it in hex format as 16#FFFF so all bits should be going through, correct? I will change to all 1's in decimal format just to check

Thanks
 
Welcome to the forum.

the negative sign is dealing with the sign bit of the word.
I think you have to do a 2's complement of the word to make it work out.
please note I said "I THINK" and I could very well be wrong.

may I suggest that you write down on paper your don't word.
then look at it in binary and write it down in binary.
then do the 2's complement and compare it against what you really want.

I have had this issue before with other ab processors in the past.
different software revs and firmware revs made me rethink the program and rewrite the logic.

james
 
I entered it in hex format as 16#FFFF so all bits should be going through, correct? I will change to all 1's in decimal format just to check

Thanks

16#FFFF is only 16 bits, you need 32

Try 16#FFFF_FFFF or just -1 (decimal)

2018-01-11_164646.jpg
 

Similar Topics

I am a college student and am having trouble programming my final project. Our project is an automated can crushed and the part I am having...
Replies
1
Views
1,533
I have a program that I've used 100 times. SQO settings: File N7:0, Mask 0FFFFh, Dest B3:1, Control R6:0, Length 8, Pos 2. Length & Position...
Replies
48
Views
796
Hello I am trying to make a program work with a sqo instruction .The process has 5 steps ,and a starting step of zero.There should be 8 sec...
Replies
17
Views
972
I am working on a machine that is using the SQO instruction to step through a cycle, but I am getting lost following it. I have not worked with...
Replies
18
Views
3,437
I have an air press that I built ages ago, and it has been running forever. It was originally designed with Rotary Cams and Air actuated buttons...
Replies
1
Views
1,491
Back
Top Bottom