Hi, I'm trying to combine two separate Vi's into one front panel but when I do this the program gives an error 1, "Input parameters invalid" for the scan from string function. . The example VI's are taken from the DG645 example driver folder and are called "Send triggers in SS mode" and "Set Channel Delay". The two VIs work and did not give an error when ran on separate front panels but when I combine the codes onto one main VI the error occurs. What could be the problem here? I have attached my main Vi, too.
I haven't looked at the two routines that you have combined into a single one, but I'm guessing the structure is something like this:
You have all of the code except Initialize in a While loop, along with the Event Structure. Remember how a While Loop works in LabVIEW (the Principle of Data Flow) -- you'll do the initial VISA Queries and initializations on the left side of the While, will wait until one button is pushed, will do everything in that Event's Case, then (unless you pushed Stop) will run the Loop again, sending VISA Queries and initializations, wait for another Button Push, etc.
What I think you want to do is more like this:
The example VI for the DG645 comes with an "initialize" subVI which initializes the visa outside the loop. Also, the buttons for each action are in the while loop so I believe already have what you suggested to do? I think there could be a timing problem which could be causing the error also, any ideas?
Well, I don't have access to the DG645 Example Folder and its VIs, so I really can't comment on them as stand-alone applications.
Almost every example I've seen (and programmed) that used an Event Structure had the Event as the only structure in a While Loop. You are putting it as a component of the Loop, which appears to me to be wrong. Without seeing "what works", and understanding how you might adapt it to fix "what doesn't work", I have no other ideas.
Thank you for your help, I will try and see how I can change the program to only have the event as the only structure in the while loop and not a component of the loop.