LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transmitting a Byte Wirelessly

Solved!
Go to solution

Hello,

 

I am working on a senior project and I am using Labview 2010/2011 to control a wireless device that is controled via teh internet. WE are doing very well on it. My problem is that I cannot figure out how to transmit the data (which is only 1 byte max) to my device. I have my program working serially, but I am unsure as how to convert to the WiFi aspect of it. If it helps or is considered we are using a Lantronix Export. CAn anyone help me out, give me suggestions, tips, or explain to me how to build the "WiFi" portion of the program? 

 

Thank You,

Andrew

0 Kudos
Message 1 of 38
(3,251 Views)
Here's a hint: Wifi is no different from a hard-wired network connection. If your code works with a cable connection it will work with wifi that is properly configured.
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 38
(3,241 Views)

Thank You for your comment. I was working origionally planning to get it working hardwired first. I was workinf on getting it set up working wia a hardwired ethernet cable but I couldn't figure out how to get teh end point to create and send out the data on that either, so I abondend that idea since it wasnt our main end point goal anyways, and now I am working stright for the wifi transmission.. SO far out of what I have tried, serial is the only metheod I have had work succesfully.

0 Kudos
Message 3 of 38
(3,235 Views)

Does the device have an IP Address? If so, you need that and the port number it will listen to for commands. With that you can use th enative TCP VIs to onpen a connectioin to the device. Once the connection is establish you simply use TCP Write/TCP Read to send and receive data from the device.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 38
(3,228 Views)

WirelessLink.jpg

 

In your LabView application:

 

* Create an IP address which matches the device you are trying to connect to.

* Figure out which port you device communicates on at that IP address

* Use LabView function block to open TCP/IP connection

* Read/Write over the open connection using additional LabView TCP/IP function blocks.

 

However:

* There is probably no server in your wireless network, unless your device IS one.  This means there is no mechanism for handing out IP's automatically.

* If above, then you will have to configure your lap top wireless to have a static IP which is compatible with your device.  For example if your device is IP 10.2.2.101 with subnet 255.255.255.0, then set up your laptop to be 10.2.2.201 with subnet 255.255.255.0.

* Using your lap top establish a manual wireless connection to your device.  Right click wireless icon on your Windows status bar.  View Wireless networks.  Select your device, click connect.  When connected, then you will be able to run your LabView application.

 

All the best,

Terry

0 Kudos
Message 5 of 38
(3,225 Views)

Yes we do have a DHCP Server in our wireless network. We are using a Class C IP Address. My question - So if I usderstand correctly. Using the Funchtion blocks you screen-shotted for me, if I sub in my values, (Ip Address & Port #) my connection should work apprioatly? Also what is the 3rd vlaue that you have in your screen shot? The 10.1.2.%d is the ip address and the 10001 is the port number I assume? What is the "100" value?

Thank You.

0 Kudos
Message 6 of 38
(3,214 Views)

This is what I have so far, and it is not working. What is the matter here? Thank You greatly for you help in advance.

0 Kudos
Message 7 of 38
(3,206 Views)

You can easily find the answer to your question using the context sensitive help (Ctrl+H). That would have told you that the third value is the timeout expressed in milliseconds.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 38
(3,189 Views)

Okay. I have a new issue. I have not tested it yet but I believe that the TCP works correctly. If you see any issues feel free to let me know. But my problem is, I am integrating my program with a browser Vi. When I I combime them the Broswer works but my inputs from my buttons are only "scanned" in the loop once and then they do not get scanned again for new inputs. And cause of this I cannot get any output. Anyone have any ideas? Thank You Again.

0 Kudos
Message 9 of 38
(3,162 Views)

Hi Andrew,

 

I took a brief look at your VI, and I think you could move the browser code to a separate loop, making it run in parallel to your motor control code.  Right now everything is executing in the same loop, and the motor code is blocked by your browser code.  If the browser code is moved to a separate loop, the motor code can look at inputs, then send data in a continuous loop, and it won't be blocked by browser code.

 

Regards,

Matt

Applications Engineer
National Instruments
0 Kudos
Message 10 of 38
(3,146 Views)