03-21-2012 03:22 AM
We have a LabView project where we connected a gateway and some nodes. There is a main VI in the project that sends a message to the node and tells it whether to transmit or not. If the node transmits the data, it is supposed to send a confirmation message. The node was configured using the WSN Target VI and it is supposed to send and receive data and messages from the gateway. Our question is do we have to run the main VI and WSN Target VI of the node? When we try to run the WSN Target VI of the node, LabView asks for a top VI and asks to deploy the node.
Attached are the screenshots of the programs.
03-22-2012 03:44 PM
Hi,
I'm a little unclear as to what your question is so I'm going to rephrase a little - let me know if I get it wrong. You want to know if you can have both the main VI and th WSN target VI running at the same time?
Usually you would have a main VI running on your host computer to serve as a user interface and gather the data and some code running on the node (if you're using programmable nodes) to do some initial manipulation of data. These VIs would run at the same time (one on your computer, one on your node). You can only have one top-level VI (the VI that calls any other VIs you want to run) running on the target at a time.
You do not need one VI to be running to have the other run, but it usually makes sense to run both the host vi and the target vi at the same time.
Does that answer your question at all?
03-23-2012 12:40 PM
The problem is that everytime I run the target VI, it asks me to deploy firmware. I want the main VI to call the node target VI. My goal is to see if the node responds to the instructions given by the host program. How can I do that?
03-23-2012 01:31 PM
Hi,
If you don't want it to deploy firmware when you deploy the VI, then make sure your node has firmware updated to the same version of your WSN drivers before you deploy.
The target VI running on the node will have to be running for the main VI to interact with it. You could have a VI that doesn't really do anything until it gets the message from the host VI, but it would have to be running. I recommend looking at our shipping examples (Help>Find Examples then look under Modules and Toolkits>WSN). These examples have a prebuilt host and target VI that send messages to each other. If you run those, you will be able to tell if they're communicating and you can apply some of the same practices in your code (or just modify the example code).
03-24-2012 05:30 PM
Kooks,
I think what you're missing here is the Build Specification. You will need to create a Build Specification for the node, build your target VI for the node, and then deploy that to the node.
Once that is done, the target VI will be continuously running on the node. From that point, you can just run your top-level VI and everything should be fine.