LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple loops or multiple VI's?


@Mark_Yedinak wrote:

I would avoid using shared variables as your means of communications. Shared variables are not that reliable for a variety of reasons. Better methods of communicating between application components are to use queues, user events, notifiers or channel wires. More complex systems like the ones I use will have more advanced communication mechanisms such as the publish/subscribe messaging system.


I didn't mention this yet, but I am using a compactRIO. I think the main reason I use shared variables a lot is because that's what Real Time 1 course from NI said to do. Also, since it's a compactRIO then user events would not be a good idea, correct? Since those don't really work on RIO's from what I understand. No front panel software or something

0 Kudos
Message 11 of 14
(411 Views)

Hi David,

 


@David99999 wrote:
I didn't mention this yet, but I am using a compactRIO. I think the main reason I use shared variables a lot is because that's what Real Time 1 course from NI said to do. Also, since it's a compactRIO then user events would not be a good idea, correct? Since those don't really work on RIO's from what I understand. No front panel software or something

You should have mentioned that right from beginning!

  • Just because NI recommends SVs in RT1 course you should not rely on them for more advanced topics. There are better options as mentioned before. There are also RT-FIFOs...
  • You can use user-defined events, but not UI events (like ValueChange or MouseMove).

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 14
(408 Views)

@GerdW wrote:

Hi David,


You should have mentioned that right from beginning!

  • Just because NI recommends SVs in RT1 course you should not rely on them for more advanced topics. There are better options as mentioned before. There are also RT-FIFOs...
  • You can use user-defined events, but not UI events (like ValueChange or MouseMove).

 


Count on me to leave vital information out 😁

 

And RT-FIFO's are for making sure you grab all the data, where you may be data logging, no? A lot of my shared variable usage (so far) has just been for utilizing the latest value

0 Kudos
Message 13 of 14
(403 Views)

@David99999 wrote:

@Mark_Yedinak wrote:

I would avoid using shared variables as your means of communications. Shared variables are not that reliable for a variety of reasons. Better methods of communicating between application components are to use queues, user events, notifiers or channel wires. More complex systems like the ones I use will have more advanced communication mechanisms such as the publish/subscribe messaging system.


I didn't mention this yet, but I am using a compactRIO. I think the main reason I use shared variables a lot is because that's what Real Time 1 course from NI said to do. Also, since it's a compactRIO then user events would not be a good idea, correct? Since those don't really work on RIO's from what I understand. No front panel software or something


Read https://www.ni.com/en-us/shop/compactrio/compactrio-developers-guide.html

 

Stepping back, I prefer a systems engineering approach to these kinds of projects.  Some kind of (high level) system diagram, data flow diagram, and sequence diagram can be very helpful and more efficient than what happens in most cases (as here) where words are being used to describe a system (or its intent).  This is generally not common with LabVIEW users and a hidden cost in their approach.  I do not think this is always needed but when a certain complexity threshold is passed (and this may be more complex) the systems engineering approach is helpful.  Going to code level discussions such as how many loops, events vs queues or this variable type versus another may be too far along than is important.


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 14 of 14
(398 Views)