Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a text file for input of control instructions

We would like to be able to read in a series of records from a text file and use each record for control of multiple operations.  An example might be:

 

1,0,-40.5,-0.75,100.5 

0,0,-32.2,0.5,120.4

 

Were the first and second integers are for mode control operations and would only have values of 0 or 1.

The third and fourth floating values are angle and speed setting.

The fifth floating is a distance value.

 

We would like to input each record and complete that operation before inputting and processing the next control operation record. I am relatively new to LabVIEW use, so I hope there is a relatively simple way to accomplish these tasks, but I do not recognize the functions and flow that would be needed. An example would be a tremendous help.

 

Thanks,

Douglas Rohrer

0 Kudos
Message 1 of 2
(1,948 Views)

Doug,

 

I posted an example for you to the NI Community Example Programs, but I also wanted to explain a little about how to do what you're asking for.  Basically, you will input your data from the file as an array.  To process on each value of the array sequentially, put down a For Loop and auto-index the input (shown in the picture below).  This should show you exactly how to process on one value at a time.  Have a great day!

 

 

 

Sincerely,

Chris G in AE
0 Kudos
Message 2 of 2
(1,924 Views)