Is it not a mistake? Programming technique.

Amid usage DPRD_DAT, MOVE_BLK and simple MOVE blocks to command this module, this simple LAD logic looks a bit rustic. o_OI've even tried masking words in a bid to achive some effect, but to no avail. Anyway I'll try that method.
As concerned byte representation it's being used Big Indian format, since I'm using the same module registers for different kind of commands and have no problems. The only one function is still defying, -Status.


if it was Siemens device, probably I would have decent support. :)


Fair warning, it is entirely possible I messed up the Endianness.


Note that direct bit access only works to IO if it is in the process image. If the device requires a peripheral write or other method, then this won't work. You could also do bit access (DB5.DBX12.4 etc) to whatever DB you are storing the control word in, and then use your normal mechanism to write your DB tag to the drive.



You're right, it probably does feel a bit rustic compared to trying masked moves and such things, but it's quick and clear, and doesn't make the person looking at the code think too hard.
 
This sounds completely normal to me.

It is typical to have a read register that can be 1 of 8 different values.

You use a control word (or part of a control word) to tell the device which of the 8 you want to appear in the read register.

So setting all the bits to 0 is apparently "request that the device puts the value of it's status into the common read register"

Setting it to a different value probably has meaning too. So 001 might be "Current Current in hundredths of an Ampere". 002 might be "temperature in tenths of a degree Celcius". We can only guess what will happen if you put a 111 in there!

I wish you luck with your project.
 
This sounds completely normal to me.

It is typical to have a read register that can be 1 of 8 different values.

You use a control word (or part of a control word) to tell the device which of the 8 you want to appear in the read register.

So setting all the bits to 0 is apparently "request that the device puts the value of it's status into the common read register"

Setting it to a different value probably has meaning too. So 001 might be "Current Current in hundredths of an Ampere". 002 might be "temperature in tenths of a degree Celcius". We can only guess what will happen if you put a 111 in there!

I wish you luck with your project.


I've seen something like that scheme before as well; it could make sense.
 
Again brand and model/serial number would be great, from there someone may have touched it or can delve a little deeper for you
 
Unless I am missing something here, shouldn't the 16-bit value of the control word be ANDed with 8FFF hex (1000 1111 1111 1111) mask and the result written back to the control word?
 
Unless I am missing something here, shouldn't the 16-bit value of the control word be ANDed with 8FFF hex (1000 1111 1111 1111) mask and the result written back to the control word?


Yeahh, this would be reasonable, I mean an assignment "000" amid other "1". I had tried that first of all, but to no avail. No reaction at all. :confused: I used masking method as I had mentioned above.
 
Yeahh, this would be reasonable, I mean an assignment "000" amid other "1". I had tried that first of all, but to no avail. No reaction at all. :confused: I used masking method as I had mentioned above.


Have you also tryed to swap bytes, if you are zeroing bits 1-3 and not 12-14?
 

Similar Topics

I am looking at analysing a sting using an FB in SCL. I have looked at these...
Replies
2
Views
1,549
Hi, I am having an issue downloading to my HMI from my PC. It has been working fine for the last 2 weeks but it must have the Monday morning...
Replies
5
Views
14,471
Hi guys, I am facing a problem on barcode printing mistake. There is one conveyor,two product is going to robot to pick up.my questions...
Replies
27
Views
4,726
I am currently working with a PLC having a power supply unit that accepts dual input voltage (the one that tells "short 110V, open 200V"). I must...
Replies
22
Views
4,126
RSLogix Emulate 500: FYI This 1 line, 2 instruction, ladder code causes a controller fault in the emulator, but always runs perfectly on a...
Replies
5
Views
2,381
Back
Top Bottom