Ok let me be blunt here. Below is my code to move a ethernet camera. As you can see from the code when the page is opened up you are immediately prompted to enter values for a X-coordinate and a Y-coordinate. Once your value has been inputted in, the camera moves based on the values. Fantastic right? Here is where i'm scratching my head. My Labview program basically takes in sound (short-version here) and is able to determine the position of where the sound is coming from in a x, y value (NOTE: the program THUS far has been able to determine the position but has not been worked on to output to a x y value. But for argument sake let's say it does). My question to all of you is this I have read other theads that asked this and noticed that the code (highlighted in blue) is what they think would do the trick. However, this needs to be constantly working. Meaning my program needs to be constantly be feeding data to the X Y coordinate OR it constantly needs to be prompted through Labview. I dont know what would work best or even what is feasible at this point.
Any help, suggestions comments or opinions anything would be greatly appreciated.
<script type = "text/javascript"> <!--
var x, // x variable axis y, // y variable axis counter; // Basic Counter
var newWindow; //varibale to open up new windows
// The following code should be used to implement Labview into this program // This code has been unmodified since it was given to me // NOTES: Consider intializing lvapp and vi and variables // NOTES: The response function should be changed to X and Y // NOTES: The parameter "Output" should be whatever the Team uses to distinguish X and Y /* lvapp = new ActiveXObject("Labview.Application"); viPath = "C:\\test.vi"; vi = lvapp.GetVIReference(viPath); // Load the vi into memory vi.FPWinOpen = 1; // Open front panel vi.SetControlvalue("Input",125) // set the input parameter, 125 is just a sample vi.Run(); // run the VI here, the "Call"-methode without parameter // does not work since it uses // the defaults of the controls response = vi.GetControlvalue("Output") // get the output parameter
I know that it's not very elegant, but how about writing the data to a file which could be read by the other application? You could use some sort of locking scheme or queue to make sure the data stays current.
>
"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
What about using a FIFO buffer to save data and ensure it is accessed in the correct order? You can find information on programming FIFOs in Javascript here.