09-04-2024 02:02 PM
Hey fancy folk,
Question:
Is there a reason why casting a waveform array in a type deff cluster to a variant and then back to cluster then waveform array causes the waveform array to lose the Y array data?
Background:
I have some code that is running in a consumer producer loop where multiple producers (various part of my code) give the data to the same consumer. When I got to testing the code, I noticed that the waveform data being sent by my Ai producer loop (PS V, PS I, MTR Tq) to my consumer loop loses its Y array data. I then created a small scale version of the process as best I could and in the small scale version of things, there isn't an issue. I can't release the code, but I did take screen snippets of my relevant code along with the probes and text inside the probes for specific things. Below you can see these images.
Producer Loop
Consumer Loop
Probe 29 (ai data read from DAQmx as a 1D waveform being stored as a variant)
Probe 31 (element I am enqueuing and the corresponding text file contains things in the "Adtl Data")
Probe 35 (element dequeued by consumer and the corresponding text file contains things in the "Adtl Data")
Probe 32 (data after being casted back to a variant)
Proof of Concept VI that shows this works in a different VI
Solved! Go to Solution.
09-04-2024 03:05 PM - edited 09-04-2024 03:06 PM
Ignore me, I'm just bad at coding and the blank data is legit. I didn't look at the time on my probes and going back I realized that the blank data was 2 secs behind the probe data from my producer.
Just have to figure out why my codes not working like I expect, but at least that answers why my Y array was "being removed".
-Matt
09-04-2024 06:23 PM
This does not solve your problem, but it looks like you are doing a DAQmx Read every 10ms. That is too often. Makes your reads every 100ms. There is overhead with each read call and going too short will lead to problems in the long term.