Quantcast
Channel: All NI TestStand posts
Viewing all 24388 articles
Browse latest View live

Access elements of an array passed as Object Reference

$
0
0

Hi to all!

I'm quite new to TestStand and so my question could be quite simple but I was not able to find solution looking at previous messages.

 

I have a sequence which passes one array (of custom data type) to another one to do basic stuff on the array (reverse the order of the elements for example).

I want to pass to the called sequence an Object Reference of the array

 

The problem is that I'm not able to read the element of array inside the called sequence using the object reference.

I found the way get the number of elements but I not able to access the element :smileysad:

 

Moreover the GUI of TestStand is able to let me see the array pointed by the object reference which is passed inside the called sequence, therefore it is possible to access... but how ???

 

I want to do the operations on passed Object Reference inside a TestStand "Statement step" if it is possible.

 

Thank you so much.

Andrea

 

In other words:

How to access the field "temperatureTag" of the element number "0" starting from referenceToClone Object Reference variable ? 

 

Locals.referenceToClone[0].temperatureTag does not work...

 

 

testStandQuestion.jpg 

 

 

 

 

 


SSH and 64 bit Teststand

$
0
0

Hi,

 

We have been using ExtraPuTTY (http://www.extraputty.com/) with Teststand 2013 to communicate with remote linux computers via SSH. ExtraPutty provides a 32 bit dll and custom step types which allow direct interfacing with Teststand sequences and Extraputty. But because the ExtraPutty dll is only provided in 32 bit flavor, it's impossible to use it with 64 bit Teststand. 

 

We have been waiting for 64 bit Teststand for a quite a while and we are happy to finally be able to get our hands on it. But now we are facing the SSH/Extraputty 32 bit issue. 

 

Has anybody attempted to send SSH commands with 64 bit Teststand? If so, how did you do it? Is there any alternative to Extraputty?

 

Thank you!

Re: Reset global/static global variables in DLL loaded by TestStand

$
0
0

It might be best to avoid the use of global variables altogether. If you have some per-execution state, you can pass those variables in as a parameter to your functions (you could even use struct passing to pass in multiple values). The initial value for the parameter could be based on a local variable in your top-level sequence.

 

The main reason why I'd recommend you not use global variables is that it makes it harder to make the sequences threadsafe. If you want to be able to run multiple instances of your execution at the same time, it will be harder to do so correctly if you are storing the state in global variable. If you don't care about this, then you could keep the global variables and expose initialization functions to clear them at various points in which you want them cleared. I think forcing the modules to unload is going to be more error prone (because you have to remember to always change the setting) and might have other unintended consequences. I think making an explicitly call into your dlls to initialize the state would be more straightforward and easier to maintain since it wouldn't require any special kind of load options.

Re: Access elements of an array passed as Object Reference

Re: Reset global/static global variables in DLL loaded by TestStand

$
0
0

Thanks for the reply.  After some testing of unloading ( which doesn't seem to happen ) I concur that not messing with that would be the better route.  The problems I run into are: 1. I now have to add a step to each sequence and my goal was to reduce the number of initialization steps and 2. I don't know of a good way to determine if the initialization should occur without having a parameter be passed around in TS.  For instance, since I need to be able to run a subsequence 5 levels down independently ( for troubleshooting ) and having others skip the steps getting to that point is problematic I'd just tell the person to run sequence X.  That means it has to have the setup and clean up steps the same as the actual top level sequence.  Thus, when running sequence X the call to the reinit function would have to know that it hasn't been reinit and do so.  The problem is that I can't use a static global to track that ( the whole chicken and egg thing we're trying to solve ) so I'd have to have that data come from TS and since it needs passed among sequences it'd need to be a parameter.  While 1 is better than many my goal was to remove parameters that are solely used to hold data between function/step calls.  I want to separate parameter/local usage to data operated on in TS ( can be passed down if necessary but the data originated in TS and is manipulated in TS ) and have code variables/information that has no need to go into TS from going to TS.  Currently, I pass each piece of equipment's init count and handle(s) to TS and pull them back down in every test step.  I also have to pass them among all sequences.  This is error prone ( the order of the parameters, forgetting to check pass by reference, etc. ) and a pain when using the batch model as all the parameters are copied to file globals, updated, copied back, etc.  Maybe I'm trying to have my cake and each it too.  I really hoping someone else had needed to the state of their code to be in a known state and typically runs multiple test executions in a row ( without closing the sequence or TS ).  Is there any way to load test code without being in a DLL and not using LabView?  ( everything is straight C with the potential of C++ compiled in CVI or Visual Studio )  If the code doesn't persist between executions this all goes away.  Thanks.

Can I keep a LabVIEW dialog floating in front while displaying a Message Popup?

$
0
0

Quick Summary:

My customer has a status bar implemented in LabVIEW that they are displaying by executing a TestStand sequence in a new thread. During their main execution, they then need to display prompts to the operator using Message Popup steps. We cannot figure out how to keep both the LabVIEW dialog and message popup steps in front of the Operator Interface.

 

The behavior I want is to display the LabVIEW dialog from a new thread, and for that dialog to always be on top of all windows. Then to display a message popup from the original thread and allow the user to dismiss that dialog, all while still keeping the LabVIEW dialog visible. And of course, this has to be done using the LabVIEW Run-Time Engine because it is a production station.

 

Details:

Here’s why I need that behavior:

  • My customer is locking down the OS on their production station. The operator cannot use ALT-TAB to change windows. Therefore both windows must be accessible by clicking.

  • My customer has a program that starts on OS startup and takes up the whole screen, thereby denying access to the desktop. They also have the Operator Interface set to full screen. Any window that ‘goes to the back’ goes behind the OI and is unrecoverable by clicking.

  • The operator prompt requires the operator to click the ‘OK button‘ to close. Thus it must be able to have focus.

I have tried all combinations of the following, none of which give the behavior I want. The resulting behavior I describe is after the LabVIEW dialog and the Message popup have both been displayed.

  • LabVIEW dialog settings
    • Top-Level Application Window
    • Float (Do Not hide when LabVIEW inactive)
    • Modal
    • Float and set FP.IsFrontmost
    • Modal and use TestStand API Start/End Modal Dialog VIs
    • Float and use TestStand API Start/End Modal Dialog VIs
  • Message Popup Settings
    • Normal
    • Float
    • Modal

 

I’m attaching the sequence file, LabVIEW, and CVI code that I was testing with. You can test the panel's behavior by clicking running from the Sequence Editor, and then clicking on the sequence editor once both windows are open. If the LabVIEW dialog is set to floating or normal, clicking on the Sequence Editor puts the dialog behind the sequence editor. If the dialog is set to modal, if focus is given to the dialog while the message popup is active, the message popup cannot be dismissed until after the dialog is closed (the OK button is unresponsive).

 

As a reference, I found that I can get the behavior I want if I code the dialog in CVI, set the panel to ‘Float Always’ and use ‘Float’ for the Message popup.

 

Does anyone have anything else I can try? Is there another LabVIEW setting I’m missing?

Re: Can I keep a LabVIEW dialog floating in front while displaying a Message Popup?

$
0
0
How committed is your customer to the LabVIEW status bar? I avoided the whole multiple window nonsense by writing to the status bar on the oi with a uimessage.

Re: TestStand performances running sequence using HMI and calling Engine

$
0
0

Hello,

 

Of course the main thread is processing UIMessages messages :

I do it in two ways, the first using the UIMessageEvent and the second polling the UIMessageQueue.

 

        // Constructor        
        public TestStandController()
        {
            _engine = new Engine();
            _engine.LoadTypePaletteFilesEx();
            _engine.UIMessageEvent += new _TEEngineEvents_UIMessageEventEventHandler(_engine_UIMessageEvent);
            InitUIMessagePolling();
        }

        void _engine_UIMessageEvent(UIMessage msg)
        {
            if (msg.Execution != null)
            {
                Trace.WriteLine("Execution id: " + msg.Execution.Id + " - " + msg.Event);
            }
            switch (msg.Event)
            {
                case UIMessageCodes.UIMsg_Trace:
                    Step curStep = CurrentStep(msg);
                    if (curStep != null)
                    {
                        Debug.WriteLine("trace : " + curStep.Name);
                    }
                    break;
                case UIMessageCodes.UIMsg_UserMessageBase:
                    // Reception d'un message utilisateur
                    UserMessageBase(msg);
                    break;
                case UIMessageCodes.UIMsg_EndExecution:
                    // Fin d'exécution d'une séquence
                    EndExecution(msg);
                    break;
                case UIMessageCodes.UIMsg_ShutDownComplete:
                    // Lorsque le moteur d'exécution est arrêté ... on ferme l'application
                    // Todo : A voir quoi faire en fin de shutdown du moteur testStand
                    break;
            }
        }

        private void InitUIMessagePolling()
        {
            _engine.UIMessagePollingEnabled = true;
            _checkStateTimer = new DispatcherTimer();
            _checkStateTimer.Tick += new EventHandler(_checkStateTimer_Tick);
            _checkStateTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            _checkStateTimer.Start();
        }

        private void _checkStateTimer_Tick(object sender, EventArgs e)
        {
            while (!_engine.IsUIMessageQueueEmpty)
            {
                UIMessage msg = _engine.GetUIMessage();
                // messages from a execution
                if (msg.Execution != null)
                {
                    FireTsExecutionMessage(msg.Execution.Id, msg.Event);
                }
                msg.Acknowledge();
            }
        }

 

 I don't know if it's the right way to do it.

 

Best regards,

CFOE


Re: Reset global/static global variables in DLL loaded by TestStand

$
0
0

1) One idea for checking if you need to do the initialization (assuming you are still using global variables to store your state in this case) is to check to see if you have a non-process model caller (the assumption being, if you do have such a caller, then the global state has already been initialized). Something like the following should work:

 

Locals.DoInitializationAndCleanup = (!PropertyExists("RunState.Caller") || RunState.Caller.SequenceFile.SequenceFileType == SeqFileType_Model)

 

2) For the case of using a context variable and passing it around as a parameter, you don't necessarily need to pass the data into teststand in order for teststand to hold the variables for your code modules. Instead you can create an initialize function that returns a pointer to your data structure and a cleanup function which frees it. When calling your initialize function, use the "pointer/handle" type in the TestStand adapter and store the pointer in an Object Reference variable. Pass that pointer into your cleanup function to free it. Also pass the pointer into your other functions to access the state variables (the parameter can just be a pointer to the C/C++ data type of your struct/class). Storing state in a context variable (not the same as the sequence context) like this is a common software pattern. It allows you to have multiple separate sets of state variables active at the same time (allowing for multiple separate executions) and it's easy to add new variables to the context if you are using a struct or class as your context object because you can just add new member variables or fields to it. If you do things this way you can tell if you need to initialize your variable by using a precondition like:

Parameters.MyContext == Nothing

Then you can set a local varible in the post expression like:

Locals.DidInitialization = true

Then use the following for the precondition for your cleanup:

Locals.DidInitialization

 

Hope this helps,

-Doug

Re: Report in xml

$
0
0

Daniel,

 

Thanks for your reply.

 

Could you please indicate examples how to do this from both starting points?

 

Sorry for this basic request but I've never touch this matter, and google returns a lot of convert engines but only between different types of data, not xml to xml directly.

 

And how to write plugin for TestStand?

Re: logging float values in a MySQL : wrong fromatting

$
0
0

Hi zyl7,

 

The issue is most likely related to the way floating point values are stored in MySQL. To quote MySQL documentation, "Floating-point numbers sometimes cause confusion because they are approximate and not stored as exact values. A floating-point value as written in an SQL statement may not be the same as the value represented internally".

 

There are more details regarding this in the following link:

http://dev.mysql.com/doc/refman/5.1/en/problems-with-float.html.

 

I have tried to reproduce your scenario using TS 2012 sp1 and MySQL 5.2.5.0 ANSI ODBC Driver but I was unsuccessful even after trying a range of similar values. So the issue you faced is most likely dependent on the machine in use and might not be reproducible in a different set-up.

 

If the reason you raised this concern is because any comparisions on the floating point values stored in the database might be incorrect (because of the differences in the value passed from TestStand and the actual value stored), please follow the guidelines specified in the link above (especially the comments in the end of the page) to ensure your comparision operations always use a tolerence when calculating the results.

TestStand does float comparisions using a tolerence, so the pass/fail status generated by TestStand should be accurate.

 

Let me know if you have any concerns.

 

Re: logging float values in a MySQL : wrong fromatting

$
0
0

Hi TRJ,

 

Indeed this behavior is related to MySQL. I've traced my data from generation to DB saving : within TS the data is consistent. Once it's transfered into MySQL it is rounded.

MySQL DB is holding test limits but also test results (2 different databases on the server). Both are verified but quality service and this behavior might be problematic at some point.

This problem is seen on 4 of our computers (2 different computer architecture) in France, China, and Poland.

 

Thanks for your help.

 

Cyril

Re: Reset global/static global variables in DLL loaded by TestStand

$
0
0

Doug, these are great suggestions.

 

For (1) when I run it I get an Unknown variable or property name error for 'SequenceFile'.  RunState.Caller is present but SequenceFile isn't.  It seems there's a case where the first portion of the condition results in a false thus the second part is evaluated but the entire variable chain isn't present.  BTW, I'm using TestStand 2013.

 

For (2) I found the Object Reference variable but don't know what you mean by pointer/handle type in the TS adapter.  I assume you're referring to the adapter list ( LabView, LabWindows/CVI, C/C++ DLL, .NET, ActiveX/COM, HTBasic, and None is what I have ).  I'd normally use the LabWindows/CVI or C/C++ DLL adapter.  Oh, wait did you mean the pointer/handle type as a parameter ( think argument ) to an action or test step?

 

Currently, I don't have any completed projects that are multithreaded but we're looking at one now.  Since the test equipment would need to be shared the thought is to continue running the SequentialModel and AFTER setup have subsequences "Use New Thread" and then have a Wait step at the bottom of Main to collect results and synchronize before clean up.  Since subsequences will call setup and clean up as well I can use your (1) precondition on the init step.  For other equipment set up steps we already have the code increment an init count rather than reinitialize if that call into the function is not the first one.  We'd need to protect the init count, actual device setup/clean up and any shared resources, between threads/tests, which means we'd need to protect the global variables if we go that route.  Is there any other concern off the top of your head that we'd need to address?  The init count and device handles would be globals as previously stated.  In a previous reply and then with (2) solution you're eluding to removing the globals.  I understand they're not desired but since we don't want multiple copies, due to threads, of the same equipment variables ( which is what would happen with an init function returning a pointer into the Object Reference that's stored as a TS Parameter, correct? ) isn't protected the globals inside the code and not having the top level setup steps be threaded the better route? ( from the perspective of 1 instance of the variable, not passing it around sequences via parameters, etc. )  Any insight I'd appreciate.

 

Thanks!

Re: Can I keep a LabVIEW dialog floating in front while displaying a Message Popup?

$
0
0

Unfortunately, the dialog is more than a status bar. Each GUI is UUT specific. It displays the state of the UUT and some measurements from the UUT.

 

Technically it is still possible to use uimessages with a LabVIEW sub-panel on the User Interface, but the customer has a standard UI that they have approved, and cannot change it.

Re: Sample Application

$
0
0

Did you retake the exam? I am planning on taking it within the next three weeks. I took the practice exam 4 time and got around passing. Are the questions similar? Is there other material you can provide? I took TS1 and TS2 and worked with TS several times but I am nervous about failing. Any advice? 


Re: Sample Application

$
0
0

Warsame,

 

In my opinion the CTA is easier because it follows the book a lot closer (TS2 manual).

 

The CTD seems to mix topics a lot more.  For instance you might have one question in which you need to know Step Types, Adapters and Reporting.   So without an understanding of all 3 topics you would miss the question.  Or another question might include User Management, Front-End Callbacks and Station Options. 

 

Pay close attention to wording on the exam.  When it says Sequence it is referring to one of the 5 sequences (Execution Entry Point, Configuration Entry Point, Engine Callbacks, Model Callbacks or Normal) not a sequence file.  Usually when we talk TestStand we say "send me your sequence and I'll throw some tests in there."  We really mean send the Sequence File.  So understanding the actual, TestStand defined, names is important.  The reason this is helpful is because sometimes the answers will be a term that you are familiar with but is totally meaningless in the TestStand world.  A great example of this is Report.  In TestStand the report is what is generated from the result collection.  In the real world this can be referred to by many different names (i.e. DataSheet, Status Sheet, Test Data, etc...)  Some of the answers will throw in the non-TestStand terms just to throw you off.  If you know it is not a TestStand term then chances are you can eliminate that answer right away.

 

Anyhow, good luck and hope you do well.

Will NI be releasing TestStand for Linix in the future?

$
0
0

Will NI be releasing TestStand for Linix in the future?

Keyboard Shortcut for Skipping Steps

$
0
0

Hi,

 

I found this paragraph 

In the TestStand Sequence Editor, you can fully customize the pane and tab layout to optimize development and debugging tasks. You can also interactively customize the menus, toolbars, and keyboard shortcuts. Refer to the NI TestStand Help for more information about working with panes in the sequence editor.

 from: http://zone.ni.com/reference/en-XX/help/370052K-01/tsref/infotopics/seqeditor/

 

I want to be able to create my own shortcut to set steps to Skip/Normal in the sequence editor (at edit time, not run time).  I have found this same paragraph in multiple places in TestStand help, but have found no actual documentation on the process of  "interactively customize the menus, toolbars, and keyboard shortcuts."  

 

Is this possible?  

 

Thanks!

Re: Error: test uuts calls this before looping on UUTs. Is empty in Model file. Override this in the client file to perform an action before any UUTs are tested

$
0
0

Hi ,

i suspect that my modified seq-model file is the reason for error

 

the png is my modified seq file.

 

bcos i have never got this error mentioned in the subject -  with testand default seq file.

 

regards

akshay

Re: Access elements of an array passed as Object Reference

Viewing all 24388 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>