KenG Posted June 6, 2023 Share Posted June 6, 2023 I have an U16 channel "Units" that contains 0 or 1. If I enter ? iif(units[0],format("%.3f",23),format("%.1f",23)) into the command / alert it works as expected. if I try to put the same thing inside a variable value component expression iif(units[0],format("%.3f",23),format("%.1f",23)) does not work. global myunits if I repeat the same expression with a global variable inside a variable value component expression iif(myunits,format("%.3f",23),format("%.1f",23)) it works. I have also tried this in the visibility expression with no success. What am I doing wrong ? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 6, 2023 Share Posted June 6, 2023 The variable value component has its own variable called "Units", so when you take your expression and put it into the Variable Value component, it pulls from the units variable of the component instead of the channel. DAQFactory searches private variables first, then member variables of objects (and components are objects), then it goes to the global namespace for global variables, then after global variables are channels. That said, it is just better to not have conflicting symbol names. Quote Link to comment Share on other sites More sharing options...
KenG Posted June 6, 2023 Author Share Posted June 6, 2023 Haha... I knew it had to be something dumb on my part! Thanks. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 6, 2023 Share Posted June 6, 2023 Not dumb. Symbol name management is slightly more challenging in DAQFactory because it is an interpreted language and doesn't check for conflicts like a full blown compiler like C++ would. Quote Link to comment Share on other sites More sharing options...
KenG Posted June 6, 2023 Author Share Posted June 6, 2023 I just tried to "look up" the variable by typing component._variablevalue.units and got nothing. How can us users navigate the "keyword" issue? I am assuming caption, precision, font, visible, blink, interval might be obvious, but font size? or speed key? or x size are getting a little harder to guess at. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 6, 2023 Share Posted June 6, 2023 "Units" is actually synonymous with "strUnits". There was a time, before variable declaration, when you had to put "str" in front of your variable names to indicate a string. So, at that time strUnits was created. Once that was removed we added a "Units" name for the same variable. Font size on a variable value component is stored in XSizeMin. Yes, this is a bit confusing and the upcoming release of DAQFactory eliminates this in the replacement control. Otherwise I don't have a great answer. Most names match up with the caption used in the dialog box. Again, in the next release we have replaced most of the controls (though existing controls still work on existing documents...) and there the properties window actually shows the variable name as is so this is much easier to track. Please email us if you have any interest in trying the beta of the next release. It is a significant release and we always welcome feedback before release (and after...) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.