06-07-2018 09:44 PM
Hi,
I'm trying to create a program in labview that will output voltages in a programmed sequence specified by the user. My approach in making this program is to have the user upload an excel file or some other spreadsheet file (.tdms file type), or to have them enter the data into a similar table on labview itself. There would be two columns in this spreadsheet: the left column will have times in seconds for how long a specified voltage should be applied, and the right column will contain the value of that applied voltage. This is what the table would look like:
Time (s) Voltage (V)
2 3
4 8
1 6
So according to this table, an applied voltage of 3 volts will be applied for 2 seconds, and then 6 volts for 4 seconds, and so on. I was thinking of utilizing the spreadsheet reader function, store the data of each column independently into an array, and then execute the times and voltages using a for loop or while loop. If you have any suggestions for how to do this, or could provide me with a sample vi that can execute this type of program, which I am currently having trouble programming, that would be really helpful.
Thanks,
06-07-2018 11:51 PM - edited 06-07-2018 11:52 PM
Can use Spreadsheet file for table information, and use State Machine for Executing Different Voltage Levels with Different Intervals of Time. Which will be modular and scalable.
State 1: Initialize State 2: Read Spreadsheet File State 3: Set Voltage (i (Voltage) Index as specified in Spreadsheet array) State 4: Wait (i (Time) Index as specified in Spreadsheet array) State 5 :Increment i State 6: Repeat From Step 3 until Spreadsheet array completes. Exit
06-08-2018 02:45 AM
Hi PalaniveIT,
Thank you so much for explaining this approach to me. Although this is very helpful, I am a beginner in labview and do not really know what a state machine is or how to read files column by column and store their data into an array. Could you possibly create a vi for me to show me how to program these tasks? I would really appreciate it.
Thanks,
06-08-2018 04:15 AM
In NI Example Finder you can find State Machine Fundamental Example.
For reading Spreadsheet File use Read Delimited Spreadsheet Vi.
For Easy Approach, Split up the Program into smaller task and proceed with development which will help you to get precise answer for each query and even you will understand better.
Always try something by your own and for which get the help of Forum Enthusiast.