Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

(Real Time-labview) Analog Voltage measurement

I am new RT labview user. I have PXIe-1073 containing PXI-6733 and PXIe-6356.I want to read the input port into ADC, double the voltage, output that to DAC. Means i just want to read the analog input voltage. How to create this programe and run on the target. I also want to know whether i have to write the program first and then create labview RT wizard or first create wizard then write the program. I wrote the program but i want to make sure myself. I have max software. I need your help. I am attaching the file of voltage reading (labview). Please, tell me how to process in real time labview scenario.

 

Thanks a lot

0 Kudos
Message 1 of 28
(5,705 Views)

In order to run this on your PXI, you will to need to create a LabVIEW project and add the target. To do all of this follow the steps below:

 

  1. With the reading analog voltage.vi choose File > New Project.

  2. A dialog screen will appear and select Add. This will add the VI to the project.

  3. In the project under Project Items, right-click Project: Untitled Project 1 (Untitled Project 1 is the Project Name) and choose New > Targets and Devices.

  4. In the dialog box make sure Existing Target or device: Discover an existing target(s) or device(s) is selected. Under Targets and Devices with all the different platform options, expand Real-Time PXI and  you will be able to select your PXI system. The PXI will now be in the project.

  5. Right-click the PXI target and select connect. Once connected a green circle next to the picture of the PXI in the project will be lit.

  6. The reading analog voltage.vi should be located under My Computer in the project. Click and drag that VI underneath the PXI target. The VI will now be able to deploy to the PXI.

  7. Set the corresponding channel you want to read from in your VI.

  8. Click Run. This will deploy the VI to the PXI target and run.

 

Regards,

 

David A.

 

National Instruments
Applications Engineer
0 Kudos
Message 2 of 28
(5,687 Views)

Thanks a lot David!

for your invaluable suggestions and guidence.

 

I wish to know whether this attached(previously)vi will work for my goal. My objective is to write a program to read an input port into a ADC, double the voltage, and  output that to a DAC. I have  hardwares- PXIe-1073 containing PXIe-6356 and PXI-6733. Thanks again for your precious time and guidence.

 

Regards

VT

0 Kudos
Message 3 of 28
(5,681 Views)

So your VI will read in the voltage and then double it, however there is nothing in there that will write in back out. Do you want to read and then write on the same device or read on one of your devices and write out on another?

 

You will need to use a DAQmx write in order to write to a channel. If you look under the LabVIEW Example Finder under Hardware Input and Output > Synchronization > and either Multi-device or multi-function depending on what you want you can find an example in there that will do what you want.

 

For a recap, your current VI will read a channel that you would still need to specify, it will then double that voltage to a waveform. It will not however, write to anything. You will need to create a DAQmx Write setup as you have done with the DAQmx read. How to set it up will depend on whether you are doing this with one of your PXI devices or both.

 

David A.

National Instruments
Applications Engineer
0 Kudos
Message 4 of 28
(5,664 Views)

Thanks David!, for your superb advice

 

I wish to know how we can address  Physical channel/global virutal channels in our VI. I mean how to create global virtual channels/physical channel/tasks in our remote system using MAX and then to identify it on the Front Panel of VI by browsing.

 

Thanks in advance for your upcoming guidlenes

 

VT

0 Kudos
Message 5 of 28
(5,661 Views)

To select channels, if you click the down arrow on your physical channels input on your VI, a list of channels for each device in your PXI will show up.To make sure you are selecting the right channel, look in Measurement & Automation Explorer and it will show you exactly what you device number is.

 

In order to create a task, you would do that through Measurement & Automation Explorer. Take a look at this tutorial: Creating a Task in NI-DAQmx and Using it in LabVIEW and specifically watch the video. The video is a little old, but the steps to acheive this task is the exact same. This is probably the best resource because it shows exactly how to do it.

 

David A.

National Instruments
Applications Engineer
0 Kudos
Message 6 of 28
(5,652 Views)

Hi David,

I am attaching a measurement and generation waveform vi with this post. I followed your just last suggestion and got success to a few extent. I am using PXIe-6356 and PXI 6733. I am reading the input from ai0 of PXIe6356 and writing the samples on the ao0 of the same device. I am performing R/W operation in a while loop. When I deploy the vi on target , number of samples(amount is correct what i applied) written on the output channel appears  for a while(can be seen on oscilloscope) and  then returns to zero. When i stop the program errors 200557(DAQmx timing(user waveform ) and 200279 DAQmx read(Analog waveform 1 channel 1 sample occurs). solution of 200557 is set the property prior to starting the task or stop the task prior to setting the property.(I did this but it occurs again). Solution of 200279 is increasing the busffer size , reading the data more frequently and specify a fix number of samples to read instead of reading all available samples. So, please suggest me what should i do?

 

Further, i want to calculate out the elapsed time between two succesive voltage R/W and also wants to make it as fast as possible(micro seconds). I used the flat sequence, RT tick and wait until next multiple, but it shows almost 6343 ms means 6-8 second, which is not required for our experiment. I'll appreciate your suggestions.

 

Thanks a lot

VT

 

0 Kudos
Message 7 of 28
(5,629 Views)

If you could take a look at the NI Example Finder and look under Hardware Input and Output > DAQmx > Synchronization > Multi-Function > Multi-Function-Synch AI-AO.vi. I made a change to that VI in the attached VI I have included to do what you want to do. The only change that you will have to make is with regards to the input and output channels and the actual rate that you want to read and write.

 

David A.

National Instruments
Applications Engineer
0 Kudos
Message 8 of 28
(5,618 Views)

Hi David,

 

Thanks for invaluable support

 

I can not open this attached file because i am using labview 2009( attached file is in LV 2010 version). I am using this older version 2009. Can you send it to me in 9.0 version? Please!

Another thing is that i want this R/W as fast as possible means of microsecond order? How do i do that? Please, suggest me.

 

Thanks a lot for your time

 

VT

0 Kudos
Message 9 of 28
(5,601 Views)

I have attached the LV 2009 version of the example. You should be able to read/write as fast as your device will physically allow. You will just need to make sure that you set the buffer size to account for the rate that you want. Within the LabVIEW Help for the DAQmx Timing VI it shows the samples per channel input and when you are doing continuous samples this sets the buffer size. This will be something to definitely keep in mind as you are deciding on what sample rate you want to go with.

 

David A.

National Instruments
Applications Engineer
0 Kudos
Message 10 of 28
(5,588 Views)