Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically setting voltage range for channel on CompactRIO analog input module (NI 9205) with scan interface

Hi all,

 

is there a way to set the input range of a channel on my NI 9205 with LabView using the scan interface (i.e. not FPGA interface)?

 

I found http://digital.ni.com/public.nsf/allkb/32C533AF9AFAF3B38625746E004A510F but that only seems to be valid for FPGA modules...

0 Kudos
Message 1 of 8
(4,049 Views)

right click on module listed in the embedded target in the project, select properties

0 Kudos
Message 2 of 8
(4,017 Views)

Thanks, but first word of the header: "Programatically"!

 

I want to change the voltage range on the fly from a running .vi.

(To be precise the user should be able to set them via a simple config file that's read on startup)

0 Kudos
Message 3 of 8
(4,003 Views)

Patrick

 

I just setup a quick project and looks like property is there. Is this what you looking for?

I'm only setting one channel but you can set all of them.

 

Capture.PNG

 

Miro T

National Instruments

Message 4 of 8
(3,977 Views)

Yes, that's exactly what I was looking for. I just confirmed that it's working and is correctly changing the  voltage range at runtime. Thanks!

 

Detailed steps to get to what's in  Miro_T's screenshot:

  • In your LabVIEW Real-Time Project expand your chassis
  • Drag and drop the module for which you want to change channel settings into your .vi (this creates a refnum)
  • Rigth click this refnum and choose "Create"
  • You can now select a property / method for which to create a property / invoke node.
  • If you selected a voltage like in the example above you can then right click on the unconnected terminal and choose "Create -> Constant" to get a selection of the valid values.

 

To be honest I think it's virtually impossible to find this if one doesn't already know where to look (like so often when using LabVIEW). @NI Maybe add yet another KnowledgeBase article with nice step-py-step screenshot instructions? The lack of proper documentation otherwise makes it unnecessarily hard to get such trivial things done...

0 Kudos
Message 5 of 8
(3,964 Views)

Well, seems this is not fully solved yet:

Consider I have a refnum to the channel I want to set the voltage range on, e.g "ni.var.io://localhost/Voltage/AI15".

How do I set the voltage range of this specific channel *programmatically*?

 

In other words: How do I select the required property node programatically?

I can do that now with the steps described above using the UI, but i still have no idea on how I could get this property node dynamically.

0 Kudos
Message 6 of 8
(3,932 Views)

Not sure if I understand your question completly... but why cant you just call the property node in your code? 

0 Kudos
Message 7 of 8
(3,882 Views)

Or are you asking how to create refnums dynamically? If so, see this help document

https://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/usingdynvarapi/

0 Kudos
Message 8 of 8
(3,877 Views)