01-06-2010 01:47 PM
Hi all,
I would like to save a bunch of registers addresses (constants) into global variable, so that the addresses will be associated with a name, and I can call them later on. My question is would I be able to organize a variable like below?
Product.function.function2.parameters1?
Thanks!
Yik
Solved! Go to Solution.
01-06-2010 01:51 PM
01-06-2010 01:54 PM
If I use a .ini file, don't I have to read from the file all the time? I don't want to read a file to access variable.
Yik
01-06-2010 02:21 PM
I would have two suggestions off the top of my head. Clusters inside clusters will give you the '.' notation you are after. You can hide full names to save some space. What I would do is use a type-def enum constant to index an array of addresses. Then you use the pull-down menu to select the name. Either way, overuse of long names is a quick way to get bloated block diagrams. I like a balance between descriptive names and having my LV code look like C++.
Regardless of your naming/storage technique cluster, enum, variant, other, I would suggest a 'functional global' aka state machine or action engine instead of the global variable to store the values. If you want, you can retrieve the values from an INI or XML file the first time, after that, you just retrieve the values from the FG as usual.
01-07-2010 11:03 AM