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.

Example Code

TCP Server/Client Communication between two ARM MCB2300 boards

Code and Documents

Attachment

Introduction:

The shipping examples for TCP communication between the host computer and MCB2300 work just fine with either one as the client/server, but I would have two MCB2300 boards communicate with each other. Luckily, we at NI have developed this functionality just for such an occasion. There are instructions below that explain how to use the VIs in ARM2ARMTCP.zip file attached to this document.

A word of advice though, multiple clients are not supported by the Keil TCP stack at the moment. We have contacted Keil to try and work this functionality in for a future release but we do not expect that anytime soon. If it does become supported, it will be in the LabVIEW Embedded Module Release Notes.

Steps to Complete:

ARM Server
1. Connect the first MCB2300 to the PC. The board should have a network cable connected to a switch. The network should have a DHCP server.
2. Deploy the TCP Server - ARM application to this board. (TCP Data Server ARM.vi as startup application)
3. TCP Data Server ARM.vi runs headless. Run the application on the target. Since debugging is disabled, the code can download to flash and will run without the JTAG connected. Power cycle the board and remove the JTAG while powered down.
4. The server should now be running on the target. You can test this by
a. Ping "labview-server". look for a response and note down IP, we will use this later
b. Run the TCP Data Client - PC.vi. Use IP from the previsou step as the Server IP and connect to the target. Verify that the server works.

ARM Client
1. Connect the second MCB2300 to the the PC. This board should have a network cable connected to a swtich. The network should have a DHCP server.
2. Modify project settings for the TCP Client - ARM application:
a. Navigate to Communication Options
b. Get the MAC ID or physical address of your computer. (Run "ipconfig /all" and copy "Physical address")
c. Increment your physical address by 1 and enter it in the MAC address field. eg: if you PC is  00-22-19-21-16-27, enter  00:22:19:21:16:28 (note change "-" to ":")
3. Open the Front Panel of TCP Data Client ARM2ARM.vi and enter the Server IP found for the other MCB2300. Make this value the default value (right-click>>Data Operations>>Make Current Value Default)
4. Run the VI and connect.

*Caution* By default, the MCB2300 devices are configured to have the same MAC Address. This will cause a DHCP server assign the devices the same IP Address. The MAC address is configured in the project and steps to change one of them is listed above.

Additional Notes:

These VIs were developed in LabVIEW Embedded Module for ARM 8.6.1. Older versions might not be supported because of TCP stack differences in the releases.

                                                                     ARM Server

ARMServer.PNG

                                                                     ARM Client

ARMClient.PNG

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
ExCooll
Member
Member
on

Thank you very much. I will use it in my project. Do you have some rights on this code or can I use it freely?

Mgr. Leo Schlattauer
Young scientist
Contributors