LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating FP during hardware timed AO write

Spoiler
 

Using NI 7172 chassis with NI9263 and NI9265 AO voltage and current cDAQ modules. I am trying to update the front panel while a hardware AO write is being performed. I have the data in a 2d arrary and I am using the samplewritten properly node. My idea is to somehow use the property node to multiply each time it increments, times the first value in each array to make a software representation of the data and feed back to my front panel. All this works except I can't figure how to strip out the value I need for each of the 4 arrays (4 voltage and 4 current) to use to multiply by the sampleswritten node. There are three vi's.  Test sequencer contains the values to be written to the modules, AO Setup builds the data for the hardware write and AO write will write the data and feed back as it is writing, the values to the front panel on Test sequencer. Hope this is not to confusing.

0 Kudos
Message 1 of 4
(2,119 Views)

Hi bassinbc,

 

I have been looking through your code and some of it is a bit confusing. In your AO Write subVI you use the Call chain and get a VI reference just to change the values of two indicators on the front panel of the calling VI. Since you are updating the values in a loop in the subVI I can understand why you didn't use the connector pane to pass values out of the subVI, but I would recommend passing a reference to the subVI and then using a value property node to change the values of the indicators.

 

Regarding your question, I am not sure I understand what you are looking to do. You are trying to take a value from each of four arrays every time TotalSampPerChanGenerated increments and display that on your front panel? What four arrays are you talking about? Can you give an example of what exactly you want to achieve with this?

 

Also, is your DAQ writing working correctly?

 

0 Kudos
Message 2 of 4
(2,098 Views)

Thanks, the DAQ is working correctly. I have 4 channels of Voltage and 4 channels of current data feed to the write. I said arrays and should have said two arrays with 4 rows each. I would like to  have each value from the arrays display on the calling vi front panel. This would repersent the data feed to the write (8 channels of data). I don't believe this is possible so I was tring to use the TotalSampPerChanGenerated and multiply that value times the amount of each increment in each array. Then I would have to have the starting value and add to that. I have an alternative. It would be to simply show on the front panel of the calling vi the percent complete of the write. I have already done this and while it isn't perfect it works and give a visual indication off the write.

 

As far as using the connector pane to pass values out, I didn't know you could pass values out of the write loop to the front panel of the calling vi while the loop was incrementing. Is that a better way to update the calling vi in real time?

0 Kudos
Message 3 of 4
(2,078 Views)

Sorry I think there was a bit of a misunderstanding. You cannot pass values through the connector pane while the write loop is running. I meant that you could pass values in to the subVI that are references to your two controls that you want to update. For example, in your subVI, instead of your call chain and VI references, you can use control references. In your main VI, create references to the Voltage Ind and mAmps Ind and pass it into the subVI, then you can set the values using property nodes (see image). Note - this image does not run, it is just showing you how to set it up in a similar format to what is in your code.

2011-12-06_113834.png

This has the added advantage that it will still work if you change the name of your controls in your main VI.

 

With regard to your issue about displaying certain array values on the front panel of your calling VI. You can do that using more control references, or you can use shared variables to pass the data between your subVI while it is running and your main VI.

 

My recommendation would be to break your subVI into two parts, a DAQ initialization subVI (everything before the loop) and a DAQ write subVI (everything in the loop). That way you will not have a loop in your subVI, there will just be a loop in your main VI around the DAQ write subVI. If you do that you can pass all the values using the connector pane and you don't need to use references or shared variables at all. Let me know if that helps!

0 Kudos
Message 4 of 4
(2,070 Views)