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.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old July 30th, 2008, 11:15 AM   #1
aspAddict
Member
United States

aspAddict is offline
 
Join Date: Jul 2008
Location: Illinois
Posts: 4
Data Types - Valid or not? How to change? (newbie question alert)

Okay, so I'm one of the new guys to the PLC world - I do have programming experience but I am quickly finding out how little I actually know.

I recently had a project handed to me that has me confused - I'll try to summarize for the ADD crowd:

We have an error routine that should scan through several inputs. If a condition is met, the program should dump out a hex value to a database table which is later read by our software. The software then puts a message on the screen with the error code. Simple enough - no rocket surgery involved so far.

So far we have been able to confirm that the software is getting into the system and reading the right table, but it's not getting any data out, even when we force an error condition.

During my troubleshooting, I noticed something odd - there are two symbols that have weird data types. I'm used to seeing hex, boolean, etc. but these two have data types of "DB 1" and "FC 84" that match their addresses. (See screenshots below...)

Thinking I had stumbled onto the problem, I tried to update these addresses to "BOOL" or "HEX" but the Siemens program throws an error and tells me that it's not a valid data type for this address.

I've been F1'ing through the help files to try to figure out how to change these, but so far it seems that there is something preventing me from saying "Allow address DB 1 to accept HEX data types" or "Allow address FC 84 to accept BOOL data types." They seem to be stuck somewhere.

My question is two-fold at this point:
  1. Is it possible to update these addresses at all? (I know that FC84 is a system block and is protected, but I fear that something has corrupted the settings on it...)
  2. If it IS possible to update these, how the heck do I go about doing it? I have tried going into the symbols table and changing them there, but with no luck...
Any suggestions/pointers/vodka would be greatly appreciated.

TIA

Screenshots:
The code


The "Edit Symbols" window for this rung:
  Reply With Quote
Old July 30th, 2008, 11:25 AM   #2
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,397
FC84 is a function. ATT is one instance of that function so it has the type of the function.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.
  Reply With Quote
Old July 30th, 2008, 11:44 AM   #3
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,538
Quote:
So far we have been able to confirm that the software is getting into the system and reading the right table, but it's not getting any data out, even when we force an error condition.
How do you know that you are reading the correct table data - what exactly have you done to confirm this ?
  Reply With Quote
Old July 30th, 2008, 11:57 AM   #4
aspAddict
Member
United States

aspAddict is offline
 
Join Date: Jul 2008
Location: Illinois
Posts: 4
Quote:
Originally Posted by L D[AR2,P#0.0]
How do you know that you are reading the correct table data - what exactly have you done to confirm this ?
As much as I hate the phrase, the answer is "This is the way we've always done it."

We have similar systems that can read the data from that particular table, and the software will throw an error if it can't read from that specific table.

What we expect to see happen:
Error condition is met -> Error details are correctly dumped to the table by the PLC -> Software sees the error details and displays them on screen

What I THINK is happening:
Error condition is met -> PLC tries to dump error details to the table but is getting junk data and ignores/discards it without adding it to the table -> Software never sees the data

Like I said, this was just handed to me and I'm learning as I go - any suggestions as to what I should check would be appreciated. Also, if the code looks wrong or if you need more information, please let me know.

Thanks again!
  Reply With Quote
Old July 30th, 2008, 12:01 PM   #5
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,538
Click your mouse on FC84 then hit F1 to read the help on FC84. FC84 will add values to the table until the table is full. Something else must remove entries from the table.


Edit, added info

DB1 is a data block (or table) and contains entries of various data types bools, ints, words etc.

Last edited by L D[AR2,P#0.0]; July 30th, 2008 at 12:04 PM.
  Reply With Quote
Old July 30th, 2008, 12:19 PM   #6
aspAddict
Member
United States

aspAddict is offline
 
Join Date: Jul 2008
Location: Illinois
Posts: 4
Quote:
Originally Posted by L D[AR2,P#0.0]
Click your mouse on FC84 then hit F1 to read the help on FC84. FC84 will add values to the table until the table is full. Something else must remove entries from the table.


Edit, added info

DB1 is a data block (or table) and contains entries of various data types bools, ints, words etc.
Okay - I'm reading through it now, it's starting to come together...one question I have is in regards to the FC84 address itself. I want to be able to look inside of that and verify that the DB1 data block exists, but whenever I try, I get the message "This block is protected" - is there some way to gain access to this? My coworker (who has been dealing with Siemens and AB PLCs longer than me) says that when we upgraded the Siemens software, this FC84 block automagically appeared, and he suspects that it a system block that we can't modify...does anyone know if that is accurate, or am I being steered down the wrong path...?

Also, I noticed that there is an option for "Generate Source" under the File menu. The way my coworker has been doing things is like this:

Go online with the PLC -> Edit the blocks -> Download the changed blocks ONLY -> Try again

Should we be regenerating the source and re-downloading everything when we make a change? What is the best practice in this situation?
  Reply With Quote
Old July 30th, 2008, 12:35 PM   #7
Gnook
Member
United Kingdom

Gnook is offline
 
Join Date: Jan 2007
Location: Wales(UK)
Posts: 20
If the block FC84 is a Siemens function then it will be protected and unless you can chummy up to Siemens somehow you probably won't find out whats going on inside.
If you create an S7 block and use the function 'Generate source' you will find an ST source in the sources folder of your S7 project. If you edit the source and add the line 'Know_how_Protect' then recompile the original program block will become protected, to unprotect you need to remove the 'Know_how_protect' line from the source. It is a technique used by software vendors to ensure bespoke code remains as they intended.
  Reply With Quote
Old July 30th, 2008, 01:03 PM   #8
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,538
If DB1 exists, it will be in the Blocks folder. Double click on it to view it in the editor.

Here's an example view


Last edited by L D[AR2,P#0.0]; July 30th, 2008 at 01:06 PM.
  Reply With Quote
Old July 30th, 2008, 01:12 PM   #9
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,538
..to add further concerning source code. Source code is simply a text file and is not downloaded to the plc. Source code is compiled to produce blocks (OB, FC, DB, FB) which can be downloaded to the plc.

Source code is very useful when posting code on this forum - it means other forum users can take your source and compile it and run the same code as you.
  Reply With Quote
Old July 30th, 2008, 05:15 PM   #10
aspAddict
Member
United States

aspAddict is offline
 
Join Date: Jul 2008
Location: Illinois
Posts: 4
Thanks for the info - I found the DB1 listed in there, and it looks okay, but I think we found the problem...

It looks like my coworker tried to assign some of the variables and such to system addresses - not sure why the software let him do that, but that's neither here nor there...

We called Siemens for some input on what we are running into and during the phone call we determined that the variables were mapped to the wrong memory addresses. According to them, this would cause all kinds of funky output and data exchange depending on the system state at runtime.

They gave us a list of available memory locations that we are allowed to use and we are going to pick through the logic and update everything that is in conflict...

Thanks again for the help - stay tuned for the next episode of "WTF is my code doing?"

  Reply With Quote
Old July 30th, 2008, 05:21 PM   #11
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,538
Can you give a specific example of what you were doing wrong and what these system addresses are ?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


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
RSLOGIX 5000 delete user deifned data types MGuenette LIVE PLC Questions And Answers 6 May 20th, 2021 04:40 PM
How do you change data in a PLC? aNewbie LIVE PLC Questions And Answers 9 May 4th, 2005 09:02 PM
Data Collection TimothyMoulder LIVE PLC Questions And Answers 12 June 30th, 2004 04:36 PM
NEWBIE DL 05 question bgscott LIVE PLC Questions And Answers 9 March 3rd, 2004 09:50 PM
very newbie question about simatic S7 PLCs HG37 LIVE PLC Questions And Answers 5 January 7th, 2003 12:36 PM


All times are GMT -4. The time now is 01:02 AM.


.