LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Create Dynamic Data Constant for Obtain Queue Function

 

Hi all,

 

I am trying to create a queue to pass dynamic data from one while loop to another... However, I cannot create a functioning dynamic data constant that I can wire to the obtain queue element data type input... See the example below with the broken wire....

 

As you can see, I have successfully wired a boolean constant to the element data type input of one obtain queue to share the stop button signal between loops...

 

How do I do the same for the dynamic data queue?

 

Thanks for any advice. 

 

Queue..JPG

0 Kudos
Message 1 of 19
(390 Views)

Hi jcannon,

 


@jcannon wrote:

Thanks for any advice.  


Two questions:

  1. Why do you need to wire DDT into a queue?
  2. Have you tried the ToDDT function?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 19
(374 Views)

I guess that Dynamic Data are too... dynamic for queues. You need to convert DD to a well defined type (Express -> Data manipulation palette).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 19
(369 Views)

Dynamic data is a LabVIEW monstrosity. It is not a real dataype but some sort of strange container that can refer to all sorts of data and usually when you try to convert it to real world data it may or may not convert in the correct way.

 

The only front panel control that supports this "data type" is the graph. No other control exists for it and accordingly no constant either. Generally use of Dynamic Data Type indicates a LabVIEW beginner, the same as Express VIs. They look nice and very handy until you try to actually program a real application. Then things start to spiral very fast downwards.

 

The closest to a Dynamic Data Type you can use for the queue would be a Variant. But a queue of variants will likely be the next cesspool you're eventually going to try to climb out of.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 19
(365 Views)

1. I have 5 x AIs (voltage) that I want to send to from a producer while loop to a consumer while loop.

 

2. Yes, I have tried the ToDDT function, which works, but that function still needs a constant wired into it. 

0 Kudos
Message 5 of 19
(355 Views)

I wouldn't use it (DDT), but if you feel lucky:

wiebeCARYA_1-1710503675528.png

 

Not tested at all, because I want to do as little as possible with DDT 🤣. I wouldn't even know if it works or not.

0 Kudos
Message 6 of 19
(349 Views)

Hi jcannon,

 


@jcannon wrote:

1. I have 5 x AIs (voltage) that I want to send to from a producer while loop to a consumer while loop.


Ok, that would be an array of 5 float (?) elements. Why do you need a DDT constant???

 


@jcannon wrote:

2. Yes, I have tried the ToDDT function, which works, but that function still needs a constant wired into it. 


Yes, sure: you need something to be able to convert it to a DDT wire.

 

As others have said: please explain why you need a DDT in the first place before starting to stuff such DDT entities into a queue!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 19
(336 Views)

Yes, I take your point... The .vi I am working on is quite a few years old and acquires data using the DAQ Assistant... I don't have time to re-write it using DAQmx functions and "better" coding...

0 Kudos
Message 8 of 19
(335 Views)

Hi jcannon,

 


@jcannon wrote:

I don't have time to re-write it using DAQmx functions and "better" coding...


Place a FromDDT after the DAQAssistent to convert the DDT wire into a common 1D array containing your 5 samples…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 19
(332 Views)

The dequeue element in the consumer loop cannot be wired to the write-to-file function if a DDT constant is not wired into the obtain queue element data type input (see the Data Queue).

 

And yes, the programming in the top loop is horrendous... Its needs to be rewritten as a state machine... A job for another day...

 

jcannon_0-1710504403991.png

 

  

0 Kudos
Message 10 of 19
(311 Views)