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 10th, 2005, 08:19 AM   #1
RheinhardtP
Lifetime Supporting Member + Moderator
Australia

RheinhardtP is offline
 
RheinhardtP's Avatar
 
Join Date: Oct 2004
Location: Perth
Posts: 560
S7 Data block comparisons

Hi All,

I need the CPU to compare 50 bytes of data in 2 seperate Data blocks without PG online,
I couln't find anything in any standard Step 7 blocks,

I know you can compare Real,INT and DINT but need a bit more data compared.

I though of using the XOR DWORD function which will generate a value < 1 if DWORD data is not the same, then i still have to look for value < 1 than ect., and i still have to generate x-amount of merker bits to manipulate a single bit result.
Same or Not.

Must be an easier way.

Would appreciate any feedback

Kind Regards.

Rheinhardt
__________________
“If a cluttered desk is a sign of a cluttered mind, of what, then, is an empty desk a sign?”

― Albert Einstein

www.tier16.com
  Reply With Quote
Old February 10th, 2005, 09:07 AM   #2
Cuke
Member
South Africa

Cuke is offline
 
Join Date: Jan 2005
Posts: 8
Cool

Hello could you break the 50 bytes up into seperate data units like int's then add up all the seperate values to create a new value which is your new data format it could be real int dint word dword what ever and then do the oposite for the data you are compare to, so that you could see and understand what you are looking at.?????
  Reply With Quote
Old February 10th, 2005, 02:21 PM   #3
USDutchman
Member
United States

USDutchman is offline
 
Join Date: Feb 2005
Posts: 26
STL Code

You could use a loop with indirect addressing, stepping though the words 1 by one, and set a flag when your XOR DWORD (or XOR WORD) command finds a difference. Off cource you reset this flag before you start the search.

I have sample code that does something very similar (Uses three DB Blocks as inputs, sets a (horn) bit when there is a difference in the first two, unless the difference was allready detected once indicated by a bit in the mask. I use this routine to find new alarms (bits) in a DB block, and sound a horn for the important new alarms (hence the mask DB). Unfortunately most comments are in Dutch, which you may be able to read if you speak afrikaans?
  Reply With Quote
Old February 10th, 2005, 02:54 PM   #4
DesertDog
Member
United States

DesertDog is offline
 
DesertDog's Avatar
 
Join Date: May 2003
Location: North of Los Angeles
Posts: 348
I have not done this and it would probably not be as simple as this but how about something along these lines:

Take the first byte of each block in as a pointer. Start a loop that reads in the pointed value & compares, Saves the result, an increments the pointer.
__________________
Glenn
MCP, MCSE, MCDBA

If I can't fix it*, it ain't broke.
*With the help of PLCS.net
  Reply With Quote
Old February 11th, 2005, 08:39 AM   #5
Progger
Member
England

Progger is offline
 
Join Date: Feb 2005
Posts: 10
compare

hello,

you wish this function?

http://www.sps-concept.de/download/print/cmp_area.pdf

progger
  Reply With Quote
Old February 14th, 2005, 12:37 AM   #6
RheinhardtP
Lifetime Supporting Member + Moderator
Australia

RheinhardtP is offline
 
RheinhardtP's Avatar
 
Join Date: Oct 2004
Location: Perth
Posts: 560
Looks right

Hi progger,

yes, this looks like the one i need, searched on the Simens website but couldn't find it, any way you can help me get hold of this one??

Regards

Rheinhardt
__________________
“If a cluttered desk is a sign of a cluttered mind, of what, then, is an empty desk a sign?”

― Albert Einstein

www.tier16.com
  Reply With Quote
Old February 16th, 2005, 07:38 AM   #7
Progger
Member
England

Progger is offline
 
Join Date: Feb 2005
Posts: 10
siemens

its not from siemens!
  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
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 06:24 AM
AB SLC505 Remote I/O 1stwave LIVE PLC Questions And Answers 4 August 15th, 2004 09:56 PM
S5 Data Block teh LIVE PLC Questions And Answers 2 August 3rd, 2004 03:51 PM
Building an S7 Array Move Questions DesertDog LIVE PLC Questions And Answers 19 June 17th, 2004 09:51 AM
data share betwwen two s7 plc... how to share and configure it..? teh LIVE PLC Questions And Answers 1 March 29th, 2004 02:57 AM


All times are GMT -5. The time now is 02:29 PM.


.