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.

New Here? Please read this important info!!!


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

Reply
 
Thread Tools Display Modes
Old November 24th, 2020, 11:23 AM   #1
Romix
Member
United States

Romix is offline
 
Join Date: Nov 2020
Location: Maryland
Posts: 2
Mitsubishi instruction to Rslogix equivalent

Hi, I have always worked with Rslogix500 and I'm working on a project migrating the code from an old mitsubishi FX64MR to and slc505.
I'm having trouble finding equivalent for the following instruction:
----||----[ROL D3 K1] (The open contact is a bit M98)
Out of the manual, this instruction is rotating left one bit at a time (K1) the number stored at D3 (16 bits number, which changes all the time). Every time M98 receives a pulse the number is shifted to the left.
The only instruction that comes to mind on Rslogix is BSL (bit shift left) as its very similar to what they do; the problem is that if I use it, it would look like this:
File: N7:55 (this can be integer or a word for ex. B3:0)
Control: R6:0
Bit address: (I dont know what to put here as I would usually set the bit that will be writing the high states into the BSL instruction) But the mitsubishi instruction does not "record" from a bit, it just shifts one bit at a time every time M98 makes a pulse.
Length: 16 (bits)
Is there another instruction more suitable for this?
Thank you in advance for your time
  Reply With Quote
Old November 24th, 2020, 11:49 AM   #2
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,959
Quote:
Originally Posted by Romix View Post
Hi, I have always worked with Rslogix500 and I'm working on a project migrating the code from an old mitsubishi FX64MR to and slc505.
I'm having trouble finding equivalent for the following instruction:
----||----[ROL D3 K1] (The open contact is a bit M98)
Out of the manual, this instruction is rotating left one bit at a time (K1) the number stored at D3 (16 bits number, which changes all the time). Every time M98 receives a pulse the number is shifted to the left.
The only instruction that comes to mind on Rslogix is BSL (bit shift left) as its very similar to what they do; the problem is that if I use it, it would look like this:
File: N7:55 (this can be integer or a word for ex. B3:0)
Control: R6:0
Bit address: (I dont know what to put here as I would usually set the bit that will be writing the high states into the BSL instruction) But the mitsubishi instruction does not "record" from a bit, it just shifts one bit at a time every time M98 makes a pulse.
Length: 16 (bits)
Is there another instruction more suitable for this?
Thank you in advance for your time



when the mitsi does the [ROL], I think it "ROLls" bit 15 to bit 0 of D3.


See here, page App-26:


xxx.png




So so I think N7:55/15 would be the [Bit address] of the BSL control, or maybe even N7:55/16 = N7:56:0 and make the length be 17, or it's also possible that control.UL might work instead, depending on when the BSL retrieves the bit.


For sanity's sake and to remove all ambiguity, it's reasonable to duplicate N7:55/15 to another location unaffected by that BSL, before executing that BSL.
  Reply With Quote
Old November 24th, 2020, 11:59 AM   #3
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,959
Update:


From the BSL instruction description here (SLC 500 Instruction Set):
Quote:
For wraparound operation, set the position of the bit address to the last bit of the array or to the UL bit, whichever applies.
What the dickens does "whichever applies" mean?


Heh, I wonder which it is? I can test on a MicroLogix 1100.

Last edited by drbitboy; November 24th, 2020 at 12:36 PM.
  Reply With Quote
Old November 24th, 2020, 12:41 PM   #4
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,959
Heh, it can be either.


Believe it or not, I already had some BSL test code in my 1100.

Counter values being greater than 16 verify (more or less) that the single 1 bit has wrapped around in both methods.



N7:55/0


bsl_test_n7_55_0.png




R6:0.UL


bsl_test_r6_0_ul.png
  Reply With Quote
Old November 24th, 2020, 01:08 PM   #5
Romix
Member
United States

Romix is offline
 
Join Date: Nov 2020
Location: Maryland
Posts: 2
Thank you for even taking the time to test it and making sure it does the trick. I can't thank you enough. Now I can finally keep going with this, I had been breaking my head with this for hours.
  Reply With Quote
Old November 24th, 2020, 01:18 PM   #6
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,959
Quote:
Originally Posted by Romix View Post
Thank you for even taking the time to test it and making sure it does the trick. I can't thank you enough. Now I can finally keep going with this, I had been breaking my head with this for hours.

Glad to help, but note that I used a MicroLogix 1100 and the freebie RSLogix Micro Starter Lite, not a SLC5/05 and RSLogix 500, so YMMV and you should test first.
  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
How To Enter Rslogix 5000???? sundar_scada LIVE PLC Questions And Answers 14 April 2nd, 2016 04:50 PM
RSLogix 5000 MAVE instruction, NumberOfSamples ZonD LIVE PLC Questions And Answers 3 February 4th, 2015 07:16 PM
Rslogix 5000 ALMD instruction help MJC LIVE PLC Questions And Answers 2 December 4th, 2014 04:24 PM
MSG instruction in RsLogix 500 Error Adam303 LIVE PLC Questions And Answers 3 August 13th, 2010 09:51 PM
Mitsubishi FX2N END instruction insterted at step 2000 jazd LIVE PLC Questions And Answers 5 February 22nd, 2010 06:38 PM


All times are GMT -5. The time now is 09:22 AM.


.