LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Task out empty?

Hi,
 
I don't want to use the MAX to create an global channel/Task. I want the RT system to create the internal task and use it programatically. There should be no trace in the MAX at all.
 
Previously, I used to do the following under RT 7.x:
 
Initialize early in the VI execution:
  • create a DAQmx Task / Create channel
  • then have the DAQmx Start task execute.
  • I would usually take the  Task out reference and store into an Indicator.

then, within my VI's whenever I need to toggle a few Digital bits, I would use the Reference Indicator and just use DAQmx Write.

However, this is not working because the task returned out is always emptySmiley Sad  and get an error -200428 (Invalid task or virtual channel)

I noticed in a seperate VI that if I don't use an indicator and just wire in to the Task In directly it works. Why am I not able to store it into an indicator?

Regards,

Ashm01

 
0 Kudos
Message 1 of 5
(3,304 Views)

ashm01,

    In LV 8, you can use the project to create a Project DAQmx Channel. You can then use Variable to bind to that channel to read and write your data. This channel will not show up in MAX unless you export it to MAX. You can deploy the channel and the variable to the Target or to the host.

I hope this helps.
-Lorenz

0 Kudos
Message 2 of 5
(3,304 Views)
Hi lorenz,
 
I tried the same (Creating a Channel in the project)... However, it doesn't work. I checked the channel using the Daq assistant panel and the DO toggles.
However, if I use the same virtual channel within the Vi and write to it, it doesn't ... I know its strange.
 
Ashm01
0 Kudos
Message 3 of 5
(3,296 Views)

Hello Ashm01,

I am confused at how you are using an indicator to pass the task reference.  Can you post an example of this?  Are you using local variables?  If you are, it may be possible that the local variable is being overwritten by other portion of your code referencing it. 

Generally, the best way to pass information in LabVIEW is to directly wire the task reference to the input terminal. 

Regards,

Laura

0 Kudos
Message 4 of 5
(3,268 Views)
Hi ashm01,
If the indicator (the one loosing it's value) is on the FP of a reentrant VI, it could explain the problem (no memory is allocated for the FP of reentrant VIs, so controls/indicators loose their value between calls.)
 
Cheers.
When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 5 of 5
(3,260 Views)