LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Assistant to typedef data cluster

Hi All,

 

I was hoping someone could be able to shed some light on an issue I have been pulling my hair on for a week now.  I am recently new to LabView (less than 6 months), and up until I have been able to locate/research any issues I had ran into.  The problem I'm having is as follows:

 

Basically, I am using an SCXI-1581 and an SCXI-1102B (along with multiple other pieces of hardware) for a device we are creating.  Generating the signals with the DAQ Assistant was quite simple.  The problem I am running into is finding a way to relay these signals to an array or cluster, so that multiple other subvi's can quickly just "Unbundle by Name" to wire to their specified indicators on each page.  I have tried arrays, clusters, typedef's, etc to no avail and I'm not sure where else to look for help.  Unbundling the typedef cluster onto the subvi's works like a charm, the problem is the typedef ctl is not getting any data sent to it so the indicators on the SubVI's never receive a value other than the 0 located in the cluster typedef.  If there is a better way to go about doing this I would sure appreciate the help. 

 

Breakdown:  I have 41 thermistors being generated from the DAQ Assistant.  I need to somehow convert this data into a form where it will be able to be constantly updated and read from a typedef/global/something.  I have taken a screenshot of what I was working on when I decided to post here.  There are broken wires atm, because I was trying everything I could think of.  Signal Manipulation/From DDT, Array to Cluster, Build Cluster by Name, Build Array, numerous things.  I basically want all 41 thermistors to leave the DAQ Assistant, be split by channel name/value, and input into an array or cluster that can become global.  I have broken it down to 4 channels in my screenshot for simplicity's sake.

 

My apologies for repeating myself or running on, I'm working on very little sleep at the moment 🙂

 

I appreciate any help anyone can shed on the situation.  Thank you!

 

-Justin

0 Kudos
Message 1 of 10
(3,275 Views)

You can do a few things here. You could use a shift register and stor your data there. If you are moving data between loop this will not work.

 

You could make an event that processes the data and sends it to the other loop. You still need to make an event store the data.

 

Something else that is very useful is a global variable or action engine. See this nugget by Ben. It is very informitive on how to store and use data anywhere in your code.

 

http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801

Tim
GHSP
Message 2 of 10
(3,265 Views)

Looking at you snapshot, the problem you have is that you've used a Bundle By Name function, but not provided the type (the input into the top of the bundle function). If you provide a default datatype input here the bundle by name will properly bundle the content for you (presuming the "Cluster" indicator has a matching datatype).

 

(Hint: if you create a local variable to the indicator and wire it into the bundle by name function, their datatypes will always match)

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 10
(3,253 Views)

I didn't have it connected in that particular screenshot but I have tried that before.  I just redid that scenario and took another screenshot.  Bringing a cluster typedef and dropping it in, switching to indicator so it will allow an input, and changing the Original Cluster Visible property to FALSE (just so two clusters of 4 Numeric Indicators are not visible).  Using the attached screenshot, the numeric values do update (on the front panel of this VI), but as soon as I connect that typedef to another VI and unbundle, those values do not populate on the subVI.  I changed the DAQ Assistant in this current example (to test)  as I am at home and do not have the 1581/1102B hardware here with me. 

 

I will note that I do have this functionality working on another section of the GUI I am working on.  This working portion has 8 Boolean values in a typedef cluster and is exported and unbundled in the same manner as I am trying to get working with these data values on the subVI.  The way that the values get sent to the typedef is different but overall the same way that I would like to aim for on the DAQ_Cluster2 image.  Two screenshots enclosed this time.  I can go into much further detail if necessary.  Thanks again for the feedback.  I'm going to knock out some more of the pages involved for now, if anyone has any more feedback that would be fantastic.

 

Also aeastet thank you for your reply as well.  I started reading through your link to Ben's nugget but my brain is mush right now and I am not too familiar at all with some of that functionality.  I will look back at it more soon.

 

Thanks again!

Download All
0 Kudos
Message 4 of 10
(3,246 Views)

Im confused. That of which you talk sounds simple enough. Can you post a quick example (code) that demonstrates your problem please? Pictures are good, but not enough here.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 10
(3,232 Views)

My code has 1 Main VI and about 15 subVI's that are loaded/controlled through the main vi.  I can try and build a separate example, but basically I need one of the subVI's to send the DAQ Assistant data to a global/typedef that can be exported/unbundled onto another subvi that is a simple infinite loop with indicators.  Ill try to put together a 3 vi example but it really shouldnt be too hard to explain, if I can try to help explain that.

0 Kudos
Message 6 of 10
(3,219 Views)

Hi oNighto,

 

"but as soon as I connect that typedef to another VI and unbundle, those values do not populate on the subVI."

It's not enough to use the typedefinition: as it's only a definition it will not magically transport data from one VI to the other! You have to use (functional) globals or other means to transport data to other VIs...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(3,213 Views)

@GerdW wrote:

Hi oNighto,

 

"but as soon as I connect that typedef to another VI and unbundle, those values do not populate on the subVI."

It's not enough to use the typedefinition: as it's only a definition it will not magically transport data from one VI to the other! You have to use (functional) globals or other means to transport data to other VIs...


oNighto has been using LabVIEW for 6 months, I had assumed he knew this. If he is only using typedefs to attempt to transport data then this now adds up!

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 8 of 10
(3,211 Views)

That may explain the lack of data transport then.  I was able to get it to work with simply a global cluster of 8 Boolean values so I had assumed this would work with a cluster of numerics as well.  I am by no means very knowledgeable I have just been learning as I go.  So I have one SubVI with 8 Boolean toggles dropping their reference values into a cluster global of 8 boolean toggles, and I can unbundle these clearly onto the other subvi, but I was looking for a more memory manageable option so I started looking into typedef.  I can only assume this is where I went wrong.  I will try dropping the values into a clustered global of the thermistors instead of simply a typedef and let you know how that pans out.  I thank you all for your responses. 

0 Kudos
Message 9 of 10
(3,207 Views)

It appears for now it is working properly.  I can pass the data through the global cluster, albeit it slows the application down.  Now on to figure out how to split the daq signals accordingly by channel 🙂

 

Thank you all for your responses and expertise.

 

 

0 Kudos
Message 10 of 10
(3,188 Views)