From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-29-2010 09:58 PM
Hello,
I'm trying to create a strict typedef array that contains an ENUM control. I notice that if I add or delete items from the ENUM, then the control and control constants will update accordingly. However, if I increase the size of the array (insert or remove elements), and save the control as a strict typedef, the front panel control and its associated constant will not update to reflect the changes. Is there a way to do this? If the size of my strict typedeft control changes I would like to find a way to update the constants in my program to reflect this change.
Thanks!
04-29-2010 10:51 PM
04-30-2010 12:27 AM
Ravens Fan,
oh, I see. That makes sense. I'm still looking for an efficient way of wiring case statements. I thought I could do so by using a constant variable (array of typedef enum's). I have many case statements scaterred throughout multiple vi's and would like a quick way of updating them should the size of the array and / or # of items in the typedef change.
04-30-2010 09:07 AM
04-30-2010 12:48 PM
04-30-2010 02:11 PM
04-30-2010 02:16 PM
If you want to update the array constant based on changes you made to the typedef of the array,
1. Update your typedef control.
2. Drop a new control of that onto your front panel.
3. Go to the block diagram, right click on its terminal, select Change to Constant.
4. Delete your old constant and wire it into the new one.
If you have to update consants to be the same thing in numerous locations, then you are better off creating a subVI that has only a single output and sends out the constant. That way if you need to change the constant, you only have to update it once inside the subVI instead of numerous other locations.
01-08-2014 03:54 AM - edited 01-08-2014 03:55 AM
Sorry to resume message which are resting deep into the server, but after banging my head for some 30 minutes trying to find out what I was doing wrong, I realized that maybe this is just way Labview behaves.
So my issue's just the one of this topic. I find somehow odd that you don't get that value updated, or maybe there should be an option to make the typedef even more strict and having the values updated.
Making a VI that spits out the constant value isn't a valuable option because: you don't immediately see the values, and the typedef is used is a cluster which is another typedef itself, so there's no way to get the values from a vi, if I am not wrong.
I am wondering if a simple class would solve this issue. The values would not immediately show, but at least the values would be inherited by other classes which embed the origin string array.
But I am naive at using classes, so I don't know is it will be a dead end way.
Any comment ?
01-08-2014 04:33 AM - edited 01-08-2014 04:34 AM
Yep.
Basically using a class does the trick.
But IMO it's like shooting a fly with a gun.
The trick is simple: I created a class, with a string array inside, a just a property which reads the array.
If I update the array value (AND DO "make current value default" otherwise you'll be lost again), than all the class istances do gove out the updated value.
And the class just created can be inserted as a member control in another class (and still give out updated values).
01-08-2014 10:50 AM
@Runawaycode wrote:
Sorry to resume message which are resting deep into the server, but after banging my head for some 30 minutes trying to find out what I was doing wrong, I realized that maybe this is just way Labview behaves.
So my issue's just the one of this topic. I find somehow odd that you don't get that value updated, or maybe there should be an option to make the typedef even more strict and having the values updated.
Making a VI that spits out the constant value isn't a valuable option because: you don't immediately see the values, and the typedef is used is a cluster which is another typedef itself, so there's no way to get the values from a vi, if I am not wrong.
Please attach a simplified version of your VIs, so we get a better idea what you are trying to do.