08-18-2014 05:05 PM
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?
Thanks
Solved! Go to Solution.
08-18-2014 05:19 PM
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?
Lynn
08-18-2014 05:21 PM
08-18-2014 05:32 PM
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.
Lynn
08-18-2014 05:52 PM - edited 08-18-2014 05:53 PM
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
08-18-2014 06:01 PM
Is the sample time interval fixed or does it vary? If it varies, what controls the change?
Lynn
08-18-2014 06:03 PM - edited 08-18-2014 06:04 PM
it is fixed at 100 ms
08-18-2014 06:16 PM
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.
Lynn
08-20-2014 10:25 AM
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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord