LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CNVVariableEngineIsRunning always returns "not running" on PXI chassis.

At the start of my program, I ensure that the Network Variable Engine is running before I start using it.  This works fine on my laptop (Windows 7, LabWindows 2012) but not when I run the same program on my PXI Chassis (NI-PXIe-1082 with PXIe-8135 RT Controller, LabWindows 2012).  The 'IsRunning' parameter returned from the function CNVVariableEngineIsRunning is always 0.  Should this work in the PXI environment?  Is there a work around?

 

The code below waits the full 60 seconds when run on my PXI platform.  Data returned from CNVVariableEngineIsRunning calls: status = 0, running = 0.

 

    start_time = Timer ();
    do {
        status = CNVVariableEngineIsRunning (&running);
        if ((status != 0) || (running == 0)) {
            delta_time = Timer () - start_time;
            Delay (1.0);
        }
    } while ((running == 0) && (delta_time < 60.0));

 

Thanks.

0 Kudos
Message 1 of 8
(4,574 Views)

Hello Moxcoak.  

 

There should not be a problem with the PXI chassis being able to run the Variable Engine.  What I would recommend doing is checking in services to verify that the Variable Engine's startup type is set to Automatic and that your engine is running before testing the program.  I've linked a help document which talks about how to start the service.  http://zone.ni.com/reference/en-XX/help/372572E-01/sysman/sve_vista/

 

I'd also check to make sure the PSP service is also running as this is used to be able to communicate across the network for the shared variable engine.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(4,554 Views)

Thanks, but my LabWindows program is not running on a Microsoft Windows based system as indicated in the link provided.  I don't believe the PXI system is running Microsoft Windows.  There is no "start menu", no "services" tool that I know of and no monitor/keyboard either.

 

I have an external Microsoft Windows 7 PC where I create my LabWindows program which I then push over the network to the PXI system.  Once the LabWindows program is on the PXI, the Windows 7 PC is normally disconnected.  Note that I temporarily keep the Windows 7 PC connected and browse to the IP address of the PXI system using Windows Internet Explorer.  There is a limited interface to the PXI system using this method.

 

Note: the CNVVariableEngineIsRunning function works as advertised if I run a test program on my Windows 7 PC, but the same program fails on the PXI system.

0 Kudos
Message 3 of 8
(4,547 Views)

Do you know what operating system you are running on your PXI controller?  What I believe is going on is there is no problem with your code.  It's going to be that the Variable Engine is not running on your operating system of your PXI chassis.  What we need to check is to see if that service is running on your PXI chassis, and if not, start it.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(4,527 Views)

The PXI chassis is running NI Real-Time Pharlap 3.1.  I am sure that the Network Variables engine is up and running since after failing the CNVVariableEngineIsRunning check my code falls through and continues.  All the other Network Variables commands work fine and as expected.

0 Kudos
Message 5 of 8
(4,464 Views)

Hello,

 

So, the workaround I might suggest for this particular issue is to write and read from a network variable.  Make sure your handling errors appropriately, and you'll know the engine is working once you read the value you just wrote.

 

With regards to the issue itself, what status code are you receiving back from CNVVariableEngineIsRunning?  Also, you mention the code still works.  Is this because the engine on the chassis is running and it is reading and writing to variables located on the PXI chassis itself, or is the program reading from a variable engine on another system.  It's possible that the system doesn't have the variable engine on it yet the program doesn't require the engine to be on the PXI chassis to be able to run.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(4,446 Views)
Spoiler
 

The CNVVariableEngineIsRunning returns a status code = 0 (success).  My code loops on this command once per second up to 5 seconds waiting for the IsRunning parameter to be non-zero.  So, this ends up being a 5 second delay when run on the PXI chassis.  The delay probably ends up being enough to ensure that the Network Variable Engine starts properly on the PXI chassis.

 

Our system uses the Network Variable Engine that runs on the PXI chassis.  The PXI controller is the only processor in our system, so the Network Variable Engine has to be running on it.  In addition, we use the path "localhost".  [Note: We deploy our program from our Windows 7 laptop over ethernet to the PXI, and then disconnect the laptop.]

 

I have a similar work around: create a Network Variable process and wait for it to exist before continuing (CNVNewProcess, CNVStartProcess, loop on CNVProcessIsRunning).

 

History: the reason I tried the CNVVariableEngineIsRunning command is because we intermittently receive an error with the CNVCreateBufferedWriter command (status = -6337, “The network variable process was not found or is not responding.”) when our program starts up.  We get this error only on the first Network Process and first Network Variable we create.  It fails about 20-25% of the time we start our program.  Our thinking was to ensure that the Network Variable Engine is up and running before creating all our Network Variables.

0 Kudos
Message 7 of 8
(4,433 Views)

Hello Moxcoak,

 

I just wanted to let you know that we opened a bug report for this on our end.  The Corrective Action Report number is 457430.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(4,351 Views)