LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP(UDP) connection with Blackfin

Solved!
Go to solution

Hi!

 

I have  BF-537 EZ-KIT Lite and I'm trying to create a simple server in it. I found following problem: TCP listener does not honor timeout: it waits until client makes connection forever (regardless timeout value). Same happens to "UDP read". Moreover these VIs completely block the execution so the parallel loop is stuck as well. I found workaround: if you wrap while loops in Timed Loop they all run in parallel; the connection listener is still stuck and waits forever, but other loops execute.

 

Is it expected behavior? Any suggestions to fight it?

 

Thanks

0 Kudos
Message 1 of 23
(4,917 Views)

azukov,

 

      Could you post your code so that we could take a look for you?

0 Kudos
Message 2 of 23
(4,897 Views)

Please find attached zipped project demonstarting my problem.

There are 2 VIs for TCP and UDP cases.

Both should work the same way: LEDs start blinking at 10 Hz rate. Instead it freezes and waits for connection forever. Once connection is made (by browser in TCP case and standard UDP-sender in UDP case) all loops execute and then they freeze again until next connection is made.

 

Thank you,

Alexander Zhukov

0 Kudos
Message 3 of 23
(4,890 Views)

Alexander,

 

         The project is looking for BF537_LED_PrjAttr.ctl. Do you have this?

 

0 Kudos
Message 4 of 23
(4,861 Views)

This is a standard file from LV distribution

Here is the path to it:

C:\Program Files\National Instruments\LabVIEW 8.6\Targets\ADI\Embedded\vdk\eio\BF537\BF537_LED_PrjAttr.ctl

 

I also attached the file itself.

 

Thanks!

0 Kudos
Message 5 of 23
(4,858 Views)

Alexander,

 

       I was also not able to get  your project up and running. I am trying to adapt the architecture used in the shipping example called "TCP.lvproj" in the ARM>>Keil>>Protocol Drivers folder of Example Finder (mine is in the Toolkits and Modules folder but yours might be in the Toolkits and Modules Not Installed folder) for the client/server architecture and add in LED support using the shipping example called "BF537 LED Test.lvproj" in the Blackfin>>Fundamentals folder as a basis. You might want to also look at these as guidance. I didn't notice anything off-hand that is going wrong with your code but I am still looking into it.

0 Kudos
Message 6 of 23
(4,820 Views)

Grant,

Did you try to "wake up" loops with a remote connection? The code is actually running but blocking execution until  connection is made. Once a connecton is made the LEDs will blink and freeze again waiting for next connection.

Thanks,

Alexander 

0 Kudos
Message 7 of 23
(4,815 Views)

Alexander,

 

        I used the UDP Sender to "wake up" the LED loop, but no LEDs ever flashed. Are you seeing LED 1 and 2 blink continously and LED 6 just blink once (and you want to see it everytime you run UDP Sender)? I'm just not able to replicate the issue with my EZ-537 kit and your code. Are there any other settings (jumpers, port considerations, etc.) that I could be missing? I believe that you are having this issue but I need your help to be able to replicate it on my end and then troubleshoot it from there. I appreciate your patience while I try to help.

0 Kudos
Message 8 of 23
(4,793 Views)

Grant,

 

First of all I run UDP sender on my host machine not on BF537 (sorry to point oput obvious things,just want to be clear).

Every time I run UDP sender all 3 LEDs change states (sometimes LED1,2 change state twice), then they are frozen again until next UDP packet is sent by sender.  This is what I see.

 

What I expect to see is continous blinking of all 3 LEDs at 5 Hz rate (sorry I was telling you 10 Hz, but actually LED changes state every 100ms so the blinking rate would be 5 Hz). The LED1,2 have to change state because they have "wait for 100ms" VI in their loops. The LED6 should blink continously because "UDP read" should timeout every 100ms.

 

I'm using the default jumper settings (as in the manual). Are you able to instrument the target over TCP when debug mode is enabled?

Are you sure that your UDP sender is using correct address? 

 

Thanks! 

 

0 Kudos
Message 9 of 23
(4,787 Views)

Alexander,

 

     I get LED 1 and 2 to blink constantly and LED 6 to just be on. I can't seem to get the UDP protocol to work though. I am still looking into the issue but just wanted to give you an update on where we stand.

0 Kudos
Message 10 of 23
(4,689 Views)