From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unflatten From String Not Functioning in Mobile Module 2011

Mobile Module does not get updated since version 2011. I am not sure my question will be solved. 

 

Unflatten From String.jpg

 

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. 

0 Kudos
Message 1 of 10
(2,774 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(2,759 Views)

@MengHuiHanTang wrote:

Mobile Module does not get updated since version 2011. I am not sure my question will be solved. 

 

Unflatten From String.jpg

 

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?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 10
(2,745 Views)

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).

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 10
(2,715 Views)

Unflatten From String.jpg

 

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. 

0 Kudos
Message 5 of 10
(2,698 Views)

This code is running in a Windows Mobile Device. I need that loop there so I can see the results. 

0 Kudos
Message 6 of 10
(2,697 Views)

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. 

0 Kudos
Message 7 of 10
(2,694 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 10
(2,691 Views)

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.

0 Kudos
Message 9 of 10
(2,680 Views)

@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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 10
(2,665 Views)