PDA

View Full Version : Help~This error comes up after I download my program.


S7PP
September 29th, 2010, 03:50 PM
I'm useing 315-2PN/DP.

S7PP
September 29th, 2010, 03:51 PM
Why is that happening? What's that means? I couldn't find anything wrong. Thanks a lot.

KalleOlsen
September 29th, 2010, 04:11 PM
Try to remove OB8x and OB12x letting the CPU stop. Then the 'Open Block' button is clickable and you can find the cause.

Kalle

S7PP
September 29th, 2010, 04:43 PM
Thanks, I found the problem. The reason is I used a variable to open a DB indirectly like this:

OPN DB [#AlarmDB]

on the top of a FB. However, I have to repeat it more times in between of the program, otherwise, the program will create errors if I use DBWxxx . Seems like it doesn't know which DB it belongs to.

Have you experienced that?

L D[AR2,P#0.0]
September 29th, 2010, 04:48 PM
Are you accessing any other global db variables ?

After

OPN DB [#AlarmDB]

the global DB open is specified by AlarmDB

If you now have some processing as follows

A DB1.DBX0.0
= M0.0

The global DB open is now DB1

S7PP
September 29th, 2010, 05:03 PM
No, I don't have any other global DB opened in the same FB.
If there is a Network that doesn't contain any data fron the DB[#AlarmDB], before the next Network with DBXxxx, I have to do "OPN DB [#AlarmDB] again, otherwise, it won't work.

S7PP
September 29th, 2010, 05:06 PM
The internal variable in FB belongs to it's own instance DB, is it affecting the global DB? shouldn't , right?

L D[AR2,P#0.0]
September 29th, 2010, 05:06 PM
Post your code.

Here's an example showing the global DB changing from 200 to 5

S7PP
September 30th, 2010, 08:44 AM
thanks

L D[AR2,P#0.0]
September 30th, 2010, 08:52 AM
No. Look at the column heading - you are displaying the accumulator (standard). Right click in the RH pane and you can make the DB1 resgister visible.

S7PP
September 30th, 2010, 08:57 AM
OH, OK, it shows 1 from top to the bottom.

I know how to troubleshoot now. Thanks a lot. You are so diligent, alway available to help me. That's so nice. What is your time now?

L D[AR2,P#0.0]
September 30th, 2010, 08:59 AM
15:00

S7PP
September 30th, 2010, 09:04 AM
WOW. yesterday, when I was 18:00, you were already 23:00. you sleep so late.

S7PP
September 30th, 2010, 09:08 AM
Actually, I have more questions, I don't know how to ask. I already struggled for a long time.

I have an FC to create a "one shot" signal every time the input change the status. It works fine if I call it in OB1. However, if I call it an an FB, it doesn't work, it works but the "one shot" signal doesn't show in the FB. I don't know why.

L D[AR2,P#0.0]
September 30th, 2010, 10:46 AM
You are probably using a temp variable to store the rising edge status in the FC- temps are not remembered between calls.(although it can happen depending on what other blocks are called and what they do to their allocated temp data).

When you have a problem post your code.

S7PP
September 30th, 2010, 12:28 PM
I changed it to FB and made a STAT multi instance in another FB. Now it works fine.
Thanks. I'll post the code next time.