10-03-2011 01:48 AM
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
Solved! Go to Solution.
10-03-2011 04:49 AM
10-03-2011 02:09 PM
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.
10-03-2011 02:48 PM
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.
10-03-2011 03:24 PM
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
10-03-2011 05:31 PM
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.
10-03-2011 07:11 PM
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.
10-03-2011 10:11 PM
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.
10-10-2011 09:19 PM
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.
10-11-2011 01:04 PM - edited 10-11-2011 01:05 PM
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