Technical Forum

STEP 7 / STEP 7 Lite

interrupts and lot more questions....

Thread Starter: sky59   Started: 4/9/2012 9:02 AM   Replies: 10

« Previous thread Next thread »
12» Page 1 of 2 (11 items)
  4/9/2012, 9:02 AM
Joined 4/1/2012
Last visit: 9/14/2012
Posts: 30
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
hi I am a newbie to step7 world but I do now programming so I have a lot of questions, please answer according to the numbers if you can....

1- if I use variable REAL in both OB1 and cyclic interrupt, do I need disable interrupt when accessing it in OB1? because it is 4 bytes long and data is not transfered in one machine instruction....how I can be sure these four bytes have not been changed during reading them in OB1?

2- internal tags for WinCC, what is their meaning? I think they are useless? I believe I always need to monitor external tags? am I wrong? when I simulate tags only internal ones can be simulated?

3- I want to run on notebook1 PLCSIM with TCP/IP protocol, on notebook2 I want to run WinCC also with TCP/IP....  can I connect these two notebooks LAN together with crosssed cable and work with WinCC as if I had real PLC machine?
Top
  4/9/2012, 10:02 AM
Joined 9/8/2009
Last visit: 5/23/2013
Posts: 515
Rating:
Rated: Outstanding [3.88 out of 5 / rated 32 time(s)]. (32) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
sky59 wrote:
hi I am a newbie to step7 world but I do now programming so I have a lot of questions, please answer according to the numbers if you can....

1- if I use variable REAL in both OB1 and cyclic interrupt, do I need disable interrupt when accessing it in OB1? because it is 4 bytes long and data is not transfered in one machine instruction....how I can be sure these four bytes have not been changed during reading them in OB1?

2- internal tags for WinCC, what is their meaning? I think they are useless? I believe I always need to monitor external tags? am I wrong? when I simulate tags only internal ones can be simulated?

3- I want to run on notebook1 PLCSIM with TCP/IP protocol, on notebook2 I want to run WinCC also with TCP/IP....  can I connect these two notebooks LAN together with crosssed cable and work with WinCC as if I had real PLC machine?


ad1. You can disable interrupt before accessing variable and then enable it after, if this is needed. You can also execute a fc or fb when interrupt occurs and organize program that a value change in middle of ob1 execution doesn't matter.

ad3. I suggest you to look at sourceforge: nettoplcsim, you can work on same PC, also. Avoid such quasi LAN networks, you can put a small router in between.
Top
  4/9/2012, 10:44 AM
Joined 4/1/2012
Last visit: 9/14/2012
Posts: 30
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Marko Bursic wrote:


ad3. I suggest you to look at sourceforge: nettoplcsim, you can work on same PC, also. Avoid such quasi LAN networks, you can put a small router in between.


Marko thanx,

regarding 3), what is sourceforge? where I find it?  nettoplcsim is a piece of software similar to plcsim but it "works" on LAN?

what you mean by "small router"? piece of hardware ? what it should do?

if I install WinCC and PLCSIM on the same PC  and select MPI for both will they find each other?
will they communicate through MPI?



thanx again!



=== Edited by sky59 @ 4/9/2012 10:47 AM [GMT ] ===


Top
  4/9/2012, 2:56 PM
Joined 9/8/2009
Last visit: 5/23/2013
Posts: 515
Rating:
Rated: Outstanding [3.88 out of 5 / rated 32 time(s)]. (32) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
http://nettoplcsim.sourceforge.net/

nettoplcsim is an add-on to plcsim and gives to plcsim the ability to act like a plc with ethernet. It can emulate ethernet communication with IP address free of choice (HW config), so you will not have a client (SCADA) and server (PLC) with same IP adress conflict.
Usualy plcs and pcs are in network, traffic is administred by router - a device that you find in all lan networks.
Top
  4/9/2012, 6:42 PM
Joined 4/1/2012
Last visit: 9/14/2012
Posts: 30
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Marko Bursic wrote:
http://nettoplcsim.sourceforge.net/

nettoplcsim is an add-on to plcsim and gives to plcsim the ability to act like a plc with ethernet. It can emulate ethernet communication with IP address free of choice (HW config), so you will not have a client (SCADA) and server (PLC) with same IP adress conflict.
Usualy plcs and pcs are in network, traffic is administred by router - a device that you find in all lan networks.


thank you! another small but important step forward for me!
Top
  4/9/2012, 9:32 PM
Joined 4/1/2012
Last visit: 9/14/2012
Posts: 30
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Marco,

I downloaded NettoPLCSIM and it seems to be what I looked for...but..... (not working yet for me :-)

I made so far this:

In WinCC I selected Simatic S7 PROTOCOL SUITE, then TCP/IP and made under it one external tag
the IP address I put 169.254.133.252  which is my internal ethernet address read out in DOS window command IPCONFIG

PLCSIM is already running and selected (TCP/IP), also nettoplcsim is happy with port 102 and I add network address 169.254.133.252  and plcsim address 192.168.01 (these were offered automatically)
simulator is clicked on and after start all it reads last state RUNNING

but WinCC with simple IO window can not access my DB1.DBD14 real value for test

where can i make mistake? is there any way to check this connection?

thanx 1000 times!

Attachment: pic.JPG  (12 Downloads)



=== Edited by sky59 @ 4/9/2012 9:43 PM [GMT ] ===



Top
  4/9/2012, 10:29 PM
Joined 9/8/2009
Last visit: 5/23/2013
Posts: 515
Rating:
Rated: Outstanding [3.88 out of 5 / rated 32 time(s)]. (32) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
you have to be in the same subnet , i think. nettoplcsim is working, you need to read manuals of winnc how to configure your network, even in real world with your settings this wouldn't work. Set nettoplcsim ip address to be in the same network, just last number should be different. In real world all ip addresses are fixed ip, so disable dhcp and set a fixed ip to your pc (like 192.168.1.10) and then set nettoplc address (like 192.168.1.12).
Top
  4/10/2012, 7:45 AM
Joined 4/1/2012
Last visit: 9/14/2012
Posts: 30
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Marko Bursic wrote:
you have to be in the same subnet , i think. nettoplcsim is working, you need to read manuals of winnc how to configure your network, even in real world with your settings this wouldn't work. Set nettoplcsim ip address to be in the same network, just last number should be different. In real world all ip addresses are fixed ip, so disable dhcp and set a fixed ip to your pc (like 192.168.1.10) and then set nettoplc address (like 192.168.1.12).



Marko, thank you for your valuable responses!

Just some more questions if I can.... I hope I can run all PLCSIM, NettoPLCSIM and WinCC on the same computer, the Simatic Manager I can close the moment PLCSIM is downloaded with the software....

Yes, you are right I made some mistakes but still not completely clear for me. I used to use many times LAN connection with static IPs at work with IP diferent by 1 at the last byte.....
What is puzzling me is the fact I want to run on one PC machine. May be my experience is wrong but I thought until I make physical connection to the LAN connector the IP is not given, normally it says at IPCONFIG command "no media" or something similar.

I will try to set up PC the static adress....

thank again
Top
  4/10/2012, 11:43 AM
Joined 4/1/2012
Last visit: 9/14/2012
Posts: 30
Rating:
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
following my previous article.....

I searched again on internet and I understand this, is it correct?

A)  if I use two computers on first there is PLCSIM+NEttoPLCSIM  selected TCP/IP

    on second there is WinCC, IP adresses differ by 1   (last byte of IP,  to be on the same subnet)

    both computers are connected with LAN cable

B) I can use one PC with all softwares on it, then I NEED TO HAVE LAN CABLE anyway to have network card active even I do not connect to the real network...

IP adresses for network card and CPU are the same

Please, is this correct?
Top
  4/13/2012, 10:54 AM
Joined 9/8/2009
Last visit: 5/23/2013
Posts: 515
Rating:
Rated: Outstanding [3.88 out of 5 / rated 32 time(s)]. (32) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
sky59 wrote:
following my previous article.....

I searched again on internet and I understand this, is it correct?

A)  if I use two computers on first there is PLCSIM+NEttoPLCSIM  selected TCP/IP

    on second there is WinCC, IP adresses differ by 1   (last byte of IP,  to be on the same subnet)

    both computers are connected with LAN cable

B) I can use one PC with all softwares on it, then I NEED TO HAVE LAN CABLE anyway to have network card active even I do not connect to the real network...

IP adresses for network card and CPU are the same

Please, is this correct?


A. This is right
B. You don't need to e connected in network to work with all software on same pc. If you configure satic IP address, your computer will not ask a router for a given IP, but it knows that is fixed, so everything will work.
Top
12» Page 1 of 2 (11 items)
Actions