LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cluster- array indexing channel number on DAQ

Plz Help............ I have a VI which selects the channel to acquire from on a DAQ, using the FP buttons in a cluster that indexes out the channel number..

1) If i click individual button in the cluster(will stay switched since color has to be seen), it gives out
the index of the element which i want to give to a daqmx or DAQ assistant as a channel number to acquire data from, and displayed on
graph above here.

Ex: if 45 is pressed in the cluster, its index 42 shall be used to activate the number 44 channel on the DAQ.
note: only 60 channels are used E0-E15 are Extra and not used, i just put them there since i wanted the channel numbers
indexed out as per my wiring configuration. in essence only the buttons which appear as the layout  above are used.

if Select ALL is pressed all channels should start acquiring  and pop up the other VI attached,
it has 64 waveform graphs on FP.

Also be able to write the individual and all data to file as lvm or excel.

 

I kind of have an idea how it should work but have trouble implementing it. in my program the array indexes out the value if i just used the search in array for True, but when i try to use cluster property to set all buttons to true when "Select all "pressed in a case structure, it cannot read individual buttons when "select all" is false..

 

any ideas plz

Download All
0 Kudos
Message 1 of 4
(3,738 Views)

Hi,

 

you should try to program your code 'event driven'.

 

Here is an example of your selection dialog:

channel select LV8.2_BD.png

 

Here I use some techniques that might help you. First I compare the old an new value of the cluster (as an array) with a XOR function to detect the actual clicked button.

In the second frame (ALL, value change), I create an array with the actual value of the 'ALL' button of 76 elements. By using the button value it can be used to deselect everything. And I replace the first 16 buttons (Exx) with a False. Then I convert this to a cluster (right click on the Array to Cluster node and select 'Cluster Size...' to adjust the actual cluster size.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 4
(3,732 Views)

Thanks very much TCPlomp , your suggestionreally helped me and i tried to implement more using it, but i am still having problems with the code i wrote, any help/changes much appreciated.

 

Problems:
1) I am using the single/multiple button to
    get multiple values into array and get all the channels in that array to
    start acquiring but in multiple case i need only the true values in the cluster
    to be outputted so that only yellow/on button indexes would start acquiring.

2) also in any case, the data acquisition loop hangsup while waiting to read the
    concatinated string: value change and doesnot update as opposed to loop 3 which
    will be used to update the channel and get live data
--my DAQmx code is also messy, i am trying to stop when string value changes and
   start acquiring from new channel but gives errors...

 

i have to be able to programmatically select channel name and display that acquisition on the graph live, if multiple case, show all selected acquisitions on a graph or individual graphs.

 

Thanks in advance..

0 Kudos
Message 3 of 4
(3,711 Views)

The code in the event structure in the lower right loop will never run.

 

First, why do you have an event structure there?  It has nothing wired to the timeout node which means it is the default of -1, or "never time out".  Thus the code will freeze right there waiting for a timeout that never occurs.

 

Make sure you wire up the error wires in you DAQ functions.

0 Kudos
Message 4 of 4
(3,698 Views)