shoelesscraig
Member
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...
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...