From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement FileGlobals variables select popup with CVI?

Solved!
Go to solution

 Good Morning!

I am developing a program in CVI 2013 using TestStand API to create some custom step types.

One of them requieres to show a window, similar to the one FileSelectPopup shows, to allow the user to select an existing variable from FileGlobals of a sequence file and the possibility to create a new one. 

I found methods GetNumSubProperties and GetNthSubPropertyName to list variables from TestStand but for this program i need to have an interface similar the FileSelectPopup function creates to select files in CVI.

Thanks in advance!

Alejandro

0 Kudos
Message 1 of 9
(3,589 Views)

Hi  AlePinto

 

I found a page where it explains how to use the File Selection Popup in CVI How to CVI

 

In the post the show you how to make theses file/directory popups appear, how to configure them and how to get the user entered information from them.

 

Regards

La Niña || CLAD

0 Kudos
Message 2 of 9
(3,517 Views)

Hi LaNiña, 

Thanks for your response but it is not what i am looking for.

I need to implement a function that shows a window with all the variables present in FileGlobals of a TestStand sequence file similar to the way a file browser, like FileSelectPopup, does.

This way, the user could select any of the existing variables inside FileGlobals of an specific sequence file and maybe create a new one too.

Regards,

Alejandro

0 Kudos
Message 3 of 9
(3,514 Views)

Hi AlePinto

I found this information that if I understand right it’s what you are looking for Window»Variables and Call Stack, this command opens the variable window and shows you all variables currently defined in the program, also you can find more information in the next link Variables and Call Stack Window

 

I hope this time I understood correctly

Regards

La Niña || CLAD

0 Kudos
Message 4 of 9
(3,482 Views)

Hello again.

I need to launch programmatically a Variables Browser, from an application developed in CVI with TestStand API, in a similar way like TestStand does in the Expression Browser of an Statement step as it can be seen below:

TestStand Expression Browser (Variables selection)

That is to say, the user should be able to press an icon on an UIR and a window like the one above must appear to give the user the possibility to select an existing variable of a TestStand sequence file.

Regards, 

Alejandro

0 Kudos
Message 5 of 9
(3,455 Views)

Alejandro,

 

Depending on the level of control you'd like to give to the end user, you may be able to use the VariablesView control.

 

Alternatively, you could use a custom panel and the API to expose only what you need.

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 6 of 9
(3,450 Views)

Hello WireWeaver,

 

Thanks for your response! I think i could implement it but i found another method which is exactly i was looking for. Anyway, i couldn't make it work. I am using the method TS_EngineDisplayBrowseExprDialog to launch Expression Browser dialog box but it doesn't work. Here it is the piece of code written in CVI i made for an Edit Substep of a Custom Step Type i developed and works fine except the launching of this dialog box.

 

CAObjHandle seqContextCVI

ERRORINFO errorInfo;

uint8_t tsVariableSelected[1024];
uint8_t tsVariableSelectedOK = 0;
int64_t tsVarSelectionStartOut;
int64_t tsVarSelectionEndOut;

 

TS_EngineDisplayBrowseExprDialog (seqContextCVI, &errorInfo, "TestStand Sequence Variables Browser", seqContextCVI, "", 0, 0, "", 0,0, &tsVariableSelected, &tsVarSelectionStartOut, &tsVarSelectionEndOut, &tsVariableSelectedOK);

 

If anyone can give me some help i would appreciate it!

 

Regards,

Alejandro

0 Kudos
Message 7 of 9
(3,434 Views)
Solution
Accepted by topic author AlePinto

I'm not sure if TS_EngineDisplayBrowseExprDialog will do exactly what you're looking for but if you think it will help, here's a crude sample:

#include "tsapicvi.h"

__declspec(dllexport) void SelectExpr(CAObjHandle SeqContext)
{
VBOOL finished;
CAObjHandle Engine;
long selEndOut,selStartOut;
char *xprOut;

TS_SeqContextGetEngine (SeqContext, NULL, &Engine);
TS_EngineDisplayBrowseExprDialogEx (Engine, NULL, "", SeqContext, "", 0, -1, "FileGlobals", 0, &xprOut, &selStartOut, &selEndOut, &finished);
TS_PropertyEvaluateEx (SeqContext, NULL, xprOut, 0,NULL );
}

This function takes in SequenceContext, displays an Expression Browser, and evaluates the resulting expression. For example, if you input "FileGlobals.myVar = 17", it will set the runtime value of FileGlobals.myVar to be 17. The variables you see in the Expression Browser will be dependent on the Sequence Context you pass in.

 

I think it's a better idea to write your own custom panel if you want a user friendly way to set variables. If you only care about viewing the structure, TS_EngineDisplayBrowsePropertyObjectDialog would be a better choice.

 

Hope this helps!

Trent

 

https://www.linkedin.com/in/trentweaver
Message 8 of 9
(3,418 Views)

That is what i needed for my project!

 

Thanks for your time and accurate response.

 

Regards!

 

Alejandro

0 Kudos
Message 9 of 9
(3,404 Views)