Mac9010 Posted August 11 Report Share Posted August 11 Hi everyone I am looking for some information about "shift rigth" in the unilogic software, but I couldn't found anything. I am trying to do a program with the function "shift right " I made it in a PLC JAZZ but now we need to use a PLC unilogic USP- B10 The aplication is the next I have a machine that has a camera, and it takes a photo about a "code" if the code is correct the camera send a signal "ok" or 1. to my PLC. and now when the camera send a signal bad or "0" , and now i would like to make the next. final discard camera bit 1 1 1 1 1 1 1 0 1 camera bit 1 1 1 1 1 1 1 1 0 when the signal goes to cero in a specific point of the machine , i want to activate a signal to discard the product that didn't have the correct code. Someone could help me with this?? or could explain to me, how to can I use the shift rigth, or helpme with some information. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted August 12 MVP 2022 Report Share Posted August 12 Unfortunately, even after all the years UniLogic has been around some of the function blocks haven't made it into the Help. However, if you hover over the letter of any block a tip will appear: You can't see it, but my mouse pointer is over "A" - the source tag or array. "B" is the number of bits in the tag or array to shift. "C" is the value of the bit shifted out. @Cara Bereck Levy - could we get the Shift Rotate functions added to the Help? Joe T. 1 Quote Link to comment Share on other sites More sharing options...
Mac9010 Posted August 13 Author Report Share Posted August 13 HI Joe. Thanks for your help! I have a question, What is the largest number that can be used in the letter "B"? And I understand that the shift source could be a Input of the PLC, but the shift out bit, what kind of value could be ? Thanks in advance Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted August 14 MVP 2022 Report Share Posted August 14 The shift source needs to be numerical tag with more than one bit, like a UINT16. It could be an array of UINTs. When you speak of an Input, do you mean a discrete input? If so, then that won't work. You'll need to write some code to set a bit in the source tag with the Set Bit function under the Logic menu. If you're shifting right, I'd recommend setting bit 15. I don't know what the largest "B" value is. I tested it by making an array of 50 INT16s and entered 512 and it took it. The shift out is a bit. 0 or 1. At this point I'd recommend writing some test code and playing with it online so you can see it work. You're not going to break the PLC. Joe T. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.