Problem--Wrong Values

Automatiker

Member
Join Date
Feb 2006
Location
Saarland
Posts
41
Hi,

As an attachement I placed a cource of my program(Siemens S7). The idea is simply. I will read and write 32bytes from KUKA DP Slave(->HW Config). In FC1 you can see 3 Functions. The first one reads 32Bytes from DP Slave. The third one writes 32Bytes to DP Slave. Siemens and KUKA’s WORDs are different. High and Low bytes must be swap to be able to read right values from this words. The function in the middle of FC1 does.. nothing. Its empty. Funny thing is that it changes the values in its outputs, but only when as output is a “Word” or “INT” from DB5. Tf as outputs there are MWs outputs are 0. I have no idea how can be something in variables from DB5 different from 0. What I also noticed was that if there is no FC20 the values in "Daten_KUKA_1".IN.S_305_320 differs.




Many thanks in advance for your help!
 
Last edited:
First of all, you have posted the code in symbolic form but referred to the blocks by number....this can be most confusing. Better to stick to one or the other.

Now I'm guessing that FC1 is "Verteiler Roboter" (as it's a function with no processing in it). Even though there is no processing, this function will write values to the outputs, the values will be whatever is in the temp data area used by FC1. Now this data may stay constant or it may change, it just depends on what else goes on in the processing. Sometimes you get what appears to be sensible results, sometimes you get what appears to be random results - either way, you cannot rely on an output variable from an FC if it has not been written to in the FC !
 
Many thanks Simon,

apparently it was the problem, that I wanted do read output, that wasn't bevorehand initialised. I cannot find any other error. My source code is in symbolic form because I cannot find how to switch the modus to absolute form. In the window to generate source code option "simbolic" is fixed and I cannot change it.
I will be gratefull for info how to change this option.
 
Automatiker said:
In the window to generate source code option "simbolic" is fixed and I cannot change it.
I will be gratefull for info how to change this option.

You probably have the setting to symbolic.

In the project folder, right click on the Blocks folder and select object properties.

One of the tabs is Address Priority. This has 4 selections starting at top left which is address priority and ending at bottom right which is symbol priority (this is prob where you are).

The project defaults to address when created, so someone has changed this.

In the current selection, if you change the address of a symbol, the program will automatically adjust. If you change to address priority it will not and you will have to update changes yourself.
 
Hi,

one question more. If I jump in one FC to the end of this FC with instruction SPA END(END is at the end of FC) or end the Function with BEB, do I have to always care to assign a value to all of the outputs?
 
Automatiker said:
Hi,

one question more. If I jump in one FC to the end of this FC with instruction SPA END(END is at the end of FC) or end the Function with BEB, do I have to always care to assign a value to all of the outputs?

If the code outside the FC is effected, Yes
 

Similar Topics

Hey everyone, I hope someone can help me here. I have a Red Lion Productivity Station that I am programming to use to display production values on...
Replies
6
Views
6,867
Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
3
Views
87
Hi, I am having a challenge installing a new drive ACS355-03E-44A0-4 as it keeps on displaying Fault code F00018 even when the load is not...
Replies
3
Views
121
I have an issue on my vessel, we have water tight door system created in China, company is no longer operating. We have 7 doors each with their...
Replies
3
Views
113
Hi all. Simple as simple can be, I don't understand what's happening. I'm toggling he OSR on, GX_LUB_PUMP1_LEAD should switch. It doesn't. The...
Replies
27
Views
642
Back
Top Bottom