01-09-2012 05:05 PM
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
Solved! Go to Solution.
01-09-2012 05:11 PM
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.
01-09-2012 05:21 PM - edited 01-09-2012 05:24 PM
While Nathand is correct, It is fairly easy to convert from/to DAQMX Task and String. Both shown below
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
01-10-2012 07:52 AM
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
01-10-2012 07:52 AM
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