09-15-2006 08:42 AM
09-15-2006 08:47 AM
Years ago I wrote many a macro for NIH Image.... I know what you want but have not seen it exactly in LV. Aside from just making the LV code do the work one can create a list of VI's that do the task. Have this list as a string that can be added to and changed in a textfile. Read in the string array of "tasks", or vi's to call that do the operations one by one, and dynamically execute them by using a loop. Not exactly a macro but close.
Mark
09-15-2006 08:59 AM
09-15-2006 09:22 AM
I have done something along those lines. Basically, I had a series of LV demos I wanted to run continuosly when we were presenting somewhere, so I wrote a VI which monitored the mouse in a loop (using the input VIs) and logged the position and timing of every click in a file.
Then, when I wanted to replay it, I had the program load the list and calculate the trajectories and timing and moved and "clicked" the mouse using Windows API functions (SetCursorPos and Mouse_event, probably. You can search for example in the forums). Keyboard clicks can be recorded and simulated as well. The important point about this is that it was completely stupid - it had no idea what it was clicking on, just that that was the location where the click was made. If for any reason the window would have moved, the click would not have worked.
If you want to make this more intelligent, then you can log the label of the control being modified and then when you need to replay use its properties to decide where to click.
05-04-2007 07:35 AM
05-04-2007 08:34 AM
If I understand your description correctly, you should be able to use the Value(Signaling) property to set the control's value and fire an event.
Start by building an array of references for all the controls in the front panel (you need to do this recursively because of tab controls and clusters. There have been several VIs posted for doing this) and get their labels. You can then search the labels array for the label and use that index to get the reference to your control from the second array and use that reference to change the value of the control.
You should note that this will not work for latched boolean controls.
05-11-2007 09:31 AM
05-11-2007 02:16 PM
05-14-2007 06:45 AM
05-14-2007 11:43 AM