LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Display message popup

Hello All

 

I have strucked at one point related to message popups. Request Please guide 

 

1)  i am using CONFIRM POP UP to get User selection.

2)  the same i will assign it to the variable

 

next i want to display that variable . can any one help on this. How to display the variable as in POP UP

 

 

Thanks

Hussain

 

0 Kudos
Message 1 of 8
(11,264 Views)

Have you tried with MessagePopup ()? You will need to format a proper message text since the function accepts only strings; e.g.

 

sprintf (msg, "Variable value is %d", variable);

MessagePoup ("Variable", msg);

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 8
(11,258 Views)

Hello 

 

Thanks for the response, I have not updated any thing yet. i will perform this now.

 

I will follow this format to get what i required

 

int X;

X = ConfirmPopup ("confirmation", "Does the values are correct format?");

sprintf (msg, "Variable value is %d", X);

MessagePoup ("Variable", msg);

 

can you Please confirm is this correct format

 

Hussain

0 Kudos
Message 3 of 8
(11,251 Views)

I may have misunderstood your previous message.

ConfirmPopup returns only a yes/no response: your X variable will contain 1 if the user pressed Yes, 0 if he pressed No.

There is no way with that function for the user to enter a value and have it returned to the program.

 

Having said this, your code is correct: it will display a message with the value 0 or 1 depending on user choices.

It's up to you to decide whether this is enough for your needs or you need some more advanced interaction with the user, like for example the one offered by PromptPopup.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 8
(11,243 Views)

Hello 

Currently i am looking for display of 1 or 0 only.Really appreciate your valuable support.

 

May i know few examples using promptpopup command

0 Kudos
Message 5 of 8
(11,225 Views)

Do we need to add any headder file for this ?

0 Kudos
Message 6 of 8
(11,223 Views)

Header file needed? Yes. "userint.h"

Message 7 of 8
(11,218 Views)

CVI comes plenty of examples that you can look at. You can use the Example Finder (Help >> Find Examples... menu function) and search among the examples installed in your machines or available on NI site. I suggest you take a look at this function as it can save you a lot of time wondering how some function works. This document, even if aimed to examples related to hardware, describes the Example Finder and its available customization.

 

popup.cws supplied example can be looked at while dealing with several popus offered by CVI environment, including PromptPopup.

 

With reference to the include file needed, if you are working inside the CVI IDE you have not to worry about that: the IDE will ask you to add all missing includes every time you debug your program.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 8
(11,203 Views)