Showing results 1 to 8 of 8

Thread: Copy variable value to another in a script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    29.01.2016
    Posts
    24

    Default Copy variable value to another in a script

    I see I can copy variable values from source to target in the Allocations area, but I wish to do it in a script.
    I press a button, a function runs a script and that script should copy a variable (username) into a target variable (who closed the batch).

    There doesn't seem to be a "Write value" variant that takes data from another variable.

    Any ideas?

  2. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    870

    Default Re: Copy variable value to another in a script

    In Allocations you may configure trigger variable and in script - call 'write set value' functions toggling the trigger.

    Or you may define in Recipe Group Manager a recipe linking (coping) the value from one variable to another and in script - call the function executing this recipe.

  3. #3
    Join Date
    29.01.2016
    Posts
    24

    Default Re: Copy variable value to another in a script

    I don't see that anybody should spend money on Recipe Group Manager to copy values. This is an intrinsic function of every CPU ever built.

    What is the priority of an allocation? Will it interrupt my script to perform the copy? If not, how can I determine when the allocation has completed?
    How much do I need to spend to compare two numbers?

  4. #4
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    870

    Default Re: Copy variable value to another in a script

    RGM is rich in useful features and many customers decided to buy the license. The main purpose is for sure not the copying of variable values. I do not know if you have or not the RGM license, I'm giving general answer (imagine you had RGM and no one has informed you that it contains this solution). And I has informed you about possibility in RGM on the second place. No reason for emotional reactions. Maybe a day some customer having RGM will search on Forum for similar advice.

    The time needed to execute an allocation depends on driver of involved variables. I suppose your source variable - username - is SYSDRV variable - so in driver accessing memory of your PC - nano(?)seconds. If for target variable you are using Intern driver then to write the value from allocation the Intern driver will also only access the PC's memory.

    The trigger variable i suppose wiil be internal too, but not set by allocation - set by zenon function 'write set value' created by you. Thus the only eventual delay could be caused by you - if you activate in this function the checkbox 'wait for writing confirmation'. For variables of Intern driver it forces fix wait 30 seconds. Function configured in that way will delay execution of any next function in your script.

    The functions in zenon runtime are executed according to 3 priority levels, documented in Help: Manual -> Functions and scripts -> Functions -> Execution sequence during Runtime.

    What numbers you want to compare? and what for?

  5. #5
    Join Date
    29.01.2016
    Posts
    24

    Default Re: Copy variable value to another in a script

    How did you guess I'm not in charge of deciding whether my company uses Zenon or not?

  6. #6
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    870

    Default Re: Copy variable value to another in a script

    No, i didn't make such assumption.
    Why you think i did?

Similar Threads

  1. How can I copy a variable between projects?
    By mjackson in forum zenon Supervisor
    Replies: 1
    Last Post: 11th July 2014, 14:02
  2. Make a copy of a project.
    By takarlsson in forum zenon Supervisor
    Replies: 5
    Last Post: 21st April 2011, 00:10
  3. Copy recipe to a CE panel.
    By takarlsson in forum zenon Operator
    Replies: 8
    Last Post: 5th April 2011, 13:18
  4. Copy from variable to other variable
    By cyrilfeasy in forum zenon Supervisor
    Replies: 2
    Last Post: 5th November 2009, 17:25
  5. copy recipes
    By hicom in forum zenon Supervisor
    Replies: 9
    Last Post: 11th May 2009, 05:28

Posting Rules

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