LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert DAQmx task ID into a string

Solved!
Go to solution

I'm using LabVIEW to perform some DAQmx analog generation, and I'm calling my LabVIEW code from CVI via a dll.  I'd like to make two separate calls, one to start a DAQmx task, and one to stop the task, so I need to either:

 

1) Pass a DAQmx task ID to CVI and then back to LV

or

2) Convert the task ID to a string, pass it to CVI and then back to LV, and then convert it back to a task ID in LabVIEW.

 

I'm pretty sure option 2 is the easier option, but I'm not sure how to convert back and forth between a string and a DAQmx task ID.  Can anyone help with this?

 

Thanks,

Joe

0 Kudos
Message 1 of 5
(4,064 Views)

I don't think you need to do either one, actually... I'm pretty sure you can save data in a functional global variable (or, for that matter, a standard global variable, which might be reasonable in your case) within an instance of a DLL.  That way you can keep the DAQmx Task strictly inside the DLL, no need to expose it to your CVI code.  The Start Task call will store the DAQmx Task, and the Stop Task will read the global to get the task name and stop it.

0 Kudos
Message 2 of 5
(4,062 Views)
Solution
Accepted by topic author JoeDG

While Nathand is correct, It is fairly easy to convert from/to DAQMX Task and String.  Both shown below

daqmx.png

Hmmmm Is the note Expected or a bug?????

 

We'ld probably need a DAQmx expert to answer that- I THINK it might be related to DAQmx autocreation of tasks


"Should be" isn't "Is" -Jay
Message 3 of 5
(4,058 Views)

Thanks a lot - both of you.  I guess I assumed that the VIs in the dll wouldn't stay in memory, but I guess that makes sense.   

Much appreciated!

-Joe

0 Kudos
Message 4 of 5
(4,038 Views)

Thanks a lot - both of you.  I guess I assumed that the VIs in the dll wouldn't stay in memory, but I guess that makes sense.   

Much appreciated!

-Joe

0 Kudos
Message 5 of 5
(4,037 Views)