Siemens S7 Plc Db Issue

Join Date
Feb 2008
Location
PUNE
Posts
3
Hi,

We Are Using S7 Cpu 313 And Trying To Change Data Type Of The Db Created. But It Is Giving Error When We Try To Change Data Type From Int Or Bool To Word Or Any Other Type In Db. The Error Says That Initialization Of Independent Of Blok Type And Data Type Not Possible.

Can Anyone Help Me.
 
Hi

Its a bit vaque for me but if this DB is an instance DB ( thus called from a FB)then that may be why you can't change the datatype. In any case for the PLC it does not matter .Its only for us humans .. If its a problem for only 'reading' then create a VAT table and use any format that is useable for you.

Greetings

Eric
 
Dear Mr. Eric,

Thanks for your response. But we have created shared DB and not instance DB. We do not want only for reading but we want to use some DB parameters as word, float etc in PLC logic. But at present when we create DB parameters in DB initialization window and when we enter word in data type for any newly created parameter we get error as incorrect decleration and the initial value entered becomnes red in color.
I think i have some what tried to put more details regarding the problem i am facing.
 
When changing data type in a db, delete the initial value and let the editor select the default of zero for the new data type.
 
This is the biggest complaint that I have with Siemens PLCs, that don't have proper variable convert blocks.

The best way that I know of converting data types, in Siemens S7 PLC is by using a MOVE block, as it will accept just about any data type in, and send out to just about any data type, and doesn't care that the In & Out destinations are not the same type.
 
L D[AR2 said:
When changing data type in a db, delete the initial value and let the editor select the default of zero for the new data type.

I'm with LD on this one.
No initial value to begin with and when you choose the data type it will autofill the initial value without a problem.
 
Hi ALL,


Thanks everyone who has replied for my query.The problem is solved by entering initial value in defined format instead of entering just zero.(Like w#16#0 for word type)
 
Marc U

I am having the same WTF? moment with Step7.

If the mov instruction will take any and move it to any why wont the other blocks????

I hate having to translate everything through several steps of input move to memory loacation then use memory location as an input to a block, then do the same routine on the output side.

I am exploring writing FC blocks that will take any data type, (not Siemens "ANY" actual any.)

The issue is, I must take all data types and identify them and then convert them and then do the operation and then convert the output.

I think this should be include in the standard blocks.

A recent issue I have wrestled with is the scale and limit blocks.

I have disscussed it at length with others here.

It boils down to ease of math with same data types.

SO I am not allowed to use a constant like 100 in a limit block or a scale block.

Even though the help file says I CAN use a constant!

Maybe I am still missing something.

<goes off to read more
 
dahnuguy said:
SO I am not allowed to use a constant like 100 in a limit block or a scale block.

Even though the help file says I CAN use a constant!

I looked at the help file, and it doesn't mention being able to use constants. Are you talking about the FC22 in the standard block library?
 
FC105 Parameters


Parameter Declaration Data type Memory area Description
EN Input BOOL I,Q,M,D,L Enable input with signal state of 1 activates the box.
ENO Output BOOL I,Q,M,D,L Enable output has a signal state of 1 if the function is executed without error.
IN Input INT I,Q,M,D,L,P, Constant The input value to be scaled to a real value in engineering units.
HI_LIM Input REAL I,Q,M,D,L,P, Constant Upper limit in engineering units.
LO_LIM Input REAL I,Q,M,D,L,P, Constant Lower limit in engineering units.
BIPOLAR Input BOOL I,Q,M,D,L A signal state of 1 indicates that the input value is bipolar.A signal state of 0 indicates that the input value is unipolar.
OUT Output REAL I,Q,M,D,L,P Result of the scale conversion.
RET_VAL Output WORD I,Q,M,D,L,P Returns a value of W#16#0000 if the instruction executes without error. See Error Information for values other than W#16#0000.


I assume that it means constant in the regular form. Beside High limit and Lo limit I see "constant" listed.

Is there a special way to enter a constant?

I received the Berger books yesterday, so I am trying to read more before I ask a bunch of dumb questions.

All I had before was the help and regular documentation.
 
OK here is what Hans says about the data type constant.

Automating with Step7 in LAD and FBD
Page 117 upper right second sentence:

"Constants are used to preset variables to a fixed value. The constant is given the a specific prefix depending on the data type."

Then he goes on to disscuss addressing and never mentions constants again. No mention in the index and no mention of what the prefixes are.

So glad I paid so much for the book and one day shipping now.

Can't wait to read about how the "any" data type works.

I am beginning to think I should write a couple of books. So many words. It is an art to be able to say so much and appear to be explaining things in such detail without actualy giveing any real solutions.

I read through a couple chapters and it is a very nicely bound book with very nice pages and a pleasing font. Very well illustrated.

I hope I am missing something from lack of sleep.

I ordered another book on Step7 from a different author.

I know it is simple, it has to be.

It's like this with everything.

Once I learn it , I have a gift of explaining it to others that it seems is quite rare.

I have met very few who can explain things well.

Once I figure this out or get the information from somewhere , I will come back here and give an example of what I mean.

To someone who already knows the answer these half statements sound complete.
 
wow,
i have been reading some of these posts.
have you gone over some of the samples in S7?
The getting started guide under Simatic>documentation>english....
I hope your project
doesnt have to ship soon. You need help.
I hope you are not programming an ob2...ob3..ob4 too
 
dahnuguy said:
I assume that it means constant in the regular form. Beside High limit and Lo limit I see "constant" listed.

Is there a special way to enter a constant?

I received the Berger books yesterday, so I am trying to read more before I ask a bunch of dumb questions.

All I had before was the help and regular documentation.

I just tried it, and it worked fine. FC105 takes an integer input and scales it against two real number limits. I entered 30 for the IN, 20.0 for the min, and 40.0 for the max. Maybe your problem is with the number formats. These are some sample formats for constants:

23 (INT)
23.0 (REAL)
B#16#23 (HEX Byte)
W#16#23 (HEX word)
DW#16#23 (HEX dword)
S5T#230MS (Time)
2#101010101 (Binary)
 
When I tried to write W#16#W30 as a constant for FC105 (IN0)
I had an error .
When I just write 30 it work.
Correct me if I wrong.
When the constant is (on help file say)INT.I can write the number directly.
When the constant Word I need the format of *W#16#xxx.

TIA

Excuse me if I assume dumb assumption.
 

Similar Topics

Hi everyone, Siemens plcs are new to me and i need to upload the program out of several plcs. I have watched the youtube videos and i am...
Replies
10
Views
1,140
Hello. There is a problem with Siemens S7 300. We got a replacement PLC but it does not run the program from the MMC. The new PLC is dated 2011...
Replies
3
Views
678
Afternoon guys & gals I am after some help /guidence on an issue we have been having at work with a reject conveyor. I am part way there (I...
Replies
33
Views
7,476
Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
27
Views
393
Hey guys, I have to take an upload of a program on an S71200 PLC to change a hardware config option and then redownload the program with this...
Replies
3
Views
105
Back
Top Bottom