Jump to content

Recommended Posts

Posted

I have a 16 position rotary selector switch I'm trying to program to a CQM1 PLC, that I will also be programming to a micrologix 1200 in the future, using CX Programmer. The switch connects to the PLC using 4 inputs, and activates the inputs in a binary pattern 0-16 as I turn the switch. For example: if the switch is wired to the first four inputs of the PLC, and is turned to "9" 0.0 and 0.3 will be activated and 0.1 and 0.2 will not, just like binary 9 = 1001. I have tried several things trying to get the PLC to accept these inputs as a single "data-point," and then convert to BCD or Hex to use in a timer. I'm having no luck! Does anyone have any ideas how this is done? The switch is a Tosoku DPP01 015L20RCB, and because of the age of the PLC my instruction set is limited. Thank you in advance!

Posted

I agree with MendonSystems, another option:

Since you are using bits 0-3, you can also use the ANDW instruction. 

ANDW 0 #000F DM100

This will and channel 0 with 0000 0000 0000 1111 and put the result in DM100.

Then use the BCD instruction to convert the integer(binary) to BCD.

BCD DM100 DM101

Then use DM101 as your timer preset.

Posted

AND .... you'll probably need to do a little bit of simple math also. Just converting to BCD is only going to give you timer presets from 0 to 15. You'll most likely have to add 1 to get a range of 1 to 16 then multiply that by some constant to get the right timer scale.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...