06-02-2025 06:50 AM
Hello all,
I decided to refactor a code I was previously working at using Natt Sequences (https://forums.ni.com/t5/Community-Documents/Natt-Sequence/ta-p/3970582) as it felt it makes the code feel much cleaner and working much smoother than the flat sequences I used. However, I stumbled upon a little problem regarding the DAQ: I have one sequence that sets up the DAQ for data acquisition, then I have an actuall acquisition loop. In a flat sequence, connecting the two is straightforward - just connect the wires! But in a Natt sequence, it´s no longer that simple. For a while, it felt like a shift register would be the solution, but it didn´t work, since the data types are apparently of two different kinds:
"These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
The type of the source is DAQmx Physical Channel. The type of the sink is DAQmx Event (DAQmx,DAQmx Task Name)."
Any suggestions? I have attached the VI.
Thanks in advance for your help!
Solved! Go to Solution.
06-02-2025 07:13 AM
Hello,
I decided to refactor the code of a program I´ve been previously been working - I realized that Flat Sequences might not be the optimal solution and I wanted to learn new types of sequences. I understand that Stacked Sequences are a pain, and Natt Sequences seemed to be an interesting concept, so I started to learn them. Things were running ok until the moment I needed to start working on the DAQ, namely, when I need to recall DAQ arguments from the DAQ Setup sequence to a DAQ acquisition sequence. I thought that a shift register might do the trick (albeit it felt it didn´t make much sense), but it failed with an error message stating that the two data types were different. I also thought of creating a local variable and use it on the Acquisition sequence. But honestly, I wanted to know if there is a more robust way to do it.
I am currently working with LabView 2023 Q3 (32-bits) on a Windows 11 PC. Please find attached my VI
06-02-2025 08:33 AM
I don't see anything in this code that involves DAQmx. Are you sure you posted the right VI? Or is DAQmx hidden in the missing subVIs?
06-02-2025 08:57 AM - edited 06-02-2025 08:58 AM
Ups, my bad! Here´s the right version!
Also, thanks for merging the questions - I posted an earlier one, and I was unable to find it posted anymore - not even in my profile, so I reposted again.
06-02-2025 09:36 AM
You're close. Check the help for Create Virtual Channel, you send Physical channels in - and get a DAQ-task out, those are not the same. That task should go to a shift register and be used in the other cases.
06-02-2025 09:39 AM
Your problem is you are trying to use the Channels data to hold your task. You need another Shift Register to hold the task.
06-02-2025 09:52 AM
That made the trick! The VI is now valid. Thanks a lot for your input! Let´s see if everything else runs fine 🙂
06-02-2025 10:01 AM
Remember to wire the Task through all cases, else it'll be nullified.
06-03-2025 02:41 AM - edited 06-03-2025 03:05 AM
There´s still an issue I haven´t quite worked out - the data inside the loop is there, and I can see it. But when I extend the outside the loop, it gets lost. Is it still a wiring issue? Am I choosing the wrong tunneling scheme?
I´ve uploaded the updated VI in this reply.
UPDATE: Apparently concatenating the data does the trick. I don´t understand why it didn´t work the first time I did it, but it is now working and the data sets are identical.
06-03-2025 04:52 AM
I'm guessing you had a "Last value" exit from the loop. Concatenating is a simple way to solve it. 🙂