From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

First event fired to event structure

Hi all,

   Does anyone know what's the first event being fired to the event structure on VI startup? I set a breakpoint on the event structure and it breaks. However i wasn't able to capture whats the event.

 

My intention was simple; i have a table which list all the IO names and values. So during VI startup, i wan to populate the IO names first. Then in a timed-loop, the values are updated respectively. In this case, i don't need to "refresh" the table every time which waste time and resources.

 

 

It something like the OnLoad event.

 

 

Another way out is to register an user event, and have this event fired during application startup. But i wonder if anyone has a better way?

 

 

Many thanks!

0 Kudos
Message 1 of 13
(2,623 Views)

I haven't heard of any OnLoad event.

 

And what do you mean by you put a breakpoint on the event structure and it breaks?  Is your red box surrounding the event structure?  The code will run until it hits the event structure and then wait for the event.  If your red breakpoint box is surrounding the structure, it actually hits that first before the event structure is reached and begins waiting.

 

If this doesn't answer your questions, then please post your VI so we can see what you are trying to do.

0 Kudos
Message 2 of 13
(2,618 Views)

hi

For this kind of "populating table" I am using the Timeout case.

Put a 1 millisec delay for the timeout through a shift register.

In the timeout case fill all you need, it will execute when you start the program

At exit put a -1 to the shift register. IN this way, the timeout will execute only once at the start of your program.

Another way could be to use the FIRST CALL ? boolean.

N

0 Kudos
Message 3 of 13
(2,613 Views)
"Another way could be to use the FIRST CALL ? boolean" And another way would be to use a state machine..
0 Kudos
Message 4 of 13
(2,610 Views)

@j3r3mi wrote:

 

what's the first event being fired to the event structure


The default one. Stick to it.

 

Regards.

0 Kudos
Message 5 of 13
(2,608 Views)

 


j3r3mi wrote:

My intention was simple; i have a table which list all the IO names and values. So during VI startup, i wan to populate the IO names first. Then in a timed-loop, the values are updated respectively. In this case, i don't need to "refresh" the table every time which waste time and resources.


 

Why don't you show us some code.

 

Are the IO name static for the duration of the program? Are you using a regular table column or the "row header strings []" property for the IO names?

If you want to write the row headers at the start of the program, place the code before the main loop containing the event structure. No event case needed. If you have a specific event to update the table headers if needed, fire the event once at startup using a signaling value property, again with the property node placed before the main loop.

 

 

0 Kudos
Message 6 of 13
(2,604 Views)

I attached a simple program to illustrate what i wanted to do. However the final product would be a more complex one as more controls like radio-box, check box and tab comntrol would be added.

 

Right now i'm facing a problem whereby my table don't get updated. I tested to update the table with random numbers. Its hard to really explain in words due to my nooby english. Anyhow, i have attached the VI.

 

I tested different iteration numbers for the for-loop. Looks like it only works with 1. Should i add more delay? I suppose adding delay won't solve my problem as my application has around 100 to 300 data to display. 😞

 

Where did i went wrong?

 

Many thanks!

0 Kudos
Message 7 of 13
(2,597 Views)

@j3r3mi wrote:

I attached a simple program to illustrate what i wanted to do. However the final product would be a more complex one as more controls like radio-box, check box and tab comntrol would be added.

 

Right now i'm facing a problem whereby my table don't get updated. I tested to update the table with random numbers. Its hard to really explain in words due to my nooby english. Anyhow, i have attached the VI.

 

I tested different iteration numbers for the for-loop. Looks like it only works with 1. Should i add more delay? I suppose adding delay won't solve my problem as my application has around 100 to 300 data to display. 😞

 

Where did i went wrong?

 

Many thanks!


i don't get it.. put a 2 in the For loop and you ll get both values updated. is that you want ?

0 Kudos
Message 8 of 13
(2,591 Views)

Thanks for the prompt help!

 

Yupz, if u if you change to 2, the combox box and values on the 3rd colum (Volts) don't get updated.

 

Maybe i should provide more details. My bad.

 

Basically, the first while loop checks for the updated value of the combo box, and updates the fields (S/N & Name) of the table respectively.

The second while loop checks for the value of combo box and updates the values accordingly.

 

May you experts here have a better solution. 😄

0 Kudos
Message 9 of 13
(2,589 Views)

Hmmmm, i went a step further to test the different response of displaying values on different controls. It seems, if its printing on a table, it would not perform as what its suppose to do. I attached a version which updates an array, and its working fine. I even tried with 300 iterations.

 

Cheers. I'm not sure with the problem, whether its the flow of my program or its actually the "table control" or the event structure or the "format string vi".

 

Awaiting some good news! 😄

0 Kudos
Message 10 of 13
(2,580 Views)