![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() 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:
TIA Screenshots: The code![]() The "Edit Symbols" window for this rung: ![]() |
![]() |
![]() |
#2 |
Lifetime Supporting Member + Moderator
|
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. |
![]() |
![]() |
#3 | |
Lifetime Supporting Member
![]() ![]() Join Date: Nov 2006
Location: UK
Posts: 6,538
|
Quote:
|
|
![]() |
![]() |
#4 | |
Member
![]() ![]() Join Date: Jul 2008
Location: Illinois
Posts: 4
|
Quote:
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! |
|
![]() |
![]() |
#5 |
Lifetime Supporting Member
![]() ![]() 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. |
![]() |
![]() |
#6 | |
Member
![]() ![]() Join Date: Jul 2008
Location: Illinois
Posts: 4
|
Quote:
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? |
|
![]() |
![]() |
#7 |
Member
![]() ![]() 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. |
![]() |
![]() |
#8 |
Lifetime Supporting Member
![]() ![]() 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. |
![]() |
![]() |
#9 |
Lifetime Supporting Member
![]() ![]() 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. |
![]() |
![]() |
#10 |
Member
![]() ![]() 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?" ![]() |
![]() |
![]() |
#11 |
Lifetime Supporting Member
![]() ![]() 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 ?
|
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
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 |