08-29-2011 01:28 PM
I need to create an array that has a format in binary, how should I do it in labview.....Iam using an indexer....and it has an input of an 1 dimensional array. How should I create that.... here is what Iam asked to do
"A 1 dimensional array (lookup table) of control codes. the motor has four coils, there will be 8 different codes for half steps.. We will use one array and obtain the value of this array using an index. The index itself depends on the step mode and direction of rotation. The codes in the array should be written in Binary.."
How should I do it
08-29-2011 01:43 PM
Wild guess:
1) enum to define unique "step mode" and "direction" combinations
e.g. 0= mode full step CW; 1= mode full step CCW; 2= mode half step CW; 3= mode half step CCW; ... ... ...
2) 1D array with binary data according to the enum values described above
3) Using the "Index Array" vi to get the desired binary code
Like I said, just a guess... ... ...
08-29-2011 02:32 PM
no here is the problem
I have a unipolar motor, that has 4 coils
these are sequence of binary codes that I need to output
1010
1001
0101
0110
So i need to create this one dimensional array as looktable table and connect the output of this to the indexer..
how will i need to do this.
08-29-2011 04:10 PM
Why not make it a 2D array and write the 1D array to the port or series of outputs? Digital ports on DAQmx devices can handle a few lines.
See attached VI.
08-29-2011 07:17 PM
Thanks a Lot that really helps,, I appreciate it
08-29-2011 07:26 PM
Ok now to connect the array values to the daqmx data lines....when I connect it,,, it says that they are of different data type what should in the datatype for the DAQmx...so that it can accept boolean values
08-29-2011 08:27 PM
Ok well here is the attached VI i have....i need to increment to decrement the array based on the user selection
08-31-2011 04:04 PM
SK0480,
Here is something that should prove useful for your project. Navigate to Start»All Programs»National Instruments»NI-DAQ»NI-DAQmx Help. This should help you learn how to use DAQmx. Another great tool is the Find Examples portion of the help in LabVIEW. If you open LabVIEW, click on Help on the toolbar at the top, and click on Find Examples.. here there are many an example for all sorts of projects. For example, if you click on the search tab and type in "daqmx write" then there is an example titled "write dig chan.vi" which demonstrates how to write values to a digital output channel. For more useful examples, click on the browse tab and navigate to Hardware Input and Output>DAQmx>Digital Measurements. This should help you get started with writing to DAQmx.
Regards,
Renee
Applications Engineer
National Instruments
08-31-2011 07:22 PM
First make sure your controls are clearly defined. Start/Stop doesn't indicate which position is which. Use top and bottom labels. You have no way of reading from the array because you are stuck in a while loop until the Start/Stop switch is activated. Adding a delay in your while will prevent LV from bogging down your processor. I don't believe you need all the logic within the for loop, so I included an indicator on the fp for the indexed 1D arry. It looks like that is what you are looking for. You just want to index the row to output the proper nibble, correct?
08-31-2011 10:15 PM