Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a parameter to be used in a run object

I have a table   Table1.C.txt.1  which contains the file name that I wish to copy.  (the table row changes by the user selecting from a
radio button object, changing the file name)
 
I have a Run object that calls a .bat file that will to the ftp connection & then copy the file name that it is passed to the local hard drive
directory. 
 
How do I pass the file name from the table element to the run command?  
 
Also, I want to perform the Run object when the user has selected from the radio button.
Selecting from the radio button will select the file name (from the file) and then I want to
perform the Run object.  (not as the radio is selected but after it has been selected and
I can grab the new file name) 
Do I need to put a pause or wait between the time that the radio button is selected and
the time that the run object is performed to ensure that the new file name is taken from
the table?
 
Frank
0 Kudos
Message 1 of 6
(3,797 Views)
Ok, I have figured out how to pass the file name from the Table to the Run object string
 
how do i get the run object to fire
right now what im doing is
Run when = Radio.1 or Radio.2 or Radio.3 or Radio.4  etc to 10 at the moment.
This works but is there a shortcut, ie like Radio.1-n so that i dont have to keep on adding to this statement if i increase the number
of radio buttons?
 
frank
 
0 Kudos
Message 2 of 6
(3,796 Views)
Frank,
There is not an easy way that I know of to reference multiple data members using a method other than 'or'.  However, what I would suggest is simply adding a pushbutton to execute your Run command.  The advantages are not having to write a big or statement, and also you will be able to execute the Run object with the same file name selected more than once.  In your current architecture you have to change the filename before you can execute the Run object again.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 3 of 6
(3,777 Views)
Thanks Doug.
 
I have tried using a push button to perform the run object but the user is already selecting a machine using the radio button object
so its nice to have the run command initiated using the radio buttons.
 
The run object goes to the network and copies a specific file, based on the radio button clicked, to the user's local hard drive.
This file is connected to a datasocket and the contents displayed on the user screen.
Unfortunately the connect/update members of the datasocket do not work with the radio object either.
I have added a pushbutton to allow the user to click it after the transfer is complete so that the new text file will be displayed on
his screen.  Is there any way of using the radio object to initiate the connect/update of the datasocket object or am i stuck using
a pushbutton.
I was thinking of adding a timer object that would fire after 20 seconds say, that could also perform the connect/update of the datasocket
object.
 
Frank
0 Kudos
Message 4 of 6
(3,770 Views)
Frank, it sounds like you are on the right track.  Lookout is event driven, which means that if several expressions depend on a certain datamember, when that datamember changes value, all expressions looking at that datamember will be re-evaluated.  You have no guarantee which expressions will be evaluated first, so if there are further dependencies between those expressions, you have created a race condition, in which case you will have to re-architect your expressions so there aren't those dependencies/race conditions.  Using an intermediate timer is one way you could accomplish this, though I still think a pushbutton is a better design.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 5 of 6
(3,768 Views)
Doug,
 
What i finally finished with is to link a run object that does the data file tranfer from the network that is linked to the radio button object
as above.  I added a switch (labeled "Show Data") that when activated (using a push button look) it then displays the datasocket text
and starts a timer that now runs the run object that will constantly (every 1 min) look for an update to the text file on the server and then
redisplay it.
 
this does work well, just on extra switch for the user to activate but i have auto polling that works.
 
 
frank
0 Kudos
Message 6 of 6
(3,764 Views)