08-13-2014 04:42 PM
Mobile Module does not get updated since version 2011. I am not sure my question will be solved.
I have been using Simple Messaging Reference Library (STM) for a couple of years. I use them in my Mobile Module code too. It has been working fine until lately I updated to the latest version of STM.
I noticed that 'Read Message (TCP).vi' was not functioning properly in the Mobile Module code. After a long debugging, I found the source of the problem. 'Unflattern From String.vi' does not work in Mobile Module any more. I did a test as shown above.
My questions are
1). 'Unflattern From String' was changed so it is not supported in Mobile Module 2011?
2) Why the same code worked before, but not now?
I use LabVIEW 2011 and Mobile Module 2011. Thanks.
08-13-2014 06:14 PM
Based on that screen shot, you have a lot of issues. The string length should be a lot more than 0. At the very least, it should be 4. Did you not run this VI before taking the screen shot? And that loop there is completely unnecessary.
08-13-2014 06:50 PM - edited 08-13-2014 06:53 PM
@MengHuiHanTang wrote:
Mobile Module does not get updated since version 2011. I am not sure my question will be solved.
I have been using Simple Messaging Reference Library (STM) for a couple of years. I use them in my Mobile Module code too. It has been working fine until lately I updated to the latest version of STM.
I noticed that 'Read Message (TCP).vi' was not functioning properly in the Mobile Module code. After a long debugging, I found the source of the problem. 'Unflattern From String.vi' does not work in Mobile Module any more. I did a test as shown above.
My questions are
1). 'Unflattern From String' was changed so it is not supported in Mobile Module 2011?
2) Why the same code worked before, but not now?
I use LabVIEW 2011 and Mobile Module 2011. Thanks.
Is that the real code or just a mockup to demonstrate the issue? I'm asking because the code is set up to run once and then wait until the stop button is pressed. Then the VI will complete and exit. Is the the desired behavior?
08-14-2014 07:47 AM
For one thing this code won't produce meaningful results even if everything works fine. Basically your string contains a flattened I32 and then a flattened I16 followed by the String Data. But you try to unflatten this to an I16 which will take the 2 MSB from the I32 length (which always will be 0).
08-14-2014 10:10 AM
I changed the code as shown above. The point I was trying to make was that 'Unflatten From String' does not function correctly in the Mobile Module code. As in this case, it returns the I16 value '2', but throw away the rest of the string.
08-14-2014 10:12 AM
This code is running in a Windows Mobile Device. I need that loop there so I can see the results.
08-14-2014 10:13 AM
That picture simple shows what the original code looks like. It runs in a Windows Mobile device. The loop is there simply to view the results.
08-14-2014 10:14 AM - edited 08-14-2014 10:15 AM
I remember some post elsewhere about this. There I believe it was on a realtime system for an older LabVIEW version (possibly around 2009-2011), so the bug is probably not just limited to the Mobile Module alone. The workaround was to explicitedly split the flattened string yourself before passing it to Unflatten.
08-14-2014 10:45 AM
the part that really confuses me is that the same code worked fine before. Only after I updated the STM library did this issue pop up. But the 'Unflatten From String' is a LabVIEW basic function, so it should not have changed. I am still using the same version of LabVIEW 2011.
Just weird. Now I have to find a workaround like you said.
08-14-2014 02:28 PM
@MengHuiHanTang wrote:
the part that really confuses me is that the same code worked fine before. Only after I updated the STM library did this issue pop up. But the 'Unflatten From String' is a LabVIEW basic function, so it should not have changed. I am still using the same version of LabVIEW 2011.
Just weird. Now I have to find a workaround like you said.
Well you upgraded STM so it is quite likely that the change is in there. Maybe the new version adds a feature that appends some extra data after the initial flattened element and uses the "remainder" from Unflatten for this. If the old STM library only had a single flattened element there, then there wouldn't have been any use of the remainder output of course.