09-23-2009 01:22 PM
I have a strange problem that I am working on. When my AE executes a certain method, the data that I am trying to package into the cluster is lost. I use this design pattern for all my AE designs but have never seen this issue before.
When the waveform is converted to an array of DBL, the cluster does not update with the data. Any ideas why?
Solved! Go to Solution.
09-23-2009 02:19 PM - edited 09-23-2009 02:27 PM
Try initializing the arry to the required size with zeros in the "initialization state"
09-23-2009 02:34 PM
This will make it work correctly.
This is probably not the most memory efficient method.
09-23-2009 03:12 PM
vt92--
Thank you for your replies. I still wonder, mostly from a philosophical standpoint, why an array comes out of the "~|Y" VI and doesn't propogate to the cluster. In the kc64 case, the "~|Y" VI produces an array with 500 elements and, in the vt92 case, the code still produces an array with 500 elements. It seems like it should work. I think I will have to use it without understanding it for the time being.
Thanks,
kc64
09-23-2009 03:49 PM
kc64 wrote:I have a strange problem that I am working on. When my AE executes a certain method, the data that I am trying to package into the cluster is lost. I use this design pattern for all my AE designs but have never seen this issue before.
When the waveform is converted to an array of DBL, the cluster does not update with the data. Any ideas why?
What you have isn't really an action engine - it's basically just a state machine. That said, I can't replicate what you're seeing. Can you provide the exact steps you're doing?
As far as the suggestions provided - they're pointless. Initializing an array of 500 points and then using Insert Into Array makes no sense to me either.
09-23-2009 03:56 PM
Thanks for your reply. I often find myself calling both an SM and an AE as AE as long as it uses some USR.
I am running LV 8.5.1 and it happens repeatably. Run the code in execution highlighting and watch the Output AE port after completion of the Get Waveform Datapoints method. You should see #500 on the output of the "~|Y" VI. When it gets back to the USR, the data is gone.
09-23-2009 04:19 PM
kc64 wrote:
When it gets back to the USR, the data is gone.
I assume you meant to add "when you run the VI a second time", since the VI will stop after execution of that state. Unfortunately, I don't have 8.5.1, so I tried your code in 8.2 and LV 2009 and it behaved correctly. In other words, when running the VI a second time, a probe placed on the left side on the wire going from the left shift register and into the case structure indicated the value of the shift register was still there.
09-23-2009 04:20 PM - edited 09-23-2009 04:21 PM
09-23-2009 04:37 PM
I could replicate his issue and my suggestion did work on my machine running LabVIEW 8.6. I'm not saying is the best way, but it may be a clue as to what is going on.
09-23-2009 04:52 PM
I have experimented with this for several hours with no root cause identified. I tried to remove the waveform object from the type def in the initialization state and it crashed LV--repeatedly. So, I left it out. Now the code runs fine. I still don't know what I was dealing with. Thanks to all of you who generously offered to help.
See the modified code attached.