NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Awais_Qureshi
Posts: 35
0 Kudos
Accepted Solution

Programming Laptop Wifi using Labview

Hi Dear All, Can anyone guide me how may i program my Laptop Wifi module for sending and receiving data through Labview programming. What toolkits or drivers do i need sothat its Express or other VIs are visible in Labview. If possible some example codes or Knowledge base link for this. It will help me in understanding the concepts of Wifi programming. Thanks awais qureshi
Member
H_SH
Posts: 142
0 Kudos

Re: Programming Laptop Wifi using Labview

Hi,

 

you have various option. Please have look at function-> Data Communication -> Protocol. You have opyion of TCP/UDP/Bluetooth etc etc..

 

-HS

 

Member
Awais_Qureshi
Posts: 35
0 Kudos

Re: Programming Laptop Wifi using Labview

Hi Dear,

i have used BT vi for sending data to and from mobile via labview and successful init too.

But me either confused or not getting how to deal Wifi in labview.

Thanks

Knight of NI
Dennis_Knutson
Posts: 33,888
0 Kudos

Re: Programming Laptop Wifi using Labview

If you are connected to a network via WiFi, you don't have to do anything different when using the TCP/IP functions than you would if you have a 'wired' connection to the network. It's all transparent to LabVIEW. Just specify a port/address.

Member
Awais_Qureshi
Posts: 35
0 Kudos

Re: Programming Laptop Wifi using Labview

Lovely solution i will try and let you know if face any hurdle.

Thanks alot dear.

awais qureshi

Member
Awais_Qureshi
Posts: 35
0 Kudos

Re: Programming Laptop Wifi using Labview

Hi Dear  ,

i tried TCP/IP vis and getting them understand. But how can we make our PC as Access point using Labview? Are there any specific VIs init or some extra toolkit required for that. Actually i want PC to become hot spot to be connected. My mobile application will then scan it in serach and then connect to make some data send and receive actions. Do you have some help for me in Labview for that.

For wifi connection i need to use Microsoft connectivity method. How can i do this by Labview. I understood how to set wireless LAN IP and detect it in Labview only once i am connected to other PC via wireless LAN.

Thanks & Regards

awais qureshi

Active Participant
T-REX$
Posts: 502
0 Kudos

Re: Programming Laptop Wifi using Labview

Hello Awais,

 

As far as I know, you would not be able to specify your computer as an access point, unless you dedicate it it's own wireless router and network. What I would recommend is connecting to the existing network, and scanning all devices for the computer that you are looking for via the DLL described here. Once you get the computer name or IP Address, you should be able to connect to the machine using the standard TCP commands.

Cheers!

TJ G
Member
Awais_Qureshi
Posts: 35
0 Kudos

Re: Programming Laptop Wifi using Labview

Hi Dear,

For wifi connection i still used Microsoft connectivity method, could not get it how to advertise my PC as wifi AP via LabView. Actually for bluetooth the drivers are built-in Labview so it automatically advertises and close it. Bu for WLAN we need to use TCP Vis which are general interface for several communication types.

Now Instead of LAN i am using WLAN to connect PC and mobile. All communication read and write operations are performing ok. But the only problem i am facing is that once i disconnect network connection from mobile my labview TCP read operation does not detect it and only timesout at its specified interval. Although for Bluetooth network connection if i disconnect from mobile then BT read detects it as network conncetion closed by peer error (66).

 

Can someone help me on this.

Thanks & Regards

awais qureshi

Active Participant
T-REX$
Posts: 502
0 Kudos

Re: Programming Laptop Wifi using Labview

Hello Awais,

 

I would just catch and clean error 66 after the time-out and let the user and your program know that the connection has been closed. You will still have the time-out occur, but for the user, you should be able to simulate the behavior of the Bluetooth application.

Cheers!

TJ G
Member
Awais_Qureshi
Posts: 35
0 Kudos

Re: Programming Laptop Wifi using Labview

Thanks alot T-REX,

i wpuld try this and let you know if face any difficulties. But just to confirm is it the buil-in failt/deficiency in TCP Read vi that it does not detect connection closed before time out and just waits for time out period and then closes TCP afterwards. Even it does not show 66 error just show 56 error although TCP connection was cloase by peer during the timeout period.

Regrads

awais qureshi