LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in 2012 Statecharts with LVOOP queues

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.

 

Message 1 of 11
(2,920 Views)

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,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(2,869 Views)

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.

0 Kudos
Message 3 of 11
(2,864 Views)

1 after,

 

Some changes are being made to the Forums.  This link may give you some answers.

 

Lynn

0 Kudos
Message 4 of 11
(2,858 Views)

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,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 11
(2,838 Views)

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.

0 Kudos
Message 6 of 11
(2,818 Views)

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,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 11
(2,814 Views)

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.

0 Kudos
Message 8 of 11
(2,808 Views)

Matt_W1,

 

I am going to discuss this with R&D. I will let you know what they say.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 9 of 11
(2,785 Views)

Matt_W1,

 

I have filed a CAR on this behavior. For your reference, the CAR's designation is 374402.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 11
(2,760 Views)