Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring Virtual Channels for LabVIEW Real-Time Waveform Acquisition and Logging (NI-DAQmx) Sample program

Hello,

 

I have PXI-1042, running Real Time OS. This is connected to a SCXI-1001 chasis. There are several strain gages connected via SCXI-1520.

 

I am trying to use " LabVIEW Real-Time Waveform Acquisition and Logging (NI-DAQmx) Sample" program.

 

It has a "configuration file generator.vi" tool. There is a section to enter channel names.

 

If I enter physical channel names here, program works. However, I only get raw data, which does not work for me. I am creating virtual channels with all the configuration on real time module. However, when  enter those names program does not work.

 

Any ideas what I am I doing wrong?

 

I attached my configuration. Shows physical channels and virtual channel I created.

 

Thanks!

Erden

 

 

0 Kudos
Message 1 of 9
(6,087 Views)

 Hello ErdenV2,

 

When you say that your program does not work, what exactly is not working? Are you receiving a LabVIEW error when you run the program? Is the data you are reading incorrect? Is the data being read at all?

 

Regards,

 

J_Bou

 

0 Kudos
Message 2 of 9
(6,066 Views)

Hi J_Bou,

 

Sorry for the late reply.

 

When I enter virtual channel names, program does not run. Actually it runs for a couple of seconds and stops. I cannot read any data from the PC side.

 

Is there a proper way to create or enter the virtual channel names?

 

Thanks,

Erden

0 Kudos
Message 3 of 9
(6,034 Views)

Hello ErdenV2,

 

Virtual channels and physical channels are pretty different. A physical channel only defines physical pins on a device where as a virtual channel encapsulates the physical channel along with other channel specific information.

The link below describes the difference in detail.

 

Channels: Physical, Virtual, Local Virtual and Global Virtual:

http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/chans/

 

In the Configuration File generation.vi, if you are just replacing the channel name from a physical channel to a virtual channel, then this will not work correctly. You may have to modify the code slightly to use a NI-MAX virtual channel. You could also change the DAQmx Create Virtual Channel (VI) in the code to “AI Strain Gage”.

 

Regards,

 

J_Bou

Message 4 of 9
(6,013 Views)

Thanks a lot J_Bou,

 

I should review some basics then. What do you mean by "You could also change the DAQmx Create Virtual Channel (VI) in the code to “AI Strain Gage”

 

Thanks,

Erden

0 Kudos
Message 5 of 9
(5,999 Views)

Hell ErdenV2,

 

Below is a picture describing what I mean. You can change the polymorphic instance of the DAQmx Create Virtual Channel.vi to a AI Strain Gage. 

EX.png

Regards,

 

J_Bou

 

Message 6 of 9
(5,995 Views)

Hi J_Bou,

 

After your messages, I reviewed some basics. It is much more clear now.

 

Thanks a lot for your help!

Erden

0 Kudos
Message 7 of 9
(5,960 Views)

Hello,

 

I changed the program and added a case structure to configure each channel according their type. In order to go through all the channels in the configuration file, I put a for structure. 

 

It seems it is working, however, when I start acquisition, I only see one channel and that is last one which is configure. 

 

Here is the original file, configures all, but only works for AI Voltage:

 

configureOriginal.PNG

 

 

Here is the modified one:

ConfigureFor Channels.PNG

 

What I am doing wrong? 

 

Thanks!

 

 

0 Kudos
Message 8 of 9
(5,637 Views)

Hi ErdenV2,

 

The reason why you are only seeing the last DAQmx task configured is that the for loop tunnel for the task is set for tunnel mode "Last Value." If you right click the tunnel and select "Indexing" mode you will create a task for each channel. However, to successfully configure and start each task, you will need to set the DAQmx Timing vi and DAQmx Start Task vi for each task.

Briana P.
Licensing
Sr SW Engineering Manager | NI R&D
ni.com/support
0 Kudos
Message 9 of 9
(5,620 Views)