LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP connection between two ARM boards MCB 2300

I am trying to develop TCP/IP communication for multiple ARM boards MCB2300. That means that I have to put in one VI code server for multiple incoming connections and a client. I also succeeded in making this between one ARM board and multiple PCs and it worked. Then I tried to add one more ARM board with exactly the same code and connection between this two ARMs didn't work. So I returned to basics and tried with simple LabView code for TCP/IP communication, downloaded on first board simple TCP server code and on the other one board simple TCP client, and it also didn't work. This simple LabView codes I found in LabView examples for TCP/IP communication for ARM MCB2300. I find out that VI stops already at TCP open connection(for client) and TCP wait on listener(for server). All this mentioned codes works in communication between ARM board and computer but between two ARM boards doesn't. ARMs and computers are connected through ethernet router. My questions are: - Is it possible for two(or more) ARM boards MCB2300 to communicate between each other through TCP/IP connection? - How can I solve this problem? What's the catch? - Could anybody please send me any working LabView code(also the most simple one) for TCP/IP communication between ARM boards? Thanks&regards, Johny S
0 Kudos
Message 1 of 12
(8,609 Views)

Hi

 

Sorry for a late answer. I have some questions regarding your problems:

- what port are you setting? If it's "0" try choosing a different value

- did you try UDP connection? Does it work?

- check if you have c-style functions enabled in Build Specifications. If yes - disable them

- have you checked if there's no error coming from Create Listener?

 

Let me know and I'll try to find the solution.

 

Best regards,
Maciej Antonik
National Instruments Poland
0 Kudos
Message 2 of 12
(8,571 Views)
Hi Maciej Antonik and thanks for help. Here are my answers: - what port are you setting? If it's "0" try choosing a different value I am using port 828 and it's different from "0" - did you try UDP connection? Does it work? I didn't try with UDP connection and I am going to try it shortly. What is the difference between TCP and UDP? - check if you have c-style functions enabled in Build Specifications. If yes - disable them In build specification I don't have enabled Generate C function calls. - have you checked if there's no error coming from Create Listener? I have checked and there is no error coming from Create Listener. Any idea what could be solution for TCP connection? Thank you& regards Janez Sluga
0 Kudos
Message 3 of 12
(8,551 Views)

Hi

 

UDP is another Transport Layer protocol (next to TCP), the main difference is that it doesn't support handshaking. There are VIs similar to TCP ones to run UDP. You should be able to use the built-in LabVIEW example (not ARM-specific) without any big changes. 

Let us know what is  the error you are getting in your program (use indicator on the error or a probe.

 

The TCP example shipped with LV should work without any problems. Make also sure that you are using the example which is for your processor - there are two similar ones in example finder, both for different processors. 

 

If it's not a problem, you can also attach your code here.

Best regards,
Maciej Antonik
National Instruments Poland
0 Kudos
Message 4 of 12
(8,544 Views)
Helo,

I tried using UDP communication but without success. I just can't connect two boards.

TCP connection works if PC is a server and ARM board client and if ARM board is server and PC client. But if I download server code on first ARM board and client code on second ARM board it doesn't work. Please try it and tell me if it's the same at you.

I tried to add attachment of TCP project, but this web page doesn't allow me(it says "You may include a limited set of HTML in your messages."), so if you would be so kind and tell me your e-mail and I will send it to you.

If it's possible send me a working code for TCP or UDP(or both) connection.

Best regards,

Janez Sluga
0 Kudos
Message 5 of 12
(8,519 Views)

Hi

 

Unfortunatelly, we have only one board of ARM in our office, do I can't reporduce the problem now. I think you should be able to attach a VI (or a zip file) using the "Add Attachements" button below. If you fail, my address is:

Maciej (dot) Antonik @ni (dot) com, where (dot) means "."

 

In the meantime you can try using one of your ARM boards as a server and a PC as a slave.

 

PS. This Friday is a national holiday, so I'll be out of office.

 

 

Best regards,
Maciej Antonik
National Instruments Poland
0 Kudos
Message 6 of 12
(8,515 Views)

Hi

 

I have received your application. As said before, I am currently not able to reproduce the error because of lack of a second board, but I do have another idea, what could be causing the problems.Give us some details on how have you connected both boards? Are they connected directly with a ethernet cable, or using a hub/switch?

 

When building such an application, you need to add two separate targets to your project and deploy VIs on both. So both boards should be connected using a switch/hub to the same network as your PC. In build specifications see if they have different host names and IP addreses (if not using DHCP). Let us know if there's something you are doing otherwise.

 

PS. Is it ok if I attach your project here?
Best regards,
Maciej Antonik
National Instruments Poland
0 Kudos
Message 7 of 12
(8,476 Views)
Hi

My boards are connected through switch. I also tried with two seperate targets with no success and I have different host names and IP addreses. Any ideas what should I try?

PS. It's ok to attach my project here. It's just simple basic example which doesn't work between two boards. I hope we will find solution.

Thanks&regards,

Janez Sluga

0 Kudos
Message 8 of 12
(8,468 Views)

Hi

 

For the record I'm attaching your second project. I will come back to you as soon as I have an answer. 

Best regards,
Maciej Antonik
National Instruments Poland
0 Kudos
Message 9 of 12
(8,466 Views)

Hi

 

I look through your project and have a couple more questions/requests:

 

1/ For the testing purposes try to make your project as basic as possible. Remove the bottom loops and variables and send only simple data input from a control. I know that this is not a problem of those loops, but it makes troubleshooting easier. 

2/ I see that DNS servers are not configured in your build specifications. Try filling in the correct DNS address for your network. 

 

Now, to make sure I have a clear view of the situation, please perform the following tests and let me know the results:

 a/ Establish a connection between ARM-Client and PC-Server. 

 b/ Establish a connection between ARM-Server and PC-Client.

 c/ Establish a connection between ARM-Server and ARM-Client (here we know it doesn't work, so just let me know if the errors are the same as above).

 

I will talk with our ARM experts and will need all this information in order to find the answer.

Best regards,
Maciej Antonik
National Instruments Poland
0 Kudos
Message 10 of 12
(8,463 Views)