09-23-2007 06:20 AM
I am writing a test application that will contain quite a few GUI controls and indicators and I don't think it is feasible to control the GUI in pure LabVIEW code so I decided to use a Code Interface Node instead. The picture below shows what I'm trying to do (this is just a small sub-set of my large test application):
My C-code basically looks like this (download the project and extract the source code if you're interested in the implementation details):
typedef struct {
LStrHandle Textbox;
LVBoolean RadioButton;
LVBoolean PushButton;
LVBoolean StatusLED;
TD2Hdl StatusLEDColor;
} TD1;
int counter = 0;
MgErr CINRun(TD1 *GUIClusterIn)
{
counter++;
if ((counter & 1) == 1)
{
setColor(GUIClusterIn->StatusLEDColor, RED);
populateString(GUIClusterIn->Textbox, "Odd number of button presses");
GUIClusterIn->RadioButton = 1;
}
else
{
setColor(GUIClusterIn->StatusLEDColor, GREEN);
populateString(GUIClusterIn->Textbox, "Even number of button presses");
GUIClusterIn->RadioButton = 0;
}
return noErr;
}
09-23-2007 07:59 AM - edited 09-23-2007 07:59 AM
hi,
maybe you should move the write gui part in the while loop
cosmin
Message Edited by cosmin on 09-23-2007 08:00 AM
09-24-2007 02:10 AM
09-24-2007 06:10 AM
Related post I think...
http://forums.ni.com/ni/board/message?board.id=170&message.id=273662#M273662