Jump to content

LV Variants in 24/7 RT app?


Recommended Posts

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?

Link to comment

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).

Link to comment

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

Link to comment

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:

Link to comment

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.

Link to comment

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. ;)

Link to comment

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.

Link to comment
  • 2 months later...

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

Link to comment
  • 11 months later...

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.