LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acquisition.lvlib hardware refnum configuration

I apologize for a newbie question stemming from my first, simple LabView project. I'm an experienced s/w programmer in general, just new to LabView.

 

Objective:

  • (initial) Capture the serial ASCII data streams from a GPS-disciplined oscillator and display to the user.
  • next: Log data to storage. Start a new log file at midnight GMT each day.
  • last: Add UI to display health/status of the oscillator to the user.

Background & approach:

  • The oscillator communicates with a Mac mini via a USB port.
  • I'm basing the solution on the Continuous Measurement and Logging prototype project.
    • There is only one direction of data transmission: from the unit to the computer.
    • The unit transmits a line of ASCII text once per second.
  • NI-VISA Configuration sees the USB data source properly.
  • NI MAX shows:
    • VISA resource name: ASRL1::INSTR
    • Port description: ASRL1
    • Port binding: /dev/cu.usbmodem1471
  • NIvisaic can read data from the unit correctly.

Hooray so far! 

 

Problem:

  • Documentation for the project prototype states: "Add hardware refnums to Acquisition.lvlib:Hardware Configuration.ctl. For example, you can use the following objects here:
    • DAQ tasks
    • DAQ channels
    • VISA sessions"
  • I can't figure out what the hardware refnum is (or where to find it) for this ASRL1::INSTR data source.
  • More generally, LabView documents have left me rather confused about how to modify acquisition.lvlib/hardware configuration.ctl.

 

What's been tried:

  • "Hardware refnum" does not yield useful search results in either the local or on-line LabView documentation.
  • I have read through a data acquisition white paper as well as the docs included with the prototype Continusou Measurement and Logging project. The 2010 Data Acquisition Reference Application white paper was also reviewed. Unfortunately, these gloss over the specifics of configuration.
  • Internet searches for "LabView hardware refnum" and similar topics (with and without data acquisition) have yet to yield useful results.
    • One site mentions using the Project Installer to import the hardware configuration information from NI MAX — but was specific to Windows. An equivalent capability did not seem to exist in today's Mac environment.

 

I'm a bit embarrassed but feel like I'm just missing one or two key pieces of information that I haven't been able to find — either an analogous example, or a snippet of tutorial information on hardware configuration.vi.

 

Any suggestions or pointers to further information would be very much appreciated!

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

Okay, so I've never used this example project but it writes quite a bit of boiler plate for you. How nice is that! So I've found where you're referring to the refnum. I don't know what hardware you are using (I thought I'd be able to figure out from "usbmodem1471" but google doesn't return anything obvious) but the easiest way to find out how to reference your device is plop a visa open vi (ctrl+space, type visa open) onto your block diagram. VISA open probably belongs in Initialize Hardware References.vi. Next, create a control for VISA resource name input. Next, drop down that control and it should be populated with all the devices you see in NI max that are compatible with visa which I think this seems to be. I bet you will see one that is the same as that port binding you listed. Anyways, this resource control could be used inside of the Hardware Resources cluster replacing the string that is currently there. But a fun fact, a string control coerces to a resource sink, so you can actually wire a string right to visa open also. Then you don't need to change anything about the control. However, visa resource controls are a bit easier to use when trying to enumerate visa resources, so there is that.

 

For now, you need to make sure that you put the port you choose in the cluster in Acquisition Message Loop. However, long term, you normally load this from a file. So instead you will replace it with something that reads from an ini file or similar. Modifying the control has two parts. One part has to do with it's structure. To modify the structure of the control, you can find the control on the block diagram or front panel, right click, and then open Type Def. You can then add or subtract controls from the cluster. Save and apply your changes, and those changes will show up everywhere in the project. You can also change the value of each instance of the type defined cluster, such as the one on the block diagram of Acquisition Message Loop. If you double click the icon for the control, it will change to mode where you can edit the values that the constant currently has. This can also be done by right clicking the icon and selecting the "View Cluster as Icon" item in the drop down.

 

Note that if you search #CodeNeeded inside a vi across the whole project, you'll note you need to put code in a lot of places to get this to do something useful. Lemme know if you have any more issues. Definitely continue reading all the labview introductory documentation to learn more about labview basics (such as clusters, type definitions and visa vis).

 

Also, what languages do you have experient with?

0 Kudos
Message 2 of 5
(4,188 Views)

Thank you for taking the time to look into this. I'll work on your suggestions & keep this thread posted.

 

My s/w language experience includes Javascript, Python, Ruby, C++, C, a bit of Java, Basic, Fortran, a variety of assembler-level languages (microprocessors through mainframes), and probably some other things I've forgotten to list.

 

The specific hardware is described here. No one has written a vi specifically for it.

 

I have a Github repo (presently private) for this project. Once I get it working (or to a point where it's worth looking at code), I'll make the repo public and post a link to this thread as well. Perhaps at some future date someone else will find the thread and repo useful.

 

— Eric

0 Kudos
Message 3 of 5
(4,172 Views)

Awesome. I recommend you start out with an example. There is an example that ships with Labview called Continuous Serial Write and Read. This is a good starting place to make sure that everything is working.

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

Great minds think in similar ruts. I just built a working skeleton around that same example this morning. It was great to see the expected data populating the screen!

 

Thanks again for the help!

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