Technical Forum

SINUMERIK CNC automation systems

I have sinumerik 840D controller. interested in collecting axis data real-time

Thread Starter: prasang   Started: 9/18/2009 7:47 PM   Replies: 4

« Previous thread Next thread »
Page 1 of 1 (5 items)
  9/18/2009, 7:47 PM
Joined 4/5/2009
Last visit: 12/2/2012
Posts: 2
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
MaxAutomationUK wrote:
Hi santosh,

sorry for the lack of reply, i havnt been on here for a while, do u still need help? if so let me know where you are with things and i will try to assist!, I will say that i had to use the .NET wrapper from the OPC Foundation for the Alarm texts (MBDDE) this is a licensed product so i cannot share although you are welcome to my code if you can get hold of a copy. You can find many examples of data access both on the SIMATIC NET CD under the installation directory/opc2 (C#.NET) and also within the HMI programming package although (VB6)

Hi Max

Following 'Guy' request,am too well interesting in following

a. I have sinumerik 840D controller. interested in collecting axis data real-time
b. suggest me the feasible configuration
will VB --> sinumerik OPC server -> 840 D controller , satisfy my need
c. what server components should i buy from siemens for my need

thanks in advance. take your time, but please do suggest

prasang



=== Edited by O_Moderator @ 9/22/2009 11:14 AM [GMT ] ===
new subject after splitting

Top
  9/22/2009, 11:38 AM
Joined 2/22/2008
Last visit: 4/29/2013
Posts: 40
Rating:
Rated: Outstanding [3.5 out of 5 / rated 4 time(s)]. (4) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

a. I have sinumerik 840D controller. interested in collecting axis data real-time

hi prasang, 

are you using VB6 or .NET? vb6 is very simple to setup as 840D (HMI ADV) uses DDE so you simply set a link topic as below

DDE Connection       =ncdde|ncu840D!
Axis 1 Direct Encoder  '/NCK/MachineAxis/measPos2[1]'

.NET is slightly more involved as OPC is used not DDE

Some more info on your requirements would be good i can explain more specifically

VB -> Sinumerik OPC -> 840D 
this is exactly the method to follow

You could have a look at SIMATIC NET if you wish to purchase products for this, there are many examples in VB.NET & C#, alternately if you are an OEM then SIEMENS may provide the SINUMERIK Programming Package this also has a few examples.

Although all of the required servers come as standard with HMI Advanced / PCU50




Top
  9/8/2011, 9:39 PM
Joined 8/24/2011
Last visit: 7/29/2012
Posts: 5
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 


Hello. I hope this will help you
is easier than readit
 There is a way to send data to the PLC from CNC, and viceversa PLC to CNC they are variables forget the name by now. they are 1024 Word Variables but you can transfer data on any lenght, with  one of these  [n] number of the variable (1..1024)
                              $A_DBB[n]
                              $A_DBW[n]
                              $A_DBD[n]
                              $A_DBR[n]
and in the plc side you just have to use a Function Called FC21.
-----------------------------------------------------------------------------------------------------------------------------------------
     CALL  FC    21
       Enable :=L12.1
       Funct  :=B#16#3
       S7Var  :="PLC-NCK".NC_PLC_Possition_track
       IVAR1  :=354
       IVAR2  :=-1
       Error  :=#FC_21ERROR
       ErrCode:=#FC_21ERROR_CODE
_003: NOP   0

-------------------------------------------DESCRIPTION OF FC21----------------------------------
 
       -Enable= as most functions you can decide whe to use it
      
       - Funct= B#16#3 to read data in PLC from CNC        or B#16#4 to write data to CNC from PLC
       - S7Var= The place in PLC where you want to write the data coming from CNC
        for example any of those
 
         MB[n] or MW[n] or MD[n]  DB[x].DBB[y] or DB[x].DBW[y] or DB[x].DBD[y]
     you can place the data comming from CNC as you need it.

         .IVAR1 = just the number you used at CNC to send data ($A_DBW[354] as in the example) 
          IVAR2 = -1 always minus one, (there are to many uses for FC21 but for experience it has  had always worked using -1 to read and to write)
         Error= A bit if something was wrong with FC21  you have to put any bit there (M[x.x]) or some DBX[m.n]
         ErrorCode= the number of Error happened.here you have to put any MW or DBW type integer.
------------------------------------------------END OF DESCRIPTION-------------------------------------------------------


Well with this information we are ready to start with another concept, SYNCHRONUS ACTIONS

basically a synchronus action is a trik that allow the machine to be doing certain things in the background it does not matters if the machine is reading diferent blocks or doing anything else at the same time, a sinchonized action will do it once you enable it

these Synchronus Actions only 255 and you can see wich ones are available as follows (PCU50)

-MENU SELECT
    - MACHINE DATA 
      [ > ] RIGHT ARROW
           -SYNCHRON.ACTIONS
There is a list of all the decleared Sync Actions and also tells you wich ones are active at this moment.

BACK TO YOUR QUESTION.

I will Create a Subprogram.SPF
as Follows

 SYNCHRO.SPF

N20  IDS=254 DO $A_DBR[500]= $AA_IM[X]  ;(position of Xaxis regarding machine)
N30  IDS=255 DO $A_DBR[500]= $AA_IW[X]  ;(position of Xaxis regarding work piece offcets G54)
N40  M17

THEN YOU HAVE TO CALL THIS SUB PROGRAM FROM ANY OTHER YOU HAVE TO DECIDE WICH EVENT WILL ACTIVATE YOUR IDS´s

CAN BE IN YOUR MAIN SEQUENCE COORDINATOR

JUST YOU HAVE TO PUT THE NAME AND THE MACHINE WILL READ IT AND ENABLE THOSE VARIABLES SO YOU CAN SE CONTINUOSLY WHERE YOUR AXIS ARE.
...
....
....
N330  SYNCHRO
....  
...
M30


HOPE IT HELP





Top
  9/9/2011, 2:07 AM
Joined 11/20/2008
Last visit: 7/26/2012
Posts: 4
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
prasang schrieb:
MaxAutomationUK schrieb:
Hi santosh,

sorry for the lack of reply, i havnt been on here for a while, do u still need help? if so let me know where you are with things and i will try to assist!, I will say that i had to use the .NET wrapper from the OPC Foundation for the Alarm texts (MBDDE) this is a licensed product so i cannot share although you are welcome to my code if you can get hold of a copy. You can find many examples of data access both on the SIMATIC NET CD under the installation directory/opc2 (C#.NET) and also within the HMI programming package although (VB6)

Hi Max

Following 'Guy' request,am too well interesting in following

a. I have sinumerik 840D controller. interested in collecting axis data real-time
b. suggest me the feasible configuration
will VB --> sinumerik OPC server -> 840 D controller , satisfy my need
c. what server components should i buy from siemens for my need

thanks in advance. take your time, but please do suggest

prasang


If you have aleady PCU50 in which installed HMI-Advanced, you don't need to buy any other program.
OPC-server is on the HMI-Advanced program. So on your laptop, you olny execute OPC-client.
OPC-client program is free. So search that on Google.
Because the driver of HMI-Advanced use DCTL, tag of OPC-client must be the type of  '/NCK/MachineAxis/measPos2[1]'

wish sb luck..



=== Edited by contravia @ 9/9/2011 2:12 AM [GMT ] ===


Top
  8/7/2012, 4:14 AM
Joined 4/5/2009
Last visit: 12/2/2012
Posts: 2
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Apologies for delayed follow-up. my requirments are still live...

To be clear:

A. I have 840D+HMI Advanced+PCU 50 connected to a CNC machine
B. I also have a stand alone PC with Win XP

I wany to connect A & B to get Machine data, Axis data etc. real-time for trend plot, trajectory plot, collision check etc.

Can you suggest:

1. How do I physically connect these two. RS 232 or Ethernet ?
2. How do i check if OPC server is running on the Sinumerik.
3. How do i query  the OPC server from my PC. Name of server, Tag name of variable, etc ( i prefer not to buy HMI programming package or other software without understanding the basics.)

thanks a lot for any advice in this regard.

~prasanna


Top
Page 1 of 1 (5 items)
Actions