Forums.MrPLC.com: Controllogix 5000 - Forums.MrPLC.com

Jump to content

  • (2 Pages) +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Controllogix 5000 BSL Rate Topic: -----

#1
User is offline   hipoint2 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 27
  • Joined: 31-January 06
  • Country:United States
    United States
I am new to this control logix stuff so bare with me. I am trying to use a BSL instruction to test some outputs, but my problem is that this instruction HAS to use a double integer. So what I used to do in the old SLC and PLC would be set a bit in a integer and use a timer to keep shifting it left, and just use a MOV instruction to move the integer to the output word. It was easy to move a 16 bit integer word to a 16 bit output word. But now with this 32 bit stuff it gets a little more complicated. I started off using the MOV instruction to the output word then after the 16 bit I had to put in a xic to ote 16 more times to get the higher part of the word. Anybody got any good suggestions? :shrug:
0

#2
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
I'm not sure I am following you, but I think you need to put a DINT in your BSL that you MOV to you output instead of and INT
0

#3
User is offline   hipoint2 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 27
  • Joined: 31-January 06
  • Country:United States
    United States
I know you have to put a DINT in the BSL or when you compile it it will error out. But every time the timer gets done the BSL rung goes true which would shift the bit over one. So the next rung has the MOV which moves the entire BSL destination word right to the Local output word which is only a INT. So after bit 15 in the BSL dest. word is bit 16 but the local output word only goes to 15. Its a 16 bit output card. Make anymore sense or did I do even worse?
0

#4
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
Can you post a screen capture of your rung or post your file? I think I am misunderstanding you :shrug:



All I/O modules I can think of have 32 points even if there are only 8 physical outputs
0

#5
User is offline   hipoint2 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 27
  • Joined: 31-January 06
  • Country:United States
    United States
Let me try this out. How do you do a screen capture?

Attached File(s)

  • Attached File  help.ACD (94.88K)
    Number of downloads: 242

0

#6
User is offline   Ken Moore 

  • Principal Specialist
  • Group: MrPLC Admin
  • Posts: 1,710
  • Joined: 02-July 04
  • Gender:Male
  • Location:Upstate South Carolina
  • Country:United States
    United States
I'm no CLX expert, but could you not use a timer, a counter and indirect addressing instead?
Timer done bit, indexes a counter, the counter value is used for the indirect address. Then you could limit the counter to 0-15.

Just a thought




0

#7
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
Can you post it with you tags in the browser. I think your data types might be the problem

Oh wait. Are you trying to get the upper half of your DINT into slot 4?

Is this what you are looking for. The lower half of test2 will go into slot 3. The upper half will go into slot 4

Attached thumbnail(s)

  • Attached Image: BTD.JPG

This post has been edited by TWControls: 31 March 2006 - 03:16 PM

0

#8
User is offline   Smoke 

  • Automation Controls
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 188
  • Joined: 01-March 06
  • Country:United States
    United States
You could move a zero into Bays_Test_Control.POS after it is EQ to 16

With a 15 in your length in the BSL you will be moving 15 BOOL's at a time.

You could put a 2 the length then skip a BOOL @ "test2"

Or try putting 32768 in the length of the Control "Bays_Test_Control.LEN"

This might stop the setps at BOOL 15. Im not sure though

This post has been edited by Smoke: 31 March 2006 - 05:07 PM

No trees were knowingly harmed in any way during the production and transmission of this message. A rather large number of electrons were somewhat inconvenienced however.
0

#9
User is offline   BobLfoot 

  • The Wizard
  • Group: MrPLC Admin
  • Posts: 3,149
  • Joined: 27-March 06
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States
The simplest sway to screen capture is to use the Print Screen button on your keyboard. This Copies the Screen you are looking at into the windows clipboard. next open Paint and paste the clipboard to a new paint file. Hint when you save select type .jpg as .bmp is much larger and just wastes space.

View Posthipoint2, on Mar 31 2006, 02:46 PM, said:

Let me try this out. How do you do a screen capture?



How about replacing your xic to ote with the following.

SOR GRT MY_DINT 16#00FF MOV 1 MY_DINT EOR

This will move a 1 into your DINT any time a bit beyond 15 is true and restart your test of bits 0 thru 15.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"
0

#10
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
I have not tested this code but try this. Every two seconds the BSL will shift. The upper half of the BSL is distributed to slot 4 using the BTD.

The only problem I see is currently your BSL length is 15. I think you want to change it to 32. Otherwise you will only see bits 0-14 change and only outputs 0-14 of slot 3 will be affected

And I left the unlatch of the BaysOpen in there thought I'm not sure you want that

Attached thumbnail(s)

  • Attached Image: btd2.JPG

This post has been edited by TWControls: 01 April 2006 - 06:47 AM

0

#11
User is offline   Smoke 

  • Automation Controls
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 188
  • Joined: 01-March 06
  • Country:United States
    United States
Bob how does the length work in the control tag.
No trees were knowingly harmed in any way during the production and transmission of this message. A rather large number of electrons were somewhat inconvenienced however.
0

#12
User is offline   BobLfoot 

  • The Wizard
  • Group: MrPLC Admin
  • Posts: 3,149
  • Joined: 27-March 06
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States
I believe that length in the BSl dictates the number of bits to shift and in the BTD it indicates the number of source bits to copy to the destination.

View PostSmoke, on Apr 1 2006, 07:49 AM, said:

Bob how does the length work in the control tag.

BobLfoot

"Poor Planning on your part does not a crisis on my part make"
0

#13
User is offline   Smoke 

  • Automation Controls
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 188
  • Joined: 01-March 06
  • Country:United States
    United States
I'm not refering to the length in the BSL but in the CONTROL tag itself.

By the way I cant get the Emulator to work. I selected the Emulator controler and a vitural backplane in Linx
what else do I need?

Attached Image: Control_tag.JPG

This post has been edited by Smoke: 01 April 2006 - 09:17 AM

No trees were knowingly harmed in any way during the production and transmission of this message. A rather large number of electrons were somewhat inconvenienced however.
0

#14
User is offline   BobLfoot 

  • The Wizard
  • Group: MrPLC Admin
  • Posts: 3,149
  • Joined: 27-March 06
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States
BaysTestControl.Len is where the length from the BSL command is stored. BaysTestControl is the data structure which the BSL uses to accomplish the shift.


View PostSmoke, on Apr 1 2006, 09:13 AM, said:

I'm not refering to the length in the BSL but in the CONTROL tag itself.

By the way I cant get the Emulator to work. I selected the Emulator controler and a vitural backplane in Linx
what else do I need?

Attachment attachment

BobLfoot

"Poor Planning on your part does not a crisis on my part make"
0

#15
User is offline   hipoint2 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 27
  • Joined: 31-January 06
  • Country:United States
    United States

View PostTWControls, on Apr 1 2006, 06:46 AM, said:

I have not tested this code but try this. Every two seconds the BSL will shift. The upper half of the BSL is distributed to slot 4 using the BTD.

The only problem I see is currently your BSL length is 15. I think you want to change it to 32. Otherwise you will only see bits 0-14 change and only outputs 0-14 of slot 3 will be affected

And I left the unlatch of the BaysOpen in there thought I'm not sure you want that


Thanks TW that is what I was looking for. Instead of a MOV using a BTD.
Thanks again guys!
0

#16
User is offline   mellis 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 60
  • Joined: 27-March 06
  • Country:United States
    United States
Just a word of caution about the BTD instruction.

It can generate minor processor faults in a way that is not obvious. If you move a value from a DINT into an INT using a BTD and bit 15 is ON, you get a minor processor fault. It has to do with the way the ControlLogix does type conversions. For whatever reason, it trips over the fact that the value changes from a positive to a negative as a result of the BTD even though the BTD is an instruction intended to manipulate on the bit level.

In your case, I believe you will be OK. As TW pointed out, all the digital I/O modules I've used have a DINT for the output data regardless of the actual point count on the module.

For a more general solution of the problem of moving the bits from a DINT into two INTS, the COP or CPS instructions do a nice job. "COP My_DINT My_INTarray[0] 2" will split a DINT into two INTs that you can then MOV as needed without any annoying minor faults.

Just one of those things that has bit me before.
0

#17
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States

View Postmellis, on Apr 5 2006, 05:34 PM, said:

Just a word of caution about the BTD instruction.

It can generate minor processor faults in a way that is not obvious. If you move a value from a DINT into an INT using a BTD and bit 15 is ON, you get a minor processor fault. It has to do with the way the ControlLogix does type conversions. For whatever reason, it trips over the fact that the value changes from a positive to a negative as a result of the BTD even though the BTD is an instruction intended to manipulate on the bit level.

In your case, I believe you will be OK. As TW pointed out, all the digital I/O modules I've used have a DINT for the output data regardless of the actual point count on the module.

For a more general solution of the problem of moving the bits from a DINT into two INTS, the COP or CPS instructions do a nice job. "COP My_DINT My_INTarray[0] 2" will split a DINT into two INTs that you can then MOV as needed without any annoying minor faults.

Just one of those things that has bit me before.

I have never ran into this and frequently BTD Dints into Ints. Can you post an example so I can play with it?
0

#18
User is offline   mellis 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 60
  • Joined: 27-March 06
  • Country:United States
    United States
TW,

Try this. I don't have a CLX setup in the office right now to check, but this is the situation I ran into in the past. If I can get some time later I'll double check it too.

BTD MyDINT 0 MyINT 0 16

When MyDINT is greater than 32767, you should see a minor fault.

The plant I was working at the time was using version 11 firmware, so it's possible Rockwell changed it in later versions.
0

#19
User is offline   mellis 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 60
  • Joined: 27-March 06
  • Country:United States
    United States
TW,

Update

I found someone in the office with a version 12 processor and checked it. It definitely causes a minor fault in version 12 too.

In my earlier post I said that a value greater than 32768 would cause a fault. That's not 100% accurate. What is actually the trigger is bit 15 ON. A value from 32768 to 65535 in a DINT will have bit 15 ON and that was the range I was interested in since I was only BTDing 16 bits.
0

#20
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
I can't seem to replicate your problem. Below is what I setup and no faults. Am I understanding correctly?

Attached image(s)

  • Attached Image: post-13191-1144352383.jpg

0

#21
User is offline   BobLfoot 

  • The Wizard
  • Group: MrPLC Admin
  • Posts: 3,149
  • Joined: 27-March 06
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States
TW if you then use your INt as the present of a timer or the process value of a PID you'll get an error.

View PostTWControls, on Apr 6 2006, 03:39 PM, said:

I can't seem to replicate your problem. Below is what I setup and no faults. Am I understanding correctly?

BobLfoot

"Poor Planning on your part does not a crisis on my part make"
0

#22
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
I understand that, but mellis is saying with a BTD. I think someone lost me. :doh:
0

#23
User is offline   mellis 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 60
  • Joined: 27-March 06
  • Country:United States
    United States
TW,

Your example looks just like mine.

Are you checking under Controller Properties, Minor Faults tab? This isn't going to turn the "Online" box red and say "Fault". It's just going to log a minor fault each time it happens. It doesn't halt the processor, just wastes processor time.

What firmware version are you running? I still haven't checked under 13 or 15 yet. But I'm betting they are the same.

Now like Bob says, stuffing a negative number into a timer preset will get you a major fault. But that's a different story.
0

#24
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
Yes, checked the minor faults tab. No fault. I tried on version 15 but I'm pretty sure that I have been doing that same thing since version 10 or so.

Can you post a sample program that is doing it? May be I'm missing something you are saying.
0

#25
User is offline   mellis 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 60
  • Joined: 27-March 06
  • Country:United States
    United States
TW,

I don't think it's the program. It's just one instruction. And I can see by the data that the source is a DINT and the dest is an INT. I can also verify that it is the same bit pattern in both tags. Can't imagine how there could be a problem there.

I'll see if I can flash the processor I have to ver 15. The guy who is using it will probably not like that idea much <eg>.

The only other thing I can think of is processor model? I've seen this in L1 processors and the one I checked today is a L55. What are you using?

I really didn't expect this to turn into a discussion, but now I am really curious as what exactly is going on here.

This is the kind of question the Rockwell forum was actually pretty good at. Someone like Ron Bliss would pop up with a definitive answer. I'm going to miss that.
0

#26
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
I would not be suprised if they were not here somewhere.

I tried it on an L55. I'm not doubting you but apparently I'm just not following you. There is not chance that your destination bit was greater than zero or you length was greater than 16 is there. Or am I way out in left field :doh:
0

#27
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States
I've got L1s and L55s doing BTDs in the same manner. Thats why I am confused. I may need to put something in mine to keep this from happening. But I got to make them do it first, thats why I'm trying to make sure I fully understand
0

#28
User is offline   Contr_Conn 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 426
  • Joined: 07-September 03
  • Country:United States
    United States
I did not follow this discussion from beginning, but as far as I know in every version of logix every time you put into the integer tag a value with bit 15 set, it will generate minor fault "Overflow". You may just ignore it or reset it.
It's always recomended to use DINT for all calculations including 16 bit processing.
0

#29
User is offline   TWControls 

  • Automation Therapist
  • Group: MrPLC Admin
  • Posts: 4,439
  • Joined: 03-October 05
  • Gender:Male
  • Location:Roanoke, Virginia
  • Country:United States
    United States

View PostContr_Conn, on Apr 6 2006, 08:58 PM, said:

I did not follow this discussion from beginning, but as far as I know in every version of logix every time you put into the integer tag a value with bit 15 set, it will generate minor fault "Overflow". You may just ignore it or reset it.
It's always recomended to use DINT for all calculations including 16 bit processing.


Ok, guess I need to hunt and figure out how I have never managed to set bit 15 :doh:
0

#30
User is offline   Contr_Conn 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 426
  • Joined: 07-September 03
  • Country:United States
    United States

View PostTWControls, on Apr 6 2006, 09:05 PM, said:

Ok, guess I need to hunt and figure out how I have never managed to set bit 15 :doh:


Actually I was not correct:
If you are using BTD, no overflow will be generated as this is just a bit pattern.
Same with COP instruction, as it copies a bit pattern without checking a value.

But if you are using MOV <DINT> to <INT> and DINT >32767, then overflow will be set, but result will be the same as BTD

(Type 04) Program Fault
(Code 04) Arithmetic overflow. Result of an arithmetic instruction out of range.
Task: MainTask
Program: MainProgram
Routine: MainRoutine

Here is definition:
Overflow is set if the value you are storing cannot fit into the destination.
Either the value is greater than the maximum value for the destination
or the value is less than the minimum value for the destination.




This post has been edited by Contr_Conn: 06 April 2006 - 08:31 PM

0

Share this topic:


  • (2 Pages) +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users