hexagon logo

Cncini

Hallo Leute,

ich habe meine CNCINI soweit bearbeitet, dass ich mit meiner Vorlage sozusagen ein Neues Programm schreiben kann.
Ich wollte nur einmal wissen, ob ich die WKP Daten zusätzlich in mein Programmkopf bekommen kann. Ich füge noch Bilder hinzu, damit ihr versteht, worum es genau geht.
(Daten vom Bild WKP automatisch in Bild CNCINI einfügen)


Mit freundlichem Gruß

Hien

Attached Files
  • Hello,
    You can populate the WKP data using PUTVALS. If you hover your mouse cursor over the field you want to populate it should show the field descriptor - for example $D for serial number.
  • Thank you for your answer, but I want to write a comment into the program head. I know how to get the variables. I just wanna know how to put it into my Main Command Buffer as a comment.
  • I'm not sure I fully understand what you're trying to do. Can you use GETVALS to assign the info from the WKP to CHR variables and then build a TXT or MSG object that you use in your comment?
  • I already get the variables with getvals and I already wrote a TXT. Now I only have to know, how to put the TXT with a command into my program. Let me show you with pictures what I mean.
    How can I put the TXT into my Main Command Buffer without copy and paste? (Nr. 1 into Nr. 2)

    Attached Files
  • Once you have created your TXT object, you can use INSPRC to add the contents of the TXT to the command buffer.

    INSPRC          (TXT=LDBTXT:mytxt, EOB=N, FRA=1)
  • Thank you for your help. I did it like this.

    ~KOPF1=''
    ~STR1='! Materialnummer....:'
    ~STR2=' '
    ~STR3='~Mat'
    CONCAT (NAM=~KOPF1, STR=(~STR1, ~STR2, ~STR3), RLS=N, INI=Y)

    ~KOPF2=''
    ~STR4='! Zeichnungsnummer..:'
    ~STR5=' '
    ~STR6='~ZNG'
    ~STR7='_'
    ~STR8='~Ind'
    CONCAT (NAM=~KOPF2, STR=(~STR4, ~STR5, ~STR6, ~STR7, ~STR8), RLS=N, INI=Y)


    ~KOPF3=''
    ~STR10='! Bezeichnung.......:'
    ~STR11=' '
    ~STR12='~Bez'
    ~STR13='_'
    ~STR14='~ROTEXGR'
    CONCAT (NAM=~KOPF3, STR=(~STR10, ~STR11, ~STR12, ~STR13, ~STR14), INI=Y)

    ~KOPF4=''
    ~STR15='! Bemerkung.........:'
    ~STR16=' '
    ~STR17='~Bem'
    CONCAT (NAM=~KOPF4, STR=(~STR15, ~STR16, ~STR17), RLS=N, INI=Y)

    CVCHSTXT (CHS=~KOPF1, LIN=1, TXT=KOPF)
    CVCHSTXT (CHS=~KOPF2, LIN=2, TXT=KOPF)
    CVCHSTXT (CHS=~KOPF3, LIN=3, TXT=KOPF)
    CVCHSTXT (CHS=~KOPF4, LIN=4, TXT=KOPF)

    TextToFile (NAM=LDBTXT:KOPF, FIL=C:\Quindos7Lib\Projekt- Programme\KOPF\KOPF.txt)
    PURGE (FIL=C:\Quindos7Lib\Projekt- Programme\KOPF\, KEP=0, SDI=Y)
    INSPRC (TXT=LDBTXT:KOPF, EOB=N, FRA=99)


    I put it into a procedure. Is there any way to hide the procedure?
  • the comment lines that appear as a 'header' at the top of the command buffer when executing the CNCINI command are a mask (MSK) in the HDB. HDBMSK:PROG$HDR

    You can customize by creating your own MSK:PROG$HDR and placing in lower database, like GDB (Global Database) or UDB (User Database).

    Or you can type the CNCINI command and add the keyword HDR and use a different mask.

    Attached Files