Showing results 1 to 3 of 3

Thread: EUROMAP63 Solution

  1. #1
    Join Date
    28.09.2015
    Posts
    13

    Default EUROMAP63 Solution

    Hello Community

    I'm working with Euromap63 with FTP server solution.
    The Injection moulding machine configured to generate JOB1.DAT file that contains 81 variables
    syntax of file is: Variable1,Variable2, Variable(n),Variable81

    The Zenon Logic Program take that file and splits it to variables for capability use them in vizualization.
    JOB1.DATA with 81 variable contains more than 255 byte and i can't store data to String.

    Logic Source Code:

    if F_EXIST( 'C:\ftp_home\M12\191\JOB1.DAT' ) then
    ID := F_ROPEN ('C:\ftp_home\M12\191\JOB1.DAT');
    Out1:=FM_READ (ID);
    F_CLOSE (ID);
    end_if;
    if F_DELETE ('C:\ftp_home\M12\191\JOB1.DAT') then S:=0; end_if;
    if S =0 then
    POS:=FIND(Out1,',' );
    POS1:=POS-1;
    INDEX:=INDEX+1;
    S1:=0;
    S:=1;
    end_if;
    // There is last variable
    if POS1=-1 and S1=0 then SET_ShotNumber:=Out1; Out1:=''; index:=0; S1:=1; end_if;
    // 1st Barel zones
    if index=1 and S1=0 then SET_1stBarrelzone13:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=2 and S1=0 then ACT_1stBarrelzone13:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=3 and S1=0 then SET_1stBarrelzone11:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=4 and S1=0 then ACT_1stBarrelzone11:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=5 and S1=0 then SET_1stBarrelzone4:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=6 and S1=0 then ACT_1stBarrelzone4:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=7 and S1=0 then SET_1stBarrelzone3:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=8 and S1=0 then ACT_1stBarrelzone3:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=9 and S1=0 then SET_1stBarrelzone2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=10 and S1=0 then ACT_1stBarrelzone2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=11 and S1=0 then SET_1stBarrelzone1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=12 and S1=0 then ACT_1stBarrelzone1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // 2nd Barel zones
    if index=13 and S1=0 then SET_2ndBarrelzone11:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=14 and S1=0 then ACT_2ndBarrelzone11:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=15 and S1=0 then SET_2ndBarrelzone4:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=16 and S1=0 then ACT_2ndBarrelzone4:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=17 and S1=0 then SET_2ndBarrelzone3:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=18 and S1=0 then ACT_2ndBarrelzone3:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=19 and S1=0 then SET_2ndBarrelzone2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=20 and S1=0 then ACT_2ndBarrelzone2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=21 and S1=0 then SET_2ndBarrelzone1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=22 and S1=0 then ACT_2ndBarrelzone1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // Mold Zones
    if index=23 and S1=0 then SET_MoldZone1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=24 and S1=0 then ACT_MoldZone1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=25 and S1=0 then SET_MoldZone2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=26 and S1=0 then ACT_MoldZone2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=27 and S1=0 then SET_MoldZone3:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=28 and S1=0 then ACT_MoldZone3:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=29 and S1=0 then SET_MoldZone4:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=30 and S1=0 then ACT_MoldZone4:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=31 and S1=0 then SET_MoldZone5:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=32 and S1=0 then ACT_MoldZone5:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=33 and S1=0 then SET_MoldZone6:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=34 and S1=0 then ACT_MoldZone6:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=35 and S1=0 then SET_MoldZone7:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=36 and S1=0 then ACT_MoldZone7:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=37 and S1=0 then SET_MoldZone8:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=38 and S1=0 then ACT_MoldZone8:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=39 and S1=0 then SET_MoldZone9:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=40 and S1=0 then ACT_MoldZone9:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=41 and S1=0 then SET_MoldZone10:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=42 and S1=0 then ACT_MoldZone10:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=43 and S1=0 then SET_MoldZone11:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=44 and S1=0 then ACT_MoldZone11:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=45 and S1=0 then SET_MoldZone12:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=46 and S1=0 then ACT_MoldZone12:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // Injection times
    if index=47 and S1=0 then ACT_1stInjectionTime:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=48 and S1=0 then ACT_2stInjectionTime:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // Cooling Time
    if index=49 and S1=0 then SET_CoolingTime:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=50 and S1=0 then ACT_CoolingTime:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // Holding Time
    if index=51 and S1=0 then SET_1stHoldingTime1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=52 and S1=0 then ACT_1stHoldingTime1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=53 and S1=0 then SET_1stHoldingTime2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=54 and S1=0 then SET_2stHoldingTime1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=55 and S1=0 then ACT_2stHoldingTime1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=56 and S1=0 then SET_2stHoldingTime2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // Holding Pressures
    if index=57 and S1=0 then SET_1stHoldingPressure1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=58 and S1=0 then SET_1stHoldingPressure2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=59 and S1=0 then SET_2stHoldingPressure1:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=60 and S1=0 then SET_2stHoldingPressure2:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    //Clamping Force
    if index=61 and S1=0 then SET_ClampingForce:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=62 and S1=0 then ACT_ClampingForce:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    //Cycle time (cycle value)
    if index=63 and S1=0 then ACT_Cycletimecyclevalue:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    //ETC...
    // 1st parameters
    if index=64 and S1=0 then ACT_1stMaxmeltpressure:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=65 and S1=0 then ACT_1stChangeovermeltpressure:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=66 and S1=0 then SET_1stHoldingpressurechangeoverstrokecyclevalue:= LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=67 and S1=0 then ACT_1stHoldingpressurechangeoverstrokecyclevalue:= LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=68 and S1=0 then ACT_1stMeltcushion:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=69 and S1=0 then SET_1stPlasticizingstrokecyclevalue:=LEFT(Out1,POS 1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=70 and S1=0 then ACT_1stPlasticizingstrokecyclevalue:=LEFT(Out1,POS 1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=71 and S1=0 then ACT_1stPlasticizingtimecyclevalue:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // 2nd parameters
    if index=72 and S1=0 then ACT_2stMaxmeltpressure:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=73 and S1=0 then ACT_2stChangeovermeltpressure:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=74 and S1=0 then SET_2stHoldingpressurechangeoverstrokecyclevalue:= LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=75 and S1=0 then ACT_2stHoldingpressurechangeoverstrokecyclevalue:= LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=76 and S1=0 then ACT_2stMeltcushion:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=77 and S1=0 then SET_2stPlasticizingstrokecyclevalue:=LEFT(Out1,POS 1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=78 and S1=0 then ACT_2stPlasticizingstrokecyclevalue:=LEFT(Out1,POS 1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    if index=79 and S1=0 then ACT_2stPlasticizingtimecyclevalue:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    // Pause Time
    if index=80 and S1=0 then ACT_Pausetimecyclevalue:=LEFT(Out1,POS1 ); Out1:=DELETE( Out1, POS, 1 ); S:=0; S1:=1; end_if;
    There is some ideas how solve that issue:
    1) Create JOB2.DAT and split variables
    2) Create JOB(N).DAT file for each variable
    3) Maybe use Network drive.

    Questions:
    1) The code is working but maybe someone can provide better solution example
    2) What network drive is all about? Does its working like ftp and just generating files to nerwork drive storage?

    The questions below is for IMM supplyer but any information from COPA-DATA Comunity expected.

    3) How many JOB IMM can handle?
    4) How propertly setup Network drive?
    Last edited by klasik : 26th September 2018 at 12:31

  2. #2
    Join Date
    15.11.2016
    Posts
    97

    Default Re: EUROMAP63 Solution

    Hello,

    Because Strings have limited size, you should take a look at Textbuffers.
    See Help: Programming languages - Reference guide -> Advanced operations -> Text buffers manipulation

    You can read the file into a Textbuffer with TxbReadFile
    Then you can read from that buffer as string (liny by line) with TxbGetLine

    Memory for Textbuffers has to be configured in the project settings.

    Hope this helps.

    BR,
    Georg

  3. #3
    Join Date
    28.09.2015
    Posts
    13

    Default Re: EUROMAP63 Solution

    Reading line by line not working at all becouse its outputs to string which is 255 length.

    We need change structure of file from
    1,2,3
    to 

    1
    2
    3
    Maybe someone know how replace 
    all ',' simbols in file with new line simbols using Textbuffer?

Similar Threads

  1. Attribution : Nice solution for machines variables ?
    By julienk in forum zenon Energy Edition
    Replies: 4
    Last Post: 16th December 2010, 11:57

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •