Sign in to follow this  
Followers 0
Ben

RSView32

7 posts in this topic

Hello, I have a RSView 32 Runtime with limited tags (150) so want to reduce total tags by putting bits together in one tag as DINT (32 bits). I imported the DINT tags to RSView and it shows up as "Long Integer", fair enough. Now in the RSView32 I want to use individual bits (0 to 31) as a tag for say Push button and lamp. I don't see a straight forward solution for this. I went through RSView32 User Manual (vw32-um001_-en-e), RSView32 Getting Results (vw32-gr001_-en-e) and part of this forum but can't find it. I also checked the derived tags section but don't know if it can help! Hence I'm sharing this problem with you super talented people. Hope to hear something back soon

Share this post


Link to post
Share on other sites
The tag is the whole DINT, but you need to operate on bits within that DINT in order to light lamps and turn on switches and stuff. So, I am not 100% sure if you will be able to do this with normal objects. If not, you might be making your own pushbutton indicators and such so that you can put expressions in all the right places to only read and write certain bits. It has been along time since I worked with RSVew32, but I am pretty sure there is expression building information in the help files that will show you how to perform bit level operations. Here is a thread that may give you some help with it conceptually, although it is for a different purpose: http://www.plctalk.net/qanda/showthread.php?p=220468#post220468

Share this post


Link to post
Share on other sites
OkiePC, Thanks for Reply and the link. My problem is mainly in RSView. On PLC/Logix5000 side its no problem at all. Let me explain one more time what I'm trying to do. In RSView I have 32 buttons and 32 lamps/indicators. But I don't have individual digital tags for each of this. I have long integer (DINT in PLC) for each of this. When I press a button I want a corresponding bit to turn on in this long integer. Same way when one of the status bit is ON from PLC in a long integer, I want to extract that bit and it. I did go through the sample and created some of my own but the bitwise instructions didn't work for me. I am not sure if anything has changed in RSView since June2007 but all the bitwise instruction results into no value for digital or analog tag in RSView. On the contrary a logical expression like " If Temp_DINT == 8 Then 1 Else 0" did give me correct value for the digital tag. However I can't use it unless I'm masking all the other bits! Can't believe, so much effort is needed just to get to bit level from DINT. I am sure there is a hidden way or may be so obvious, not worth mentioning on RSView documentation...I'm stumped ..need more suggestions

Share this post


Link to post
Share on other sites
So, the bitwise AND "&" operator did not give the expected results? Remember to make your expression the INT_Tag & two to the power of the bit position: Read a bit within INT_Tag: =INT_Tag & 1 'bit 0 =INT_Tag & 2 'bit 1 =INT_Tag & 4 'bit 2 ... =INT_Tag & 32768 'bit 15 To set a bit: INT_Tag = INT_Tag | 2**N 'where N is the bit position I (pipe symbol) = bitwise OR INT_Tag = INT_Tag | 1 'bit 0 INT_Tag = INT_Tag | 2 'bit 1 INT_Tag = INT_Tag | 32768 'bit 15 To Reset a bit: INT_Tag = INT_Tag & ( 2**16 - 1 - 2**N) 'where N is the bit position & = bitwise AND INT_Tag = INT_Tag & 65534 'bit 0 INT_Tag = INT_Tag & 65533 bit 1 INT_Tag = INT_Tag & 65533 'bit 2 ... INT_Tag = INT_Tag & 32767 'bit 15 To Toggle a bit (XOR): INT_Tag = INT_Tag ^ 2**N 'where N is the bit position, ^ = XOR INT_Tag = INT_Tag ^ 1 'bit 0 INT_Tag = INT_Tag ^ 2 'bit 1 etc. I used ** to prefix exponential operations since I could not get superscript to appear correctly and ^ is already a reserved symbol in RSView32. I don't have access to a license for RSView32 Works right now to dig around for you, but there should be a way to do this, and I would be surprised (a little bit anyway) if the syntax changed after 2007. Perhaps other (current) users of RSView32 can pitch in here. Edited by OkiePC

Share this post


Link to post
Share on other sites
How about this? The reject in nest tag having an address like B53:13 so this expression is looking for Bit 7 to be = to 1 64 32 16 8 4 2 1 Weight 6 5 4 3 2 1 0 Bit

Share this post


Link to post
Share on other sites
neilr216 & OkiePC, Thanks for the inputs. the Display portion is working now. I found few things. 1. I created memory tags with type analog. But this tag has to be either integer or long integer data type. "default" or other types doesn't work. I read some where that it can't be "floating point' but I guess I got confused between "type" and "data type" available under the same group. Partly my mistake. 2. I created some derived tags with these expressions but it looks like in "test run" mode the derived tags are not updated/calculated so difficult to test. So far the indication portion is clear, I expect the push button logic also to be same. Will post if I face more challenges..

Share this post


Link to post
Share on other sites
I am currently working on a project where I have a similar issue with tag limit. I saved myself a few tags by writing to a String(ST) files. For example, when i want Product A logic, I write "ProductA" to ST14:0 and use ASCII String Compare(ASR) to Jump to correct subroutine. I found this to be a very intuitive approach. I have about 20 products setup in RecipePro that I write product ID to ST file as an ingredient. I am using a SLC5/04. Gary

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0