You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old January 20th, 2020, 12:26 PM   #16
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 2,299
Quote:
Originally Posted by EStufC View Post
Amid usage DPRD_DAT, MOVE_BLK and simple MOVE blocks to command this module, this simple LAD logic looks a bit rustic. I'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.
  Reply With Quote
Old January 20th, 2020, 02:29 PM   #17
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,086
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.
  Reply With Quote
Old January 20th, 2020, 02:43 PM   #18
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 2,299
Quote:
Originally Posted by AustralIan View Post
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.
  Reply With Quote
Old January 21st, 2020, 06:32 AM   #19
Sydneyguy
Member
Australia

Sydneyguy is offline
 
Join Date: Jun 2019
Location: Sydney
Posts: 21
Again brand and model/serial number would be great, from there someone may have touched it or can delve a little deeper for you
  Reply With Quote
Old January 21st, 2020, 07:42 AM   #20
LadderLogic
Member
United States

LadderLogic is offline
 
LadderLogic's Avatar
 
Join Date: Jun 2003
Location: Chicagolandia
Posts: 1,349
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?
__________________
Don't trust, don't fear, don't beg...
  Reply With Quote
Old January 21st, 2020, 11:39 AM   #21
EStufC
Member
Madagascar

EStufC is offline
 
EStufC's Avatar
 
Join Date: May 2019
Location: Kikuara
Posts: 48
Quote:
Originally Posted by LadderLogic View Post
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. I used masking method as I had mentioned above.
  Reply With Quote
Old January 21st, 2020, 03:14 PM   #22
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,247
Quote:
Originally Posted by EStufC View Post
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. 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?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Unity Pro XL Programming Questions (Timers & Input Activation) cnemeth LIVE PLC Questions And Answers 1 January 13th, 2014 06:16 AM
Best practice for programming in Step 7 glnassaf LIVE PLC Questions And Answers 10 January 3rd, 2013 04:03 AM
sequence programming seee LIVE PLC Questions And Answers 1 August 21st, 2012 10:14 PM
FB programming simulator 100 MOhm LIVE PLC Questions And Answers 3 December 1st, 2004 06:45 AM
SIEMENS S5 - Programming port damaged !! ayman metwally LIVE PLC Questions And Answers 2 August 19th, 2004 12:08 PM


All times are GMT -5. The time now is 05:27 AM.


.