LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array

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

0 Kudos
Message 1 of 17
(3,988 Views)

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... ... ...

0 Kudos
Message 2 of 17
(3,983 Views)

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.

0 Kudos
Message 3 of 17
(3,968 Views)

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.

Download All
0 Kudos
Message 4 of 17
(3,952 Views)

Thanks a Lot that really helps,, I appreciate it

0 Kudos
Message 5 of 17
(3,934 Views)

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

0 Kudos
Message 6 of 17
(3,932 Views)

Ok well here is the attached VI i have....i need to increment to decrement the array based on the user selection

0 Kudos
Message 7 of 17
(3,927 Views)

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

Regards,

Renée M
Applications Engineer
National Instruments
0 Kudos
Message 8 of 17
(3,864 Views)

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?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 9 of 17
(3,844 Views)
Yes thats correct but dont know how
0 Kudos
Message 10 of 17
(3,832 Views)