|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Using shared variables instead of global variables
The Shared Variable is meant for sharing data over a network while hiding the network implementation. I can't speak much to the performance, but I can recommend other ways to help.
Ideally you should try to reduce the number of global variables that you use in the first place. If you are getting lost in the number of global variables that you are using, you are probably using too many. There are a number of ways to reduce the number of globals. The easiest way would be to send a cluster using the global, instead of using single data types and multiple globals. If you want to get into the more advanced LabVIEW topics, you can change your architecture to use other message passing schemes (Notifiers, Queues etc). Depending on your implementation, you could possibly get away with not using any global variables at all. |
|
#2
|
||||
|
||||
|
Re: Using shared variables instead of global variables
Quote:
For each state machine we have commands/actions like open or close. Then, in the Teleop.vi we send different commands to the state machines which run in parallel, based on driver's input. *We have an enum typeDef for each state machine and for each set of actions. for example: the grabber state machine is in close state, pressing button 1 sends "open" to the grabber state machine, the grabber state machines then moves to "moving to open" state, and when it detects it reached the target it moves to "open". Which architecture do you recommend using? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|