07-20-2013 01:00 PM
Hello,
as a Java Programmer I like to programm in the object orientated manner.
I have more than 50 valces to manage and established a state diagramm.
So if the value is true or one in the matrix in row 52 of a column definig the operation type then I would like to set the valve 52 to "open".
Therefore I would like to put all devices of type valve in an array and start the corresponding valve.at index 52 of a device array in a for loop.
I have not hardware yet but I probably want to use the DAQ unit of NI.
Will it be possible to program it in this way?
Thanks very
much
Thommy7571
Solved! Go to Solution.
07-20-2013 01:21 PM
Yes you can do this. You would just use Index array to break out the value of a particular column, row, or individual element of an array.
You can also use auto-indexing of an array in a For Loop to be able to act on every row in a 2-D array, or every element in a 1-D array in turn.
07-21-2013 01:34 AM
Hello,
thanks, but as I have no valves and no NI hardware yet I would not only like to know if I can make an array of devices
but also if it is possible to act on each device of this array to get the signal, work on it, open it etc.
Do you have an example somewhere to show me (or a link)?
By the way if I create an array and use it with this index component to act on one element this did never work yet..
Even if the dimensions are equal I get an error:
error: trying to connect a 2D array of type "boolesch" to 2D array of "invalid".
the same if I want to initialize one.
I don't see any possibility to adapt or define the type of the element
in an array for all elements at once. How must I do it?
I will have the same problem with the device array.
Thanks veryx much.
Thommy7571
07-21-2013 02:06 AM
@Thommy7571 wrote:
By the way if I create an array and use it with this index component to act on one element this did never work yet..
Even if the dimensions are equal I get an error:
error: trying to connect a 2D array of type "boolesch" to 2D array of "invalid".
the same if I want to initialize one.
I don't see any possibility to adapt or define the type of the element
in an array for all elements at once. How must I do it?
I will have the same problem with the device array.
That description makes no sense. Can you show us your code instead?
07-23-2013 03:14 AM
Hello,
I solved the problem with the array. I will do another posting for a similar but different subject.
Thanks
Thommy7571