Creating and reading a variable of several scripts

I'm creating a series of scripts to our helpdesk and one of the things we're trying to do is play critical for users when troubleshooting connects to the system before being queued. However, we want to be able for that turn on or off depending on whether there are no failures.

I record outages in help desk in a script, and I give them also the ability to switch a variable in this script as to if the failure Prompt critical should play or not.

The question I have is how to read the value of this variable in my main script? What is the best way to achieve this?

Why not write the value of the variable (power) in an XML file?

See the attached file.

Please rate of messages.

adignan-

Tags: Cisco Support

Similar Questions

  • Create and insert a variable

    Hello

    I work with Captivate v4 and I want to create a passage and do not pop up message fonts/colors of my choice on the quiz results page.

    The success message appears only if the learner has scored 80% + and the failure message with the option to retake the test appears only if the learner has scored at least 80%.

    I'd appreciate any help and advice on how to do... I did it before, but for the life of me I cannt repeat.

    Thank you, if everything is fine.

    Noel

    Hi Noel,

    You want appear them immediately when the score slide appears?

    If Yes: create two legends, one for the neck and the other for the failure of messages and set invisible (in the Properties dialog box).

    Create a tip action, a condition where you can use one of the cpInfoPercentage of cpQuizInfoPointsScored or system variables to see one of these two legends. You can trigger this action by entering the score slide.

    Lilybiri

  • How can I create and use global variables in busy border?

    to preserve the previous value while being used between parent and child symbol?

    For some reason, you actually have to call the function inside of another symbol (and not the bodies as before). New version of the same exercise with the following structure where each rectangle and the associated text is encapsulated in an object symbol :

    To make the accessible service for another symbol, you add SYM (the parameter of substr() is also adapted to the new id)

    Stage.compositionReady event handler:

    Total = 0;

    //-----------------------------------------

    SymincrementByInstanceNum = function (eClick)

    {

    Console.log (eClick.target.getAttribute ("id"));

    => "Stage_object2_yellowRect2_RoundRect" for example

    var num = eClick.target.getAttribute("id").substr (12, 1);

    Total += parseInt (num);

    SYM. $("total") .html ('total' + total);

    }

    Each of the object.yellowRect.Click event handler becomes:

    sym.getComposition () .getStage ().incrementByInstanceNum (e);

    The link given above has been updated and now includes the second version.

    Gil

  • I have adobe reader xi and can not find the "create button" in order to combine several files into a single pdf

    I have adobe reader xi and can not find the "create button" in order to combine several files into a single pdf

    Hello

    Reader is software to view PDF' only.

    You must either a pack PDF to perform the function of thin or Acrobat.

    Reader is not the software to perform editing functions.

    Concerning

    Sukrit diallo

  • The user select several shapes and assign the variable

    Hello

    I worked mainly Storyline articulate and now I'm back in Captivate 8 I really miss simplicity of the scenario

    I need to create a very simple interaction "select all the boxes." I want the text in boxes and the user to select as much as they wish (there are 10 in total) and that selected they should change their 'down' State, so it is obvious that they have enabled the box on and then a variable is assigned to show later in the course.

    I told the Action for the award of variable when the user clicks on but just slide forward and I can't select several options. Also, there is a pause on the button continue for the slide does not move on to the next.

    Can someone tell me how I can do this SIMPLE interaction quickly?

    A simple action will always be out of reading, replace it with a standard advanced action (can be a single line, but I think you will need more than one).

    Why choose Standard Simple action? -Captivate Blog

    It also has a link to a YouTube video.

    Keep with scenario then... for me it's very simple, but that's just me.

    What should be stored in the variable? The number of texts chosen? Or do you want a text variable and change this variable from 0 to 1 if the corresponding text is selected?

    Why not use the interaction of checkboxes? It's pretty simple to use, it will store the answers selected in the variables.

    If you explain better what you want to, have solutions for all situations.

  • How to create a report of vm-info of several scripts?

    Hello

    I combined several scripts for the following and it ceates 4 correct outputfiles.

    But it is possible to create a 1fichierdesortie with all the lines?

    Thank you, Robert

    1. Initialization section *.

    ##################################

    1. Declaring global and static variables

    2. VMware VirtualCenter server name

    $vcserver = 'coat '.

    1. Path to the output file

    $outputfile1="D:\Output_scripts\VMware\VMinfo_part1.csv".

    $outputfile2="D:\Output_scripts\VMware\VMinfo_part2.csv".

    $outputfile3="D:\Output_scripts\VMware\VMinfo_part3.csv".

    $outputfile4="D:\Output_scripts\VMware\VMinfo_part4.csv".

    $outputfile_total="D:\Output_scripts\VMware\VMinfo_Total.csv".

    #################

    1. Add VI-toolkit

    #################

    Add-PSsnapin VMware.VimAutomation.Core

    Initialize - VIToolkitEnvironment.ps1

    to connect-VIServer $vcserver

    1. *************   Start Process 1   *********************************************

    $report1 = @)

    Get - VM | % {

    $vm = $_ | Get-VMGuest

    $row = "" | Select VMname VMTools, IPAddr1, IPAddr2, IPAddr3, OsFullName, host name

    $row. VMname = $_. Name

    $row. VMTools = $vm. State

    $row. Host name = $vm. Host name

    $row. IPAddr1 = $vm. IPAddress [0]

    $row. IPAddr2 = $vm. IPAddress [1]

    $row. IPAddr3 = $vm. IPAddress [3]

    $row. OsFullName = $vm.osfullname

    $report1 += $row

    }

    $report1 | Sort - property VMname | Export-Csv $outputfile1 - NoTypeInformation

    1. *************   Start Process 2   *********************************************

    $Report2 = @)

    Get - vm | % {

    $vm = get-view $_.ID

    $row = "" | Select-Object VMname, VMState, TotalNics, TotalCPU "TotalMemory Mb.

    $row. VMname = $vm. Name

    $row. VMState = $vm.summary.runtime.powerState

    $row. TotalNics = $vm.summary.config.numEthernetCards

    $row. TotalCPU = $vm.summary.config.numcpu

    $row. {TotalMemory MB} = $vm.summary.config.memorysizemb

    $report2 += $row

    }

    $report2 | Sort - property VMname | Export-Csv $outputfile2 - NoTypeInformation

    1. *************   Start Process 3  *********************************************

    $report3 = @)

    Get - vm | % {

    $vm = $_

    $disksize = (($_ | get-harddisk | mesure-objet-propriété CapacityKB-somme).) Sum) / 1 Mb

    $_ | Get-Datastore. Where-Object {$_.} Type - eq "VMFS"} | % {

    $row = "" | Select "Disc Total GB" data store, Aantaldisks, VMname

    $row. VMname = $vm. Name

    $row. Aantaldisks = $vm. Harddisks.Length

    $row. Data store = $_. Name

    $row. {Total GB drive} = $disksize

    $report3 += $row

    }

    }

    $report3 | Sort - property VMname | Export-Csv $outputfile3 - noTypeInformation

    1. *************   Start Process 4  *********************************************

    $ROTAP = @{name = "ROTAP"; Expression = {$_.} CustomFields.Item ("ROTAP")}}

    $User = @{name = 'User'; Expression = {$_.} CustomFields.Item ("User")}}

    $Description = @{name = 'Description'; Expression = {$_.} CustomFields.Item ("Description")}}

    Get - VM | Select-Object - property 'name', $ROTAP, $User $Description | Sort - Name property. Export-Csv $outputfile4 - noTypeInformation

    1. *************   End Process   ***********************************************

    Disconnect-VIServer-confirm: $false

    Run the Export - Csv cmdlets 4 each write a specific table in the CSV file.

    Each group has different properties or columns if you want to make the analogy with the CSV file.

    Because you can't have a CSV file with different columns that will not be possible as far as I know.

    An alternative could be that you collect all the information in a line that has all the properties.

    This way you go you end up with 1 table that you can export to CSV file 1.

    Here's how it could be done for the first 2 CSV files

    Get-VM | % {
         $vmGuest = $_ | Get-VMGuest
         $vm = Get-View $_.ID
    
         $row = "" | Select VMname, VMTools, IPAddr1, IPAddr2, IPAddr3, OsFullName, Hostname,
                            VMState, TotalNics, TotalCPU, "TotalMemory Mb"
         $row.VMname = $_.Name
         $row.VMTools = $vmGuest.State
         $row.Hostname = $vmGuest.Hostname
         $row.IPAddr1 = $vmGuest.IPAddress[0]
         $row.IPAddr2 = $vmGuest.IPAddress[1]
         $row.IPAddr3 = $vmGuest.IPAddress[3]
         $row.OsFullName = $vmGuest.osfullname
    
         $row.VMState = $vm.summary.runtime.powerState
         $row.TotalNics = $vm.summary.config.numEthernetCards
         $row.TotalCPU = $vm.summary.config.numcpu
         $row.{TotalMemory Mb}= $vm.summary.config.memorysizemb
    
         $report += $row
    }
    $report | sort -property VMname | Export-Csv $outputfile -NoTypeInformation
    

    As the basis of each report is the loop through all the guests (Get - VM cmdlet) should be quite easy to incorporate the other 2 files CSV in a similar way.

  • does anyone have example script writing and reading XML file

    someone at - it an example script for writing to variables affecting and reading variables to an xml file.

    Discover the second to the last link on this page:

    http://www.Cisco.com/en/us/partner/products/SW/custcosw/ps1846/products_implementation_design_guides_list.html

    There are some very good examples.

    HTH, please rate all positions!

    Chris

  • Create a data streaming from C++ stream and read it in LabView

    Hi all.

    I'm working on a project that is to connect to a tracker of movement and reading data of position and orientation of this in real time. The code to get the data is in c ++, so I decided that the best way to do it would be to create a c++ DLL that contains all the functions necessary to first connect to the device and it reads the data and use the node to call a library function to power the Labview data.

    I have a problem, because, ideally, I would like a continuous flow of data from the code c ++ in Labview, and I don't know how to do this. Put the node function of library call for a while loop seems like an obvious solution, but if I do it this way I'd have to reconnect to the device whenever I get the data, which is quite a bit too slow.

    So my question is, if I created c ++ function that creates a data stream, could I read that in Labview without continually having to call a function? I would rather have only to call a function once, and then read the data stream until a stop command is given.

    I'm using Labview 2010, version 10.0.

    Apologies if the question is badly worded, thank you very much for your help.

    Dave

    dr8086 wrote:

    This method resembles an excellent suggestion, but I have a few questions where I don't think I understood fully.

    I understand the basic principle is to use a call library function node to access a DLL that creates an instance of the device object and passes a pointer too in labview. Then a separate call library function node would pass this pointer to another DLL that could access the device object, update and read the data. This part could be in a while loop, then continue on reading the data until a stop command is given.

    That's all. I'm including some skeleton for example code. I am also including the code because I don't know how you experience multi threading so I show how you can use critical sections to avoid interactions between threads so that they do not lead to questions.

    // exported function to access the devices
    extern "C"  __declspec(dllexport) int __stdcall init(uintptr_t *ptrOut)
    {
        *ptrOut= (uintptr_t)new CDevice();
        return 0;
    }
    
    extern "C"  __declspec(dllexport) int __stdcall get_data(uintptr_t ptr, double vals[], int size)
    {
        return ((CDevice*)ptr)->get_data(vals, size);
    }
    
    extern "C"  __declspec(dllexport) int __stdcall close(uintptr_t ptr, double last_vals[], int size)
    {
        int r= ((CDevice*)ptr)->close();
        ((CDevice*)ptr)->get_data(last_vals, size);
        delete (CDevice*)ptr;
        return r;
    }
    
    // h file
    // Represents a device
    class CDevice
    {
    public:
        virtual ~CDevice();
        int init();
        int get_data(double vals[], int size);
        int close();
    
        // only called by new thread
        int ThreadProc();
    
    private:
        CRITICAL_SECTION    rBufferSafe;    // Needed for thread saftey
        vhtTrackerEmulator *tracker;
        HANDLE              hThread;
        double              buffer[500];
        int                 buffer_used;
        bool                done;       // this HAS to be protected by critical section since 2 threads access it. Use a get/set method with critical sections inside
    }
    
    //cpp file
    
    DWORD WINAPI DeviceProc(LPVOID lpParam)
    {
        ((CDevice*)lpParam)->ThreadProc();      // Call the function to do the work
        return 0;
    }
    
    CDevice::~CDevice()
    {
        DeleteCriticalSection(&rBufferSafe);
    }
    
    int CDevice::init()
    {
        tracker = new vhtTrackerEmulator();
        InitializeCriticalSection(&rBufferSafe);
        buffer_used= 0;
        done= false;
        hThread = CreateThread(NULL, 0, DeviceProc, this, 0, NULL); // this thread will now be saving data to an internal buffer
        return 0;
    }
    
    int CDevice::get_data(double vals[], int size)
    {
        EnterCriticalSection(&rBufferSafe);
        if (vals)   // provides a way to get the current used buffer size
        {
            memcpy(vals, buffer, min(size, buffer_used));
            int len= min(size, buffer_used);
            buffer_used= 0;                 // Whatever wasn't read is erased
        } else  // just return the buffer size
            int len= buffer_used;
        LeaveCriticalSection(&rBufferSafe);
        return len;
    }
    
    int CDevice::close()
    {
        done= true;
        WaitForSingleObject(hThread, INFINITE); // handle timeouts etc.
        delete tracker;
        tracker= NULL;
        return 0;
    }
    
    int CDevice::ThreadProc()
    {
        while (!bdone)
        {
            tracker->update();
            EnterCriticalSection(&rBufferSafe);
            if (buffer_used<500)
                buffer[buffer_used++]= tracker->getRawData(0);
            LeaveCriticalSection(&rBufferSafe);
            Sleep(100);
        }
        return 0;
    }
    

    dr8086 wrote:

    My main concern is that the object can get out of memory or be deallocated since it would not take place to any namespace or whatever it is.

    As you create the object with the new, the object expire not until the dll is unloaded or the process (LabVIEW) closes. If the object will remain valid between condition LabVIEW dll calls not a not unload the dll (who does if the screws are closed). When that happens, I don't know exactly what happens to the active objects (that is, if you forgot to call close), I guess the system recovers the memory, but the device could still be opened.

    What to do to make sure that everything is closed when the dll before I could call unloads close and remove the object is whenever I create a new object in the dll that I add to a list when the dll is unloaded, if the object is still on the list, that I'm deleting it.

    dr8086 wrote:

    I also have a more general question of programming on the purpose of the buffer. The buffer would essentially be a large table of position values, which are stored until they can be read in the rest of the VI?

    Yes, see the code example.

    However, according to the frequency with which you need to collect data from the device you have this buffer at all. That is, if take you a sample on every 100ms, then you can remove all threads and buffer related functions and instead to read data from the read feature itself like this:

    double CDevice::get_data()
    {
        tracker->update();
        return tracker->getRawData(0);
    }
    

    Because you need only a buffer and a separate if thread you collect data at a high frequency and you can not lose any data.

    Matt

  • How to create a file name variable with the County and the date?

    Objective: Create a file name variable with the County and the date

    Error: get a lot of error. Do you know how to change my code?

    Question: how to create a file name variable with the County and the date?

    Mini code:

    std::string * rawfilepath;
    std::string * rawfilename;

    rawfilepath = "./shared/documents/";
    RawFileName = rawfilepath + 'rawlog -' + 0 + '-.txt ';
    QFile file (rawfilename);
    If (file.exists ()) {}
    rawfilenamecount ++;
    RawFileName = "./shared/documents/rawlog-" + rawfilenamecount + "-.txt ';
    }

    Thank you for your attention,

    Thank tzander reminding me the idea. Method of cascades is not good for me because all of the kernel code is written by Native. If I change the channel to QString, I need to change a lot of codes.

    Solution is below.

    While (access (rawfilename, F_OK)! = - 1) {}
    rawfilenamecount ++;
    sprintf (format, RawFileName, rawfilenamecount);
    fprintf (stderr, "file exists");
    }

    Rawlog = fopen (rawfilename, "w"); Save the file in a specific path.
    fprintf (rawlog, "System Time (ms)" "");

  • How to read a variable main.swf (this content.swf of load) and use within the loaded movie?

    Hello

    How to read a variable main.swf (this content.swf of load) and use it within the content.swf?

    I have a variable called TextColor = 'Green' handmade film and I want to read this variable from inside the content movie?

    anyone can help!

    Thank you very much.

    MyGiantBrain thanks for your reply but kglad method worked very well.

    Thanks kglad but there is some changes to your code so that it works, and it is:

    trace (MovieClip (parent.parent) ["TextColor"]);

    Thank you

  • Environment variable folder is different when it is shown in the console and read by programs

    Hi all

    On our Windows Server 2008 machine, the TEMP and TMP environment variables all point to C:\Users\\AppData\Local\Temp as seen in system properties. However, they appear like C:\Users\\AppData\Local\Temp\3 in Windows console command line. I also feel the same behavior in Windows Vista. This causes problems in our program. I don't know whence the '3' subdirectory and why these environment variable appear differently in the console.

    You have an idea about this problem? Thank you very much in advance!

    Lini

    http://www.Microsoft.com/windowsserver2008/en/us/community.aspx

    http://www.Microsoft.com/windowsserver2008/en/us/forums-blogs.aspx

    Server 2008 Forums at the link above.

    See you soon. Mick Murphy - Microsoft partner

  • Delay weird read shared variables

    Hello

    I'm working on a project were I am followed a few lines of production. I use an OPC server on the DSC module to connect to PLCs on the production line and I created variables related to my labview tags of the PLC project.

    On my project, I have a main VI were I show information on production lines and I can access several subVIs were I see more information on these lines. Then I a VI that runs in the background were I read about 50 shared the PLC variables and where I save data in a MySQL database, data entry of data on the database of the Citadel and the recording of alarms.

    The problem I have is that I noticed a delay read variables that read weight of containers from the production line the VI that runs in the background. It seems that all shared variables suffer no delay, only the variables weight start to make some delay when the values are on the rise. It also seems that when I run only one VI, without running the main VI, there is no any kind of delay. I read shared variables shared as variable nodes.

    Can someone help me understand what is happening and how can I fix this delay? The VI that runs in the background is time critical and a strange delay like that messes up my data.

    Hi Mateus23,

    The shared variable has various capabilites buffering, including integration with real-time FIFO functionality in LabVIEW Real-time.

    I guess that buffering settings are causing the unexpected behavior.

    Check out these resources:

    Buffer Network-Published static Variables (white paper)

    Properties shared Variables dialog box

    - Network Page

    - Page FIFO in real-time

  • How to set and read cookies in adobe edge animate

    Hi all

    I need help with writing and reading cookies using the tip of adobe, is there a way to do I serached internet, but I found something simlliar?

    Thanks in advance

    To test with this plugin in a simple HTML page, you also need to include jQuery itself.

    For example:

    ...

    ...

    There are several different ways that you can load the jQuery.cookie plugin in your composition. Regardless of the method, I recommend loading compositionReady relaxation. It is the trigger that triggers once the composition is ready to play.

    This blog shows a way to load in external .js files:

    http://chrisgannon.WordPress.com/2012/09/01/loading-external-JavaScript-in-Adobe-edge-Anim ate-the-easy-medium.

    Here's how you would apply this method for the jQuery.cookie plugin:

    Enter a code similar to this:

    () yepnope
    {
    Nope:]
    ' / path/to/jquery.cookie.js'
    ],

    full: init
    }
    );

    function init() {}

    create initial values of your cookie here

    }

    Who is responsible in the jQuery.cookie plugin.

    It would be for you to create/manipulate data of the cookie as necessary for your needs. Most likely, you would do scroll down to a point in the script where you want the data editable or read, add a trigger, and then insert the necessary code.

  • capture multiple and reading images

    Hi all

    I use a Guppy F031 Pro camera equipped with trigger mode in bulk.  Now I can leave the exposure of the device twice in the series after an external trigger (my previous post).  But I don't know where are the stored images and how to read the two outside pictures and store them in the hard disk.

    When I use IMAQdx get image vi to capture image and set as number mode with 2 buffer pads.

    Does this mean that I assigned two location in RAM for my image?  If so, how can I find their location?

    Best,

    Wen

    "When I use IMAQdx get image vi to capture image and set as number mode with 2 buffer pads.

    Does this mean that I assigned two location in RAM for my image?  If so, how can I find their location? »

    -To my knowledge, it is false.

    Buffer allocation:

    -There are two types of internal buffers and buffer of the user you want to set up and use.

    -internal buffer is that you can configure using IMAQdx configure acquisition and giving the required number of buffers you want to allocate.

    -the user buffer is a condigure you or create using IMAdx create and giving them different middle names, creating several buffers. (You must remove the user buffers when finished processing using IMAQdx has, otherwise it will fill the RAM memory.

    Number of buffer:

    -A number of buffer is a zero-based index that represents the cumulative number transferred image. For example, during an acquisition continues with three internal buffers, the number of buffers is updated as follows: 0, 1, 2, 3, 4, 5 and so on. Buffer 0 and 3 numbers correspond to the same internal buffer in the ring of the buffer. (From NI IMAQdx manual)

    -Which means you will need to give different buffers number each time adding 1 whenever you receive an image. and not a constant of 2.

    For your question:

    -Configure the acquisition with more than two buffers, start the acquisition.

    -Give the number of buffers to 0 and increment after successful image and send it to IMAQdx get image.

    -For each image, your user buffer is even currently, which means that it will overwrite the same. If you want them to be different, you can create several and use also.

  • Can't write series base and Read.vi to run

    Hello

    It is a strange problem because I used this .vi including several times before and never had a problem until I have created LabVIEW on my new laptop computer. I installed everything like I should without a problem, but for some reason when I try to run, I get the message:

    "Error-1073807343 is produced in property node (arg 1) visa set up a Serial Port (Instr) .vi-> basic series write and Read.vi.

    Possible reasons:

    VISA: (Hex 0xBFFF0011) insufficient location information or the device or resource is not present in the system. "

    I tried to find the error in the forums, but never, it corresponds to what I do and I can't find a solution. It is a problem serious because I'm on a timeline by hand in a project. Please notify.

    Thank you

    Yusif

    Stupid question - is the correct port selected for your new laptop? It's maybe something like com5 instead of com1. Do you see the port in Windows Device Manager?

Maybe you are looking for

  • Signing with Apple ID

    I'll put up a new mac and I can not connect because the server error. What can I do?

  • SSD issues

    I have a 250 GB SSD which indicates that it is almost full with only 11.6 GB of free space, but when I point out all that on it and check the properties, there are only about 40 GB of data.  What is happening with this?  I'm sorry, I'm a little novic

  • Web development BB10

    Hi guys: im a java developer for Android and BB and now I'm starting to develop using bb 10 web. How should I start? I created ripple and some simple html codes, but it is difficult to do more. are there third party software and suggestions for me? T

  • For 'Post online', these files can be exported to another server?

    HelloI'm about to create a newsletter for a client (print version), and they want an online version. The feature to publish online looks great and works great, but my client wants to host the files on their server and not only on the Adobe server. Y

  • ALT-click shows the brush settings and does not define the clone box. How can I solve this problem?

    I tried what looks like anything to get this problem resolved, but nothing works. I tried the mouse settings in Photoshop and the mouse settings on my computer. And I ended up resetting all the customization options in Photoshop.