LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you configure a shared variable as network published if the variable type you are sending is a DAQmx Task Name?

 

I'm new to LabView Realtime but have been programming in LabView for a while. I've modified the state machine wizard created program so that the target program performs a data acquisition read and passes the acquired waveforms back via the results shared variable. Had to modify the results.ctl to transfer a 2D array and then create a new shared variable "from custom control" so that I could return multiple samples from multiple channels. That worked.

 

Next, I transferred the initialization vi from the target to the host so that the end user could select the channels and channel set up they wanted.

 

Here's the problem: I have tried to create a shared variable to pass the DAQmx Task to the Target. I created a custom Control as above but the only option available to me under shared variable is the Single Process. Any attempts to create a custom variable type that is linked to a custom control with a DAQmx Task Name control gives an error: Invalid data type. Would you like to try another data type?

 

I thought passing the Task name would be more elegant than passing a cluster of individual controls. I will resort to this brute force method unless someone has a suggestion as to what I am doing wrong.

 

Thanks in advance.

0 Kudos
Message 1 of 4
(2,866 Views)

Sorry, you can't pass DaqMx Tasts across Devices,

 

You can pass channel names, Init, start, stop, reset, requests via an enum/shared variable.

 

A daqmx task (to my knowlege) is only valid on the target.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 2 of 4
(2,861 Views)

Thanks Timmar. I suspected this was the case after many attempts from various angles. I can now stop banging my head Smiley Happy

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

A DAQmx Task Name is basically a string - you can wire a string to any function that expects a DAQmx Task Name (try it with a DAQmx Task property node), and you can typecast a task to a string.  I'm not sure when you would want to share a DAQmx Task Name between systems - as already mentioned, the task itself will be local to the machine that created it - but if you can create a network shared variable containing a string, then you can use it to share a task name.

0 Kudos
Message 4 of 4
(2,843 Views)