­

Multiple Simultaneous Targets Example

This example project explains about simultaneous working of two targets in one host.

    Description

    This example shows how multiple virtual devices can be hosted simultaneously, allowing system-level application development of multiple embedded systems at the same time. With Virtuoso, two embedded applications running on different hardware that communicate with each-other can be debugged in the same Visual Studio Solution! Step through the code and watch one device transmit a packet of data, then watch it come in on the other side. Developing multiple interacting embedded systems has never been easier.

    Here we have one target which perform led blinking at every half second and other target which perform led blinking at every one second.

    Click here to download complete Project File                                                                            Click here to download getting started Project File

    char SIM_LEDTarget1State = 0;                       // Variable to store the value of LED state for target 1
    void SetLEDTarget1State(char _LEDState) // Function to set the LED state for target 1
    {
        SIM_LEDTarget1State = _LEDState;
    }

    void TimerTarget1ISR() // Hardware Timer ISR for target 1
    {
        SIM_LEDTarget1State = ~SIM_LEDTarget1State; // This will be call at every 0.5 Sec    
         // Toggle the LED state at every 0.5 Sec
    }


    char SIM_LEDTarget2State = 0; // Variable to store the value of LED state for Target 2
    void SetLEDTarget2State(char _LEDState) // Function to Set the LED State for Target 2
    {
        SIM_LEDTarget2State = _LEDState;
    }

    void TimerTarget2ISR() // Hardware Timer ISR for Target 2
    {
        SIM_LEDTarget2State = ~SIM_LEDTarget2State; // This will be call at every 1 Sec    
         // Toggle the LED state at every 1 Sec
    }
    void InitVirtuoso()
    {
    #ifdef _WINDOWS
        InitializeVirtuoso();
    #endif    //_WINDOWS
    }

    void main()
    {
        InitVirtuoso();

        SetLEDTarget2State(1); // Set Led State to 1 to turn ON the LED
        while (1)
        {

        }
    }