10-05-2012 08:00 PM
I was trying out LV 2012 and found a bug in the statechart module. If the outputs contain a queue of LabVIEW objects the statechart will fail to generate code with error.
Failed to generate statechart.
Error 91 occurred at Statechart Code Generation
Possible reason(s):
LabVIEW: The data type of the variant is not compatible with the data type wired to the type input.
In the example I just made a new statechart and added a queue of base labview objects. In the code I was porting over from 2011 sp1, the queue's are of a subclass of LV Objects.
10-08-2012 06:56 PM
Matt_W1,
I am currently looking into this and I will determine if a CAR needs to be filed. I am curious why you are using a LVOOP object queue? Is there a work around that you have developed?
Best,
10-08-2012 09:01 PM
I haven't had much time to look into a work around embedding the queue into a DVR or a Cluster doesn't seem the make a work. The issue also exists if I put the queue's into the state data. The queues are single element so I might be able to replace them with DVRs but I have things that wait for new data, so I would need to add separate update notifications. Notifier's might work, but I have to make sure data isn't lost. The simplest solution might be to flatten/unflatten to/from strings, and just store the strings in the queue. I could also use named queue's (I tend to avoid them since it can mask some kinds of coding bugs until runtime). User events can also be used as queue's but I don't think I can limit them to size 1.
I've used this statechart since LV2009 so it's a new bug. As for what it does, it's a bit complicated (I wouldn't be using a statechart otherwise). But I have some VIs that function as UIs for different LVOOP Objects, this statechart manages sync issues with quickly starting and stopping different UI VIs that may modify state. One queue feeds the part that displays the UIs the other is for updating the data collection of the objects. The issues it solves are subtle, and it's been a while since I've had to dig through this part of the code, so hopefully I can find a clean workaround.
I seem to have a 1 after my name now.
10-08-2012 09:55 PM
10-09-2012 09:51 AM
Matt_W1,
Is there any way that you could provide the code for, say, LV 2011 SP1 that worked as expected so that I can have a comparison study? This would help me escalate the issue.
Best,
10-09-2012 03:40 PM
I remade my bugged example in 2011, you can generate code in 2011sp1 (even though the chart is empty it should still compile). Open it in 2012 and you can't generate the code. All I did was add a queue of LV Objects to the output type def. It breaks if you add the queue to any of the type defs.
10-09-2012 04:28 PM
Hi Matt_W1,
I was able to reproduce the error in 2012 and the program ran without error in 2011. Could you please explain how you created this "LVOOP Object Queue?" I am unable to find this data type on the palette.
Best,
10-09-2012 11:26 PM
I took the "LV Object Constant" and feed it into the "element data type" input of "obtain queue", then I made an indcator from queue out (a standard method to type a queue control), then I copied that indicator into the cluster onto the statechart's output type def. The class of the LVOOP object nor the typedef you put it in seem to matter.
10-10-2012 03:32 PM
Matt_W1,
I am going to discuss this with R&D. I will let you know what they say.
Best,
10-12-2012 05:02 PM
Matt_W1,
I have filed a CAR on this behavior. For your reference, the CAR's designation is 374402.
Best,