[IDLE] Cowtown G Slingers - Fort Worth LabVIEW User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating Arrays with XControls - Library and Examples

Greetings all!

I've added some documentation to the examples I presented at the November user group meetup as well as two new examples. Feel free to post here with any questions or issues you may have. Eventually I'll be uploading a video walk through of the library and xcontrol features and will update this post when that is ready.

0 Kudos
Message 1 of 6
(8,673 Views)

could you upload the presentation also?

CLAD, CTD
0 Kudos
Message 2 of 6
(8,371 Views)

Sure thing. Let me add in a few things that I went over in demos and I'll get it uploaded, likely over the weekend.

0 Kudos
Message 3 of 6
(8,371 Views)

This is a very useful library for me today. Thanks.

 

Minor patch to your Control Array.lvlib. Saved in LV2015.

I found a hard-to-trigger-but-still-possible race condition in your Control Array.lvlib having to do with shutdown. Suppose the main VI forks to run the main event loop in parallel with UI Events Loop.vi, as happens in the recipe example. If the main event loop quits very quickly, it is possible (really hard, but possible) for Dispose Array.vi to make it all the way to checking for the running Boolean and see that it is False before UI Events Loop.vi has a chance to set the running Boolean to "true". Dispose Array.vi thinks that the UI Events Loop.vi is already finished. That leads to the UI Events Loop.vi never finishing.

 

I replaced your polling of the Boolean with a queue refnum that waits for a dequeue.

 

I also changed the error handling inside Dispose Array.vi to send the Stop event even if there is an error in. That avoided another hang.

0 Kudos
Message 4 of 6
(5,049 Views)

Oh boy this is an old one! I'm curious, are you using this with XControls or just other clusters/controls?

 

Perhaps you'd be more interested in an OOP approach with subpanels at https://github.com/negentropicnomad/oopanel

 

with a demo temperature recipe editor at https://github.com/negentropicnomad/temp-recipe

 

and a demo video at https://www.youtube.com/watch?v=8HOmzipyGVY which shows using these in PPLs but I stopped using that approach as well, functionality is the same.

 

Though I suppose you could create an XControl with the previous library where the data IS a class type and that would create similar functionality. I mostly avoid XControls these days as I don't usually need the edit-time features they provide.

 

Also that oopanel library I just linked is about to be replaced by an updated version I'm currently finishing up and will be giving a virtual LVUG presentation about in 2.5 weeks. I'll have to make sure I look for the situations you ran into with this controls library

0 Kudos
Message 5 of 6
(5,043 Views)

Ahh and I see what issue you're talking about with the shutdown. I've made it a pretty standard practice these days to launch loops like that asynchronously and handshake back to the launching VI with a boolean or notifier once a stop event has been registered for. With this blocking async launch shutdown events can't be missed. I've also started using mechanisms like notifiers which have a built-in timeout so I can handle any startup errors that typically happen while I'm still developing code.

0 Kudos
Message 6 of 6
(5,039 Views)