ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using hardware refnum (refnum type is string)

Hi,

 

I want to implement my DAQ hardware into my DQHM design and for that, I need to initialize my hardware. Normally, I do it like this:

mw42_0-1635522599716.png

 

But here, I have to use a string for my "HW refnum" (this example is from the CML DQHM example). I don't understand how to do that.

mw42_1-1635522671592.png

 

Would someone please be so kind as to enlighten me?

Thank you

mw42

 

0 Kudos
Message 1 of 4
(1,766 Views)

We cannot help with what we cannot see.  Instead of attaching a picture (very tiny type) of a small (and possibly irrelevant?) part of your DQMH, please compress the Folder that contains your LabVIEW Project and attach the resulting .zip file, along with a note telling us where to find the code you want us to examine.

 

Bob Schor

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

Hello Bob,

 

thank you for your reply. I do apologize for my previous post with so little usable information.

 

Please find attached a .zip file containing both the "CML DQHM Project" and the VIs with my usual "acquire data from cDAQ" code.

 

To specify the problem: There are a couple of VIs in the CML DQHM project folder (Modules -> Acquisition.lvlib -> HW calls) where I need to initialize my real hardware (see picture below):

mw42_1-1635767297482.png

 

 

 

The "Initialize Hardware References.vi" looks like this:

 

mw42_2-1635767402697.png

 

 

My code uses the "DAQmx Create Task.vi" and the output is of type "DAQmx event".

mw42_3-1635767906201.png

 

I already placed my code in several Sub-VIs so I would be able to implement those in the "Initialize Hardware Reference.vi". But how would I do that while the refnum type being "String" instead of "DAQmx task"?

 

Please find all necessary code attached. I do hope that I was able to clarify my problem.

 

Thanks

0 Kudos
Message 3 of 4
(1,684 Views)

I went ahead and implemented my code but I get an error:

mw42_2-1635791169794.png

 

 

 

I attached the project with my changes, also here is what I changed in two modules:

 

 

1) In the "acquisition.lvlib > HW Calls > Initialize Hardware References.vi"

 

mw42_0-1635790880943.png

 

 

2) In the "acquisition.lvlib > HW Calls > Acquire.vi"

 

mw42_1-1635790965608.png

Note: The SubVI in the error message is this one here (with the number 5 in the label)

 

0 Kudos
Message 4 of 4
(1,671 Views)