LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx task as a Project shared variable

What data type do I use when defining a shared variable for a DAQmx task name?

I have tried String, but when I use the shared variable that I call 'Digital IO Task' in a subVI, I get the following:

 

Error -200088 occurred at Main Panel.vi

Possible reason(s):

Task specified is invalid or does not exist.

0 Kudos
Message 1 of 4
(3,218 Views)

Hi GretchenSkelly,

 

I believe that you can configure shared variables with NI-DAQmx global channels and NI-DAQmx local channels as stated in this article, but we cannot bind them to NI-DAQmx tasks. I tried with both variant and string data types and it kept showing an error. However I tested with strings with the code below and it seemed to work. I was able to see the value in the shared variable with a shared variable read node and in the Distributed System Manager (DSM). Are you able to see the shared variable update in the DSM?

 

shared variable image.PNG

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

Amezam,

there reall is no need to gyrate a DAQmx Task IO through a flattened string.  Scan to string pulls "DAQmx Task.Name" just fine if the coersion dot offends your style guidelines.

!0.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 4
(3,179 Views)

Thanks for both replies.  I ended up using Global Variables.  I hadn't used globals for years.

But that seems to have solved my problem of passing DAQmx Task Names to subVIs.

Gretchen

0 Kudos
Message 4 of 4
(3,161 Views)