08-17-2017 01:38 AM
Hi,
I have a problem (or maybe I do not). I'm searching for the most efficient way of doing this.
Currently I'm reading a number of parameters (beloning to a specific actuator) from a config file. The value's are stored in functional global variable in protected scope. Further more I have a GetValue VI that is getting the parameter values from the functional global.
In Short I have: Class "Actuator" with VI's:
1. ReadFromDisk (private)
2. ChangeParameters (public)
3. ParametersFGV (private)
4. GetParameters (public)
Is there a better way of doing this? I cannot seem to find a way. If I need to add some kind to clarify, please ask.
Kind Regards,
08-17-2017 06:18 AM
In my opinion, your approach seems valid, especially if it works. However, if you have a problem, you obviously need to fix it. What is your problem with this approach?
08-17-2017 06:29 AM
Sjeg wrote: The value's are stored in functional global variable in protected scope. Further more I have a GetValue VI that is getting the parameter values from the functional global.
If all of the states of your FGV are "Get Value" and "Set Value", then change it to be a Global Variable. They are functionally equivalent, but the Global is a lot faster.
But as an object, these parameters should be need to go outside of the object. So the ChangeParameters and GetParameters seem to contradict the point of a class. Instead, you should have methods to tell the actuator to do something.