Emulator problems...?

shoelesscraig

Member
Join Date
Apr 2009
Location
LA
Posts
382
Ok, so I have a question...I'm pretty sure I'm writing the code correctly, but I could be wrong. Set me straight.

In Logix 5000 I have a bit shift left instruction. The array is set to a DINT address "PSVInputs[0]". I have a control tag set up for it. The Source bit is a BOOL bit, and the length is 10. As I understand it, when the rung is true, it should shift PSVInputs[0].9 out, move everything from PSVInputs[0].0-PSVInputs[0].8 to the left 1, and then load my source bit into PSVInputs[0].0.

I'm thinking it should not affect bits ".10" through ".31". Is this correct?

What IS happening is it is shifting all the way through the 32 bits, start to finish. It is loading the source bit correctly (0 or 1), but the shift keeps moving through all bits, not what I have the length set to. I have tried setting the length to multiple different numbers, but it changes nothing.

So, am I not understanding the instruction? Or...(I haven't mentioned this until now), could it be a problem with RSLogix Emulator? This code is NOT running in an actual Logix processor, but the Emulator on my laptop. Could the emulated processor be whats causing this, even though it would run fine in an actual processor?

I have used the BSL instruction before, but it's been a while...
 
From the help file.

The BSL instruction operates on contiguous data memory. In some cases, the instruction shifts bits past the array into other members of the tag. This happens if the length is too big and the tag is a user-defined data type.

I have just tested it on a working PLC it carried on bit shifting all the way through a DINT.

Cheers

Mark
 
Mark, thanks for your reply, but you just quoted me the text from the "instruction help", which I've already read.

And no, my data type is NOT user-defined OR too long. I have a DINT as my array and the "Length" set to 10. Neither of these should be a problem...

It is my understanding that it should only shift as far as the "Length". Otherwise, what's the point of even having a "Length" field...? If its always going to shift through all 32 bits, why even give me a "Length"?
 
This is normal operation. The PLC-5 and the SLC500 did the same thing. In those controllers if the last bit in the array was in the middle of a word, the bit would continue through the rest of that word. Those controllers would mark the whole word as used so you would not use those bits for anything else.

The 5000 does the same thing through the end of a SINT, INT, or DINT.

OG
 

Similar Topics

Hello all, I'm having problems with an AOI variable. I'm testing my program and have a tag named for instance Scaled_Value from an add on...
Replies
2
Views
1,383
SELECTED NEW FILE SELECTED PROCESSOR TYPE SELECTED I/O CONFIGURATIONS IM UNABLE TO CONFIGURE MY I/O’S. I HAVE A PAPER COPY OF A PROGRAM AND I...
Replies
0
Views
80
HI all, I have a backup from a Series 7000 Cognex camera. I am trying to restore and see the vision tools used in the job. Can I restore those...
Replies
0
Views
67
Hey Guys, I am looking for a cr@cked version of Studio 5000 Logix Emulator V28 or Rslogix5000 V21, which will work with my current emulator...
Replies
1
Views
274
Hello i have Rslogix 5000 installed on win 10 and VM win 7 installed on this laptop. The Emulator installed on the VM7. Rslinx on win 10 does not...
Replies
1
Views
514
Back
Top Bottom