From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure replace

Solved!
Go to solution

Hi,

 

I have a nice code that works fine. In my program i had event stucture.

Right now, the source of events are control or button on the front panel.

I want to upgrade my program. I need that my program will work automaticly (I need my program will read a text file that gives instructions instead of getting instructions from user).

 


I want to use my older program. can i change my code. in order that the event structure will work according to instruction writen in text file?

 

it's impossible to upload my program it's pretty big, sorry.

 

thank you

0 Kudos
Message 1 of 4
(2,584 Views)
Solution
Accepted by topic author dbz123

I'm assuming that your entire program is enclosed in the Event Structure, and that you have only a single loop.  You can, indeed, "drive" the Event Structure from a file.  What you do is to open the file and read the information (which you can do before starting the Event Loop).  Let's say you have two Controls, "File Path" and "Go", both set as Value Change events.  You read (from the file) the File Path, then you create two Property Nodes with the Value(Signalling) property for File Path and Go.  Wire the File Name to the File Name Value Signalling input (you may have to change the Property Node to "Write") and a "True" to the Go Value Signalling input.  Use the Error Line to ensure you run these Property Nodes in this order, and before you start the Event Structure.  Now when your Event Structure starts, it will act as though you manually put the data into the Front Panel controls.

 

Bob Schor

Message 2 of 4
(2,578 Views)

I would suggest using User Events.  They avoid some issues you can run into with latched boolean controls.  Just double up your events so that you can either press the button or the Go User Event is generated.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,558 Views)

thank you very much

0 Kudos
Message 4 of 4
(2,487 Views)