NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

can't write to station globals in deployed system

When I run Teststand distribution on the target system, I can’t write to the station globals from my custom application that uses the Teststand engine.  The following are the facts:

 

  1. When I run my custom application, my sequence can’t write to any of the station globals.  The function TS_PropertySetValString returns : -2147024890.
  2. I made sure that my distribution included the sequence editor.  When I run my sequence in the editor, I don’t get any errors AND the fields in the station globals are actually updated with the correct values.
  3. I have updated all of the users using the “User Viewer” in the sequence editor to make sure that the “Edit Station Globals” and “Grant All” are true.  I have added code to my custom application to query the engine for these flags and display them in a popup, the flags are TRUE.
  4. I also made sure that the “Check User Privileges” under the “User Manager” in the sequence editor is OFF.  It made no difference

 

I am at a total loss.  Any ideas?

 

Todd

0 Kudos
Message 1 of 6
(3,513 Views)

Hi,

When you are running as a user (operator), does your windows environment restrict access? Maybe the ini file is readonly.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 6
(3,508 Views)
Already checked, the file does have read/write attributes.  Is writeable.  Also, as mentioned, it gets written to when running with the sequence editor.  I also have admin rights on the target system.
0 Kudos
Message 3 of 6
(3,499 Views)

Hi,

Could you post a small example sequencefile that shows the problem.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 6
(3,497 Views)

 

Inside my custom application EXE that launches the teststand engine, the following call works:

tsErrChkMsgPopup(TS_PropertySetValString (m_oGlobals, &errorInfo, "TestConsoleInfo.Operator", 0, sText));

The above call uses a globals object

Inside the DLL, that is invoked by the sequence file being executed by my custom application, the following function fails with totally bogus info in the tsiErrorinfo structure.  And yes, the sequence handle is valid because this same sequence handle is used to read from the station globals, we just can't write to the station globals.

iStatus = TS_PropertySetValBoolean(g_iTSseqHandle, &tsiErrorinfo,
         "StationGlobals.ErrorInfo.CurrentError.Occured",
         0, 1);

The above call uses a sequence object

Todd

 

0 Kudos
Message 5 of 6
(3,495 Views)
Hi Todd,

The error code you're getting is an "Invalid Handle" error.
In your code snippet, you mention that the g_iTSseqHandle is valid because you can read the Station Global values.
Where are you getting the SeqHandle ? For that particular function (TS_PropertySetValBoolean) you should be passing the Sequence Context, not a Sequence Object.
Also, how are you getting the m_oGlobals variable? Is that meant to be a reference to the Station Globals I assume?

Let us know Todd, thanks.
Dan Weiland
0 Kudos
Message 6 of 6
(3,486 Views)