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 February 21st, 2018, 02:29 AM   #1
stretch_af
Member
United States

stretch_af is offline
 
Join Date: Mar 2011
Location: WI
Posts: 5
BSL and a string of BTDs

So this is a PLC-5 program that was converted to a CLX. Not my creation, but Iím trying to iron out some bugs.

This chain of BTDs are tracking bottles through a filler. The 4th BTD has a Source of B18[3] and a Destination of B18[4]. B18[3].16 appears to have moved into B18[4].0 as it is supposed to, but that is where it stops. The bits stop shifting there, Iím not sure why they stop. The first 3 BTDs work just fine.



Any ideas? Should they be separated onto separate branch rungs? Or arranged differently?
Attached Images
File Type: jpg BTD CHAIN.jpg (50.5 KB, 64 views)
  Reply With Quote
Old February 21st, 2018, 07:45 AM   #2
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 175
It's not the BTD, but the BSL that's "stopped working".

The BSL length is 128. In a PLC5 N register, that's 8 words. But B18 is formated as a DINT array, so 128 bits is only 4 words.

I don't understand why the BTDs move an extra bit from the end of one register to the beginning of the next. Essentially it's creating a series of " 15-bit words" in the bit array. You still have that, but you've got 17 unused bits as well.

Change B18 to an INT array, and your code should work better.
  Reply With Quote
Old February 21st, 2018, 04:37 PM   #3
stretch_af
Member
United States

stretch_af is offline
 
Join Date: Mar 2011
Location: WI
Posts: 5
Ahh, that makes sense. Are the BTDs necessary to move move bits around the array? I need to track 108 bits. I suppose I could move bit 31 to the next DINT instead of 16 to fully utilize the DINTs.

I'm still better with PLC5s and SLCs.
  Reply With Quote
Old February 22nd, 2018, 08:48 AM   #4
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 175
OK. I see what happened.

Once upon a time, in the PLC5, there was a BSL(B18,128) that worked just fine.

When converted into ControlLogix, the BSL instruction only works on DINT arrays, not INT arrays (which would be compatible with the PLC5 format.

"Someone" -- either the programmer doing the conversion, or the converter program itself -- change B18 from a INT array to a DINT array. Now the BSL worked.

But because there could be lots of references in the PLC5 to B18/64 (aka B18:4/0, aka B18[4].0), rather then reprogramming all those instances, the "someone" used BTDs to move the 16th bit -- which would have gone to the next word if B18 was an INT, but went to a useless position in a DINT.

What "someone" failed to do was to change the 128 to 256 to keep 8 "words" of data.


So you have 2 choices:
(1) Do the easy thing, and change the length of the BSL from 128 to 256, giving you 128 bits in the first 16 bits of each DINT as your track.

(2) Do the right thing and delete the BTDs, then go through the code, and find every reference for B18[1].0 to .15 and change them to B18[0].16 to .31. Then change B18[2].0 to 15 to B18[1].0 to 15 and so forth. Then you'll have a clean DINT array where every bit represents a location, and you can watch things progress down the line.
  Reply With Quote
Old February 22nd, 2018, 09:59 AM   #5
stretch_af
Member
United States

stretch_af is offline
 
Join Date: Mar 2011
Location: WI
Posts: 5
Yup, I started over, eliminated the BTDs and used a new array.

Thanks for the help.
  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


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


.