11-08-2012 06:39 PM
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.
11-08-2012 11:00 PM
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.
11-08-2012 11:08 PM
Thanks Timmar. I suspected this was the case after many attempts from various angles. I can now stop banging my head
11-09-2012 01:50 PM
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.