Globals API c# teststand

Hello world

I'm trying to insert a Globals in sequence variables Panel. But I don't understand, because I can get FileGlobals and set.

Here is my code:

EngineClass myEngine = new EngineClass();
SequenceFile = myEngine.GetSequenceFileEx ("C:\\seqSPE.seq", 0, TypeConflictHandlerTypes.ConflictHandler_Prompt) mySequenceFile;
           
Sequence mySequence = mySequenceFile.GetSequenceByName ("MainSequence");
           
                    
PropertyObjectFile fileObj = mySequenceFile.AsPropertyObjectFile ();
PropertyObject thing = fileObj.AsPropertyObject (). GetPropertyObject ("FileGlobals", 1);
                    
Machin. SetValString ("CB_Project_Name", 1, "blabli");
MessageBox.Show (thing. GetValString ("CB_Project_Name", 1));

fileObj.SaveFileIfModified ();
mySequenceFile.Save("C:\\mysequence.seq");
myEngine.ReleaseSequenceFileEx (mySequenceFile, 0)

I'm sorry for my English, french

Thanks for your help.

See the following changes:

EngineClass myEngine = new EngineClass();
SequenceFile = myEngine.GetSequenceFileEx ("C:\\seqSPE.seq", 0, TypeConflictHandlerTypes.ConflictHandler_Prompt) mySequenceFile;
           
            Sequence mySequence = mySequenceFile.GetSequenceByName ("MainSequence");
           
                    
PropertyObjectFile fileObj = mySequenceFile.AsPropertyObjectFile ();
             PropertyObject thing = fileObj.AsPropertyObject (). GetPropertyObject ("file

Globals', 1);

PropertObject thing = mySequenceFile.FileGlobalDefaults;
                    
Machin. SetValString ("CB_Project_Name", 1, "blabli");
MessageBox.Show (thing. GetValString ("CB_Project_Name", 1));

fileObj.IncChangeCount ();

fileObj.SaveFileIfModified ();<-- are="" you="" sure="" you="" want="" to="" save="" the="" changes="" to="" the="" original="" file="" like="">
mySequenceFile.Save("C:\\mysequence.seq");
myEngine.ReleaseSequenceFileEx (mySequenceFile, 0)

Tags: NI Software

Similar Questions

  • Create variable FileGlobals without deleting the existing, using the API of TestStand, LabVIEW

    Dear community OR,.

    I create the FileGlobals Variables as described in the attachments. Variables are created, but at the same time, all the existing ones if the FileGlobals file is deleted. Could someone help, please, how can I insert variables, no effect on already existing ones?

    Thank you very much in advance!

    I struggled with this problem all morning, and... I realized that this code does not remove the FileGlobals variables. Code to create the fact, that runs before this code... So I corrected the code - it works now!

    Thanks for all the help, I found interesting things of couple - I did not know this increment of the changes made to the file.

  • Object LVOOP read/write using the API TestStand

    Is it possible to read/write a LVOOP object to a variable TestStand from LabVIEW using the API of TestStand?

    SetPropertyObject() takes a green wire reference, which is incompatible with an LVOOP object.  SetValVariant(), SetValIDispatch(), and SetValInterface() seems to just write a value null of type variant.  I don't know if I use the wrong API function or if it's just not possible.

    Hi jsiegel,

    That's right, it is not quite possible to what I believe, it is your intention. As mentioned, TestStand cannot create the object of LabVIEW. To make and use references of LabVIEW with TestStand, you need LabVIEW out this reference, which may then store it TestStand as an object reference. For VI requiring the obeject LabVIEW as an input, the registered object reference can be passed in. To make calls to LabVIEW classes using the class member call with a step of the VI Action instead of the call to VI for the Type.

    Of course, you need both LabVIEW and TestStand 2012 or newer in order to use these functions.

    Kind regards

  • Call a DLL in TestStand by reference

    All,

    I developed a DLL that control a USB based power. The call of the dll works from TestStand 4.1 most of the time. What I think is happening, is that whenever I call the dll in my main sequence of the file as well as other files in sequence, as several instances of the dll is loaded.

    Part of the init of food must pass back a SESSION number that is used in subsequent calls to the dll. I store as a global variable in TestStand and pass around sequence that never he needs.

    How can I load the DLL at the beginning of the sequence and PASS a reference (handle) to all other calls to the dll?

    Thanks in advance

    Carmine

    Doug,

    Thanks for your help. I found a UnLoadModules() in one of the child seq that I missed. Unless I missed all the others, I think this should be resolved.

    Carmine

  • API ActiveX vs engine API

    Hello

    I want to develop an Interface with c# operator, but I don't know if I have to use the TestStand or motor TestStand API ActiveX API. In my opinion, the API ActiveX TestStand is more a sampler than the API of the engine, but the engine API is more flexible and more powerful.

    In fact, us know not what's the different between the ActiveX API and the API of the engine, could you please tell me in this case I use the ActiveX API and in which case I should use the API of the engine?

    What is the advantage and disadvantage of the ActiveX API and API engine separately?

    Thanks in advance!

    Concerning

    Simon

    The user interface controls are ActiveX controls, designed to help you create a richer user interface, more quickly and easily. These controls are called in the engine API to interact with TestStand. The engine APIs are low-level APIs. The API UI APIs for user interface controls themselves and are usually higher level API. Step usually recommended to use the API of the engine type code non-interface user, such as code modules and code modules. The UI code must use the user interface for most controls.

    Hope this helps to clear things up,

    -Doug

  • highlight comprehensive CVI file

    Is there a motor TS API that can be used to set the value of the fileglobal of CVI?

    I use the synchronous Message user interface to get the sequenceContext of the 3 buttons. I'm creating context unique to each fileglobals sequence if it is adopted of TestStand, CVI. If the values of this variable is passed to TestStand I updated the GUI buttons.

    The second part is if the user presses one of the buttons of the GUI then the appropriate fileGlobal must be defined. Therfore CVI should set the value of the fileglobal based on the user's selection.

    I am not sure if there is an API (such as that provided for StationGlobals, pls see code below) help I can then set the value of the fileglobals in the button callback function?

    It was during the use of globals station in teststand *.

    to access the TS StationGlobals
    tsErrChk (TS_EngineGetGlobals (gMainWindow.engine, & errorInfo & TS_Globals));
    Set value
    tsErrChk (TS_PropertySetValBoolean (TS_Globals, & errorInfo, "MonitorSet", 0, VTRUE));

    TIA

    Thanks Peter.

    I found the way to do this using UIMessage. The example used as starting point is herein case someone else needs it.

  • Flatten to a string to send arbitrary objects by messages from the user interface?

    Hi people,

    I am trying to send arbitrary data by messages from the user interface defined by the user to my labview interface. Something funny happens then: if I send the data through the message of ui, it seems I have something strange. There is only one character or nothing in the message of the user interface that reached my reminder.

    It seems that flatten channel also creates control characters that are interpreted by NI TestStand and Labview not as members of the chain, and for this reason I only get incomplete data. within the action of testand, which creates the flattened data, I put a dialog box to display the string data, and it seems that at least up to 255 (ascii) characters are used.

    Is there something like uuencode/uudecode to avoid this problem?

    Thanks in advance

    Okidoki, found.

    His «binary"produced by «Flatten the string» string Apparently I thought, the LabVIEW data type is incompatible with the API of TestStand from LabVIEW. In conclusion I would classify this as a bug (sorry people, at least there should be documentation) API for LabVIEW TestStand 2014.

    As a solution, I use flatten it in XML, which is a printable and human readable 'normal' string.

    It was trial and error, and I'm not enjoying this.

  • A program running in the background of my sequence

    In a first time to run a program in the background of my Teststand sequence, I'm trying to accomplish the very well detailed procedure that follows to run asynchronously a VI (my future intention is to call my a VI program which is running in parallel during the Teststand sequence).

    https://decibel.NI.com/content/docs/doc-21743

    I think that I followed every step, however my implementation was a significant failure: 'Asynchronous VI' does not close even if the concerned Boolean parameter is set to "true" and should be read by this VI...

    I guess I'm missing something obvious... But the fact is that really miss me! Can someone show me my mistake please?

    Thank you in advance!

    Attached you will find my sequence and VI.

    Hello

    (1) for your use case, you update the globals (stationglobals.ini) TestStand and VI reading station which should be fine.

    When the two try to update/write to-it will be a problem.

    (2) - I noticed that it is still impossible to read the outputs of the vi running in asynchronous mode in the main sequence: even when I write the result in a variable StationGlobals, it does'nt change throughout the sequence

    The globals station is a physical file (stationglobals.ini) which must be committed (saved) after updating the variable file in VI.

    TestStand also has to reload the stationglobals.

    Check this box:

    https://forums.NI.com/T5/NI-TestStand/writing-to-TestStand-station-Globals-from-LabVIEW/TD-p/3064530

    I hope this helps.

    Ravi

  • Proprietesde Set to call ActiveX

    Hello

    I'm trying to programmatically set the limits Proprietesde of steps in my sequence of in an operation on the API ActiveX TestStand VI.

    I realize that I am reproducing the functionality included in the property Loader procedure, this is intentional. Suffice it to say that the property loader does not quite for what I read in.

    I can define or create inhabitants (reproducing the TestStand in ThisContext.RunState.Sequence.Locals.SetValString ("foo") "") "

    with the following code:

    But, what I'm trying to reproduce is a StepProperty: "RunState.Sequence.Main ['StepName" "]." Result.Measurement ["Measurement 0"]. Limits

    Can I make this ground of appeal ActiveX, as above? I can't seem to find the right path properties and methods to access, as sequence > hand does not contain then the results or SelectStep method. I'm not sure the right point to insert the ["StepName"] as noted above, as well.

    Thank you

    Mello

    After installing TestStand, you should have 'TestStand"palette of VIs in LabVIEW include get the property value, set the value of property and some other very practical packaging API. I advise to use those - use something like "Locals.VariableName" as a search string.

    Work with a type of custom step? This search string does not work on any type of step OR I know. In all cases, you can use the property value defined by a string of search and TestStand does all the heavy lifting for you, for example the limit Test RunState.Sequence.Main ["Numeric"]. Limits.Low or RunState.Sequence.Main ["Numeric limit Test"]. Limits.High in a normal numerical limit test.

  • AddExtraResult requirements

    Hey,.

    I like the method RunState.Execution.AddExtraResult (http://zone.ni.com/reference/en-XX/help/370052H-01/tsapiref/reftopics/execution_addextraresult_m/) allows to add step requirements in the list of results. I call this with a propertyName = "Step.Requirements" and a resultPropertyName = "Requirements", but I do not see the information added to the ResultList.

    I use this to add Step.Limits and Step.Comp successfully. It seems that I use the incorrect property name for the requirements, but I can't find a list of the names of properties anywhere.

    Thank you

    Kevin

    Hey Kevin,

    Requirements are actually stored in a table in Step.TS.Requirements.Links.  Try to use this statement instead of just Step.Requirements in your service and please let me know if it works.  For future use, if you open the browser of the Expression, you can view more of the available execution variables, but also the functions of the API for TestStand.  I hope this helps, Kevin!  Have a great day!

  • Type of custom log MultiNumericLimit step

    Hi, I have developed a library using certain types of custom step. I created the type of step from the numerical limit Test Multiple standarda. In run mode the step sequence context GET and using the API of Teststand crash parameters such as:

    Step.Result.Measurement []. Data
    Step.Result.Measurement []. Limits.High
    Step.Result.Measurement []. Limits.Low

    .....

    What I can not change at run time is the name of the measure, because it depends on the line that I selected in the step type. I would change the Step.Result.Measurement [XXX]. State with Step.Result.Measurement [YYY]. Status at run time.

    I havo also another question, but it's a little more complicated to explain. The step type also has an editor that the user may open in the teststand sequence editor. In this editor, the user can select what action to take. When the user finishes the configuration press 'save' on the step step type editor should fill the pameters of the MultiNumeric limit test. Exactly the same thing when the user sets up the test from the tab in the teststand sequence editor (attached). But I can't do it.

    Thank you very much.

    Hi Logatto

    You wrote:... In this case I'm not the SequenceContext because TestStand is not running.

    You will have a SequnceContext. This is the current context of your sequence, you are editing.

    So just enter "ThisContext" Edit-in-step of your step-Type in vi.

    Now you should be able to access the Step property and make your orders.

    Please visit and note this idea for perfomance TS-User: http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/Ability-to-create-user-built-in-StepTypes/idi-p/1...

    Concerning

    Jürgen

  • the vi isn't in a State compatible with the run method of vi

    I try to run a 'writing DAQ' vi in a school. He complained of his not able to run it with the above message. I use the API of teststand to get secondary vi.


  • VI crashes has been closed

    I built a VI using LabVIEW version 8.5 call API of TestStand version 4.0.

    An hour ago, I've migrated to 8.6 LabVIEW and TestStand 4.1 simultaneously.

    When I close the VI, debugger window just-in-time visual studio appears just above the LabVIEW debugging window (the one that explains the errors and warning) and LabVIEW seems to freeze. If I decide not to start the debugger, visual studio, the accidents of LabVIEW

    The problem seems related with TestStand because the other VI built with version 8.5, but do not call API TestStand don't crash.

    What the hell?

    Thank you

    Thank you man.

    I tried to change several things in the two programs settings but nothing.

    Then I found this old article:

    http://digital.NI.com/public.nsf/WebSearch/C340060ECAFAA169862573C900723541?OpenDocument&submitted&&...

    So I tried to close each references open and I managed to solve the problem. Of course, in the early stages of development I has not received warning messages because TestStand 4.0 has this option is disabled by default.

  • Logging of user interface actions

    I have a requirement that stock operator in the user interface to connect to a file or a database.  Far from creating a UI from scratch, how would you add this feature to any user interfaces provided by OR with TestStand?

    Is it possible to intercept and record the traffic engine API of TestStand?  The engine retains a kind of diary?

    I need to capture events such as these:

    User A connects to 14:35

    The user has open the User Manager and add a new user, user B.

    User A logs off at 14:15

    B the user connects to 15:20

    User B opens MySequence.seq

    User B configuration entry point calls configure Report Options

    Etc...

    Any help is appreciated.

    Chuck Cox

    General Dynamics SATCOM Technologies

    Longview, Texas

    Hello

    You can watch the TestStandUIControlsReferencePoster.pdf document to see the objects and events that you can handle in the operator interface.

    And look for the user using TestStand interface Messages.

    The default ProcessModels use some Messages in the user interface to send information to the UI (--> 'Test DUT' point of entry).

    You can post your own messages (called UserMessages) of the ProcessModel.

    Test method of PostUIMessage of thread objects or motor (TestStand API).

    Operator interface can intercept these UIMessages, if you manage the UserMessage or the UIMessageEvent of the ApplicationMgr object.

    I give you a starting point.

    Hope that helps you.

    Bruno

  • Load a VI (including the API, TestStand) in TestStand

    There,

    I want to load a VI in without LabVIEW TestStand.

    Version of LabVIEW 8.5

    TestStand Version 4.0

    The PC with TestStand just to LabVIEW 8.5 run-time engine, and the VI is used to import data into globals station; Also, this VI called TestStand API and motor TestStand.

    On a PC with LabVIEW and TestStand, everything is OK.

    But, on a PC with Runtime only, even if I configure adapters in time TestStand and select run in LabVIEW 8.5, an error message (unable to load VI...)

    I tested with a simple VI (dialog box), everything is ok;

    But with screws unpacking called API, TestSTand, an error

    You have an idea?

    Thank you for your answers

    Yes, I understand that you use TestStand development system and the screws are in a law degree there. What I ASKED, it was where you placed the TestStand screws on the pc only run time. Looks like you do not place them anywhere. If you do not, how do you think that the top-level VI will work? Don't you think that these screws are included in the runtime engine don't you? They are not. Only the ex of LabVIEW is the execution engine.

    You should really consider using the deployment tool.

Maybe you are looking for

  • How can I configure the printer preferences and not just margins, etc.

    The default setting for my printer is A5 (8.5X5.5' and every time when you print a page (document) of Firefox, I have to set the printer to letter-size preferences and which tray to print.) Is there a way for me have Firefox do for me? Thanks, uncle

  • History, downloads, and the previous tabs dashed after re-booting

    I looked at all the posts on this but none of the works proposed solutions. As long as I do not restart my computer, history and tabs are preserved. As soon as I reboot, everything (downloads, tabs, history) gets wiped out. This just started a few da

  • Re-installation of Windows 7

    Hello I bought the HP G61-415ES of Spain, which has windows 7 Home Edition installed PE, now my system broke down and I have no recovery disk, I hust have series of windows key 7. It's the place where to download my copy of license of windows 7 and a

  • Bent Z3

    OK so posted this yesterday but it has been removed, do not know why... My Z3 for about 8 months now, my partner has a lot of moving and we used the k 4 record but after about 4 months began to notice a little yellow on the screen, but barely percept

  • Can not put computers wired and wireless on the same homegroup

    I have a newbie question. I can't figure out how to put a computer cable and a computer in the same wireless Group of residential. Here is my configuration: I installed Windows 7 Pro on two computers, one connected to the LAN from my router (Linksys