Götz Becker Posted March 12, 2008 Report Share Posted March 12, 2008 Hi, I am currently using variants in a RT app without problems (basically always a typedef cluster with a Cmd-Enum and a Variant for the data). For a new 24/7 RT app I am wondering if I could run into problems using variants. Do you generally stay away from Variants in mid-size to large 24/7 RT apps? Does anyone has bad experience with <vilib>/Utility/VariantDataType/GetTypeInfo.vi in RT? Quote Link to comment
Aristos Queue Posted March 12, 2008 Report Share Posted March 12, 2008 No reason to stay away from variants any more than a reason to stay away from strings, arrays and paths (ie they're not flat data types and can require memory to reallocate depending upon how you use them, thus blowing away real-time determinism). What in particular are you worried about? Quote Link to comment
ned Posted March 12, 2008 Report Share Posted March 12, 2008 QUOTE (Götz Becker @ Mar 11 2008, 05:34 AM) Hi,I am currently using variants in a RT app without problems (basically always a typedef cluster with a Cmd-Enum and a Variant for the data). For a new 24/7 RT app I am wondering if I could run into problems using variants. Do you generally stay away from Variants in mid-size to large 24/7 RT apps? Does anyone has bad experience with <vilib>/Utility/VariantDataType/GetTypeInfo.vi in RT? I've used variants for passing data through queues in mid-size RT applications that run 24/7 without problems. I also flatten the variants to strings for TCP/IP communication and make use of attributes - for example, I have an RT server that can have multiple TCP/IP clients, and when a command for the server arrives the TCP refnum is added to the variant as an attribute so that when the server replies it knows where to send the response. I've also used the VariantDataType VIs successfully; in my case I use them to get the label of every item in a cluster (including subclusters). Quote Link to comment
LAVA 1.0 Content Posted March 12, 2008 Report Share Posted March 12, 2008 QUOTE (Götz Becker @ Mar 11 2008, 05:34 AM) ... Do you generally stay away from Variants in mid-size to large 24/7 RT apps? ... It depends on my target platform. FP targets do not have a lot of memory or CPU to spare. I have seen FP-RT run for ages as long as there were no hardware I/O errors. Once hardware errors started returning non-empty "Source" fields in the error cluster, the memory requirments expanded and the app went down due to a lack of memory. In that app, I forced the "Source" filed from FP I/O to be an empty string and the app was able to handle the I/O errors gracefully. PXI RT platforms have more memory and can handle the dynamic memory req's of strings better than FP. Right up until you get to determinism. The Trace Execution Toolkit is handy to get a better feel for dynamic memory allocation etc. Ben Quote Link to comment
Götz Becker Posted March 13, 2008 Author Report Share Posted March 13, 2008 Hi and thank you all for your replies. The target platform will be PXI RT-Controllers and the usage for the variants will be for the RT-Host communication and in the internal sequencing engine. We recently had a discussion with some vague arguments implying possible creeping memory leaks with variants. For the "real" RT-tasks we generally try to stay away from all memory allocations of course. Your responses and this discussion helped to clear the accusations against our planned architecture :thumbup: Quote Link to comment
LAVA 1.0 Content Posted March 13, 2008 Report Share Posted March 13, 2008 QUOTE (Götz Becker @ Mar 12 2008, 05:55 AM) Hi and thank you all for your replies.The target platform will be PXI RT-Controllers and the usage for the variants will be for the RT-Host communication and in the internal sequencing engine. We recently had a discussion with some vague arguments implying possible creeping memory leaks with variants. For the "real" RT-tasks we generally try to stay away from all memory allocations of course. Your responses and http://forums.lavag.org/Send-data-as-Variant-or-Flattened-String-t10129.html' target="_blank">this discussion helped to clear the accusations against our planned architecture :thumbup: Benchmark regularly as you go. Please let us know if you find something the rest of should hear about. Thank you, Ben Quote Link to comment
Götz Becker Posted March 13, 2008 Author Report Share Posted March 13, 2008 QUOTE (neB @ Mar 12 2008, 11:48 AM) Benchmark regularly as you go. I ran a small testapp for several hours yesterday that had some loops and various instances of GetTypeInfo. Not very complex though, but it showed good results with steady memory statistics. If I find something in the real app I´ll report it. Quote Link to comment
LAVA 1.0 Content Posted March 13, 2008 Report Share Posted March 13, 2008 QUOTE (Götz Becker @ Mar 12 2008, 07:05 AM) I ran a small testapp for several hours yesterday that had some loops and various instances of GetTypeInfo. Not very complex though, but it showed good results with steady memory statistics. If I find something in the real app I´ll report it. Thank you very much! Waxing philosophical: The world of LabVIEW is very much like wondering in a golden wood. There are wonders and adventures evrywhere you turn. Few of us* have the capacity to turn over every rock and look behind every tree. But as a team we can share the mysteries and pitfalls we encounter in our adventures as we seek out the gloden blooms that sprout around every corner." "Wax off" Ben *Yair is an exception. Quote Link to comment
Aristos Queue Posted March 13, 2008 Report Share Posted March 13, 2008 QUOTE (neB @ Mar 12 2008, 06:36 AM) The world of LabVIEW is very much like wondering in a golden wood. Or, in one of my favorite Star Trek quotes: "[The universe] is wonderous -- with treasures to satisfy desires both subtle and gross -- but it is not for the timid." Quote Link to comment
Yair Posted March 13, 2008 Report Share Posted March 13, 2008 QUOTE (neB @ Mar 12 2008, 02:36 PM) Few of us* have the capacity to turn over every rock and look behind every tree.*Yair is an exception. I don't actually have the capacity to do that. Most of my knowledge probably comes from reading what others have done and remembering it mostly correctly. Quote Link to comment
Götz Becker Posted May 24, 2008 Author Report Share Posted May 24, 2008 Hi again, I am thinking about extending my current usage of variants in realtime (PharLab) with a variant map (variant encapsulated in a functional global). I don´t plan to use it inside the time critical parts, but in the surrounding application logic (config data etc.). Has anyone already tested this on RT? Greetings Götz Quote Link to comment
Götz Becker Posted May 8, 2009 Author Report Share Posted May 8, 2009 QUOTE (Götz Becker @ Mar 12 2008, 02:05 PM) ... If I find something in the real app I´ll report it. We recently started to get strange errors when using the Inplace Variant function. Just a word of warning, if you get "???" errors out of the inplace error cluster, replacing the Inplace with normal Variant functions (e.g. rightclick menu "Remove In Place Element Structure" is enough) fixes it. The problem is reported, CAR not available yet. Edit: CAR #164718 Edit 2: Pharlab (PXI) RT 8.6.1 Quote Link to comment
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.