ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control GUI controls and indicators from a Code Interface Node (CIN)

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;

}

 

Whenever I push the Push Button, I would expect the GUI to be updated, but that is not the case. If a put a break point and a probe immediately after my Code Interface Node, I can see that the values have been changed as I would like them to and I therefore feel confident that the Code Interface Node works as it should. The complete project is attached. Any hints would be greatly appreciated.

0 Kudos
Message 1 of 4
(3,350 Views)

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

0 Kudos
Message 2 of 4
(3,337 Views)
Ok, thanks!
0 Kudos
Message 3 of 4
(3,313 Views)

Related post I think...

http://forums.ni.com/ni/board/message?board.id=170&message.id=273662#M273662

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 4 of 4
(3,300 Views)