LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Connection Error with Flatten String

Solved!
Go to solution

We want to create a Mahjong Game with online connection feature but we try to use UDP and always get error on unflatten string. We test it out and always find out it UDP read returns a empty string that causes this error. so we think it is something about UDP code that causes this mistake. But we don't know how to fix this. Please help us. Thanks.

 

Github repo : https://github.com/gisgisgisgisgis/Mahjong

 

The problem is on Menu.vi

we want to sync the user count for every player. 

 

Below is the part of sending JOIN request

shironekosan_0-1765301701907.png

This part is about handle player count

shironekosan_1-1765301717983.png

Error:

shironekosan_2-1765301779745.png

 

 

0 Kudos
Message 1 of 7
(194 Views)

Many here don't have LabVIEW 2025 and thus cannot look at your code. (Feel free to down-convert the project to e.g. LabVIEW 2019 and attach it here)

 

What is the datatype of the diagram constant that you wired to the top of the unflatten operation (Cannot tell from the picture!)

 

Side note, unrelated to your error:

You can probably eliminate 50% of your "read global" and eliminate the sequence structures. Right?

 

altenbach_0-1765304651215.png

 

Message 2 of 7
(179 Views)

Thanks for your reply.

It's a u32 integer, and you're right, I can definitely remove it. I'll change that later.

As for the older version, here it is. Because the whole project is too large that I only can upload serveral vi files. These files I think it's all about Menu.vi and the error, and If I miss something that is needed.

Please tell me to upload again.

0 Kudos
Message 3 of 7
(166 Views)

Can you place an indicator at the string response to be flattened? What's in it?

Message 4 of 7
(161 Views)

shironekosan_2-1765307250934.png

 

shironekosan_1-1765307184339.png

 

it's empty. So I assume that I write something wrong in UDP connection part.

0 Kudos
Message 5 of 7
(147 Views)
Solution
Accepted by topic author shironekosan

It's empty because the UDP Read returns an error. But you do not show that error, it's just indicated by the letters "ER" in the tiny blue box on the UDP Read error out. Most likely it is error 56, timout!

 

Your Flatten from string should go into the No Error case of that case structure.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 of 7
(76 Views)

Thank you. After I put it into the No Error case, it immediately fixed the problem.

0 Kudos
Message 7 of 7
(65 Views)