I have a PCI controller card connecting to some servo drives, DAQNavi assistant running on LabVIEW 2011.
This is exactly what i'm trying to do:
I have a txt file containing some numbers. I want LabVIEW to open this txt file, read the numbers one by one and input them to PCI card at sample times. for example for sample time of 100 ms, it have to read 10 numbers and give them to PCI card during 1 second.
Any ideas on this?
Solved! Go to Solution.
This should be straightforward. What parts are giving you trouble? Reading the file? Converting the data to numbers? Writing it to the DAQ? The timing?
You will learn more if you try to do it yourself and ask specific questions as you encounter difficulties.
Start by writing a VI which opens the text file and converts the text to an array of numbers. When you have that working (which can be done in the time it takes me to type this message), then you can move to the next step.
I'm done with this part. I just dont know how to make LabView to put the elements of the array to output at time samples respectively
Easy. Put the write to the servo controller inside a for loop. Include a 100 ms Wait (ms) function. Wire the array from the outside of the loop to the data input of the write VI inside. The tunnel will automatically autoindex. That means that the data will be written one point at a time, every 100 ms, until every element in the array has been written.
You may want to add one more write after the loop to set the servo back to a default value before stopping the program.
If you are looking for some free LabVIEW training try some of these.
3 Hour Introduction http://www.ni.com/white-paper/5243/en/
6 Hour Introduction http://www.ni.com/white-paper/5241/en/
LabVEW Basics http://www.ni.com/gettingstarted/labviewbasics/
Self Paced training for students http://www.ni.com/academic/students/learn/
Self Paced training beginner to advanced, SSP Required http://sine.ni.com/myni/self-paced-training/app/ma
LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_L