LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from excel file in realtime, IF statement

I am trying to write a piece of program which can read data from an excel file, perform an IF statement on the data being read and thus use this to control the direction of a DC motor motion. I have attatched the code I have written so far.

 

Data is being obtained and written to the excel file, in realtime, by some Python coding.

I need to be able to read this data in LabVIEW (in realtime) and use the data to dictate whether the motor should move up or down.

The excel data will be stored in a single column and contains simple numerical values. The IF statement should perform as shown below:

 

IF  Data Value = 1, Motor motion stays the same

IF Data Value > 1 , Change Direction

IF Data Value <1 , Change Direction

 

The main issue is that LabVIEW will need to read this data at the same time as it is being written, I am not sure if this is possible?

Secondly, I am not sure what is the best way to create or perform this IF statement. Perhaps MathScript?

 

Since I am new to LabView and have very limited experience using it, I was hoping to get some help or guidance to how I could do this, or if it is possible.

 

Thanks!

 

 

0 Kudos
Message 1 of 3
(2,800 Views)

The case structure is the simple part, you just need 3 cases with ..0, 1, 2.. (unless it's float values in the excel file in which case you need a couple of changes)

Reading and writing to a file from two different program might be impossible, it sounds like you should rethink that design.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(2,717 Views)