PDA

View Full Version : need help!! siemens small scada application


mrsenolsezer
May 25th, 2006, 07:20 AM
Hi guys we are constructing a small production line 5 km away from our factory that includes hydrolic presses and small machines.

We want to get info for production details in Excel, when machine started to work when stopped and how much it produced ...
So i've a sensor on every machine's output and it'll count in a siemens plc.

I made a simple move, got a S7-200 cpu224 and Pc Access software tried in my office, result is;

- I can get connected with RS232/PPI cable
- I can get counter data very well in Excel
- I can't get real time exactly in Excel; year is ok. but hour and minute is always make difference, i set it with microwin but nothing changed.

Now ı connect to plc in my office but how should i connect it 5 km away?
i couldn't find any document about PcAccess that describes ethernet connection.

So can you just give me advices or documents about PcAccess, S7-200 real time clock and ethernet connection of PcAccess and Cpu.

If anyone uses that system please tell me which modules, software are you using and how did you program it?

mrsenolsezer
May 25th, 2006, 11:18 AM
isn't there anybody who has used Siemens PcAccess?

JesperMP
May 25th, 2006, 11:32 AM
Hi mrsenolsezer.

I dont use PCaccess, but I take that you have it set up as an OPC server, and that have it working OK, except for the time problem.

About the time problem. Try to explain how the time data is wrong. How it looks like and how it should look like.

About ethernet. Go to siemens support and search for entry id 14937876. It describes how to set op an OPC connection to S7-200 via a CP243-1.

mrsenolsezer
May 25th, 2006, 11:58 AM
Dear Jesper in Microwin it says;

The Read Real-Time Clock (TODR) instruction reads the current time and date from the hardware clock and loads it in an 8-byte Time buffer starting at address T.The Set Real-Time Clock (TODW) instruction writes the current time and date to the hardware clock beginning at the 8-byte Time buffer address specified by T.TODR: Error Conditions that Set ENO = 0:
0006 Indirect address
000C Clock cartridge not present TODW: Error Conditions that Set ENO = 0:
0006 Indirect address
0007 TOD data error
000C Clock not present
You must code all date and time values in BCD format (for example, 16#02 for the year 2002). See the Table below.

Format of the 8-byte Time Buffer (T)
T T+1 T+2 T+3 T+4 T+5 T+6 T+7
Year Month Day Hours Minutes Seconds 0 Day of Week
00 to 99 01 to 12 01 to 31 00 to 23 00 to 59 00 to 59 0 to 7*
* T+7 1=Sunday, 7=Saturday
0=Disable the day of week
The time-of-day clock initializes the following date and time after extended power outages or memory has been lost:
Date: 01-Jan-90
Time: 00:00:00
Day of Week: Sunday

So i write RTC value to MB6 in Plc program and by PcAccess i can read it in a cell.
I checked mb6 year, mb7 month, mb8 day mb9 hour and mb10 minute.

But while online(in microwin screen not in Excel) :
mb6 is 06 ok
mb7 is 05 ok
mb8 is 12 not ok
mb9 is 01 not ok
mb10 is 23 and changing

i didn't understand what is wrong, what am i doing wrong?
i've updated plc's rtc by microwin's time of day clock menu
but every time wrong values......

JesperMP
May 25th, 2006, 12:21 PM
Hi mrsenolsezer.

MB6 (year) = 6 and MB7 (month) = 5 seems right.
I dont know what MB8 (hour) or MB9 (minute) should have been.
If the hour should be "18" then it displays as "12" with Hexadecimal formatting.

When in MicroWin, can you display the data with different format, HEX, BCD, decimal, octal ?

mrsenolsezer
May 25th, 2006, 12:32 PM
As Mb6 is Bcd i converted it to int and then di and word but i don't understand it is always seems 12 not changing to 18 or 10.

JesperMP
May 26th, 2006, 12:32 PM
You said that you converted MB6 from BCD to Int.
Does that mean that target is the same as the source (from MB6 to MB6)?
I ask because that makes it difficult to troubleshoot.
You need to be able to follow it the whole way from BCD in S7-200, via an INT in S7-200 to a number in Excel. Then you can pinpoint where something goes wrong.

edit: As I dont know S7-200 I am just speculating. But another problem can be if your BCD to INT converting instruction expects a complete word as the source. Then you may have problem with overlapping data because the source is a Byte.
Again, I am speculating as I dont know your code.
Try to post your code as well so people can check it.

knutabru
May 27th, 2006, 04:26 AM
As Mb6 is Bcd i converted it to int and then di and word but i don't understand it is always seems 12 not changing to 18 or 10.

I use two simple subroutines to read the date and time and convert them to INT-values stored in the VB-range.

Try out my sample program and see if that help you in any way.


Regards
Knut.

ungaro
November 24th, 2006, 03:56 PM
well it sure helped me out. I was looking for an answer how to solve this.