06-26-2023 04:29 AM
Hi Bob
I use a signal generator to create a sin wave to test the data.
The A/D range I set is ±0.5 V. The sin signal amplitude is 250mV.
The result in the Test Analog Acquisition.vi is very good
But when using the Real-time, the result is not good.
I attached the excel and the VI Test Analog Acquisition.vi below. The Amplitude - Voltage_1 and Amplitude - PXI1Slot8/ai1 measure the same sin wave input.
Thanks
06-26-2023 08:54 AM
I think I now understand the problem I think you are having (saying "I think" twice means I'm only half sure that I am right!). Let me summarize:
You are acquiring a sinusoid 1000 samples at a time at 1 kHz, plotting the data on a Waveform Chart, then exporting this Chart to Excel. When you do this on your PC, the program runs just fine. But when you do this on the PXIe-6363, with LabVIEW Real-Time 2016, the results are "not pretty".
The answer is simple -- LabVIEW Real-Time cannot do Charts and does not have access to Excel! Only the Host (the PC) can do that.
In your first Post, you mentioned an Example you used, which I failed to examine. I'm going to do this now, and (I hope) I'll be "better informed".
If you are still using LabVIEW 2016 (or something no later than LabVIEW 2021), please do the following:
I'll be looking for your response.
Bob Schor
06-26-2023 09:26 AM
Whew! I was correct in my diagnosis!
There are two Example Projects listed under Real-Time: LabVIEW Real-Time Control (which, I believe, you said you used as your starting point) and LabVIEW Real-Time Waveform Acquisition.
LabVIEW Real-Time Control uses the PXIe-6363 to perform Real-Time Control, i.e. make sure that the RT system acts as a "RT Controller", monitoring a system and sending data back to the Host to implement a PID controller. The Host "gives the orders" and the Target "carries them out, according to the PID settings it has received". Note that the Target VI has no Front Panel -- there is normally no direct interaction with the User (who only interacts with the Host, and the Host communicates via TCP/IP with the Target).
The same is true with the LabVIEW Real-Time Waveform Acquisition, where the Acquisition takes place on the Target (which is designed for "Real-Time" applications), but, again, the data processing (including viewing as a Chart and exporting to Excel) all takes place on the Host. This means that a data path (TCP/IP) needs to be established between Host and Target, and the entire processing gets much more complicated. You have only to look at the Example Project (which makes even my head spin).
I don't know what to advise you. I've evolved my own way to handle LabVIEW Real-Time and LabVIEW Projects, in general, that uses a Channel Message Handler (I might even have invented that term, though it is now part of LabVIEW) and is more of a State Machine than a true "Message Handler" (but it works well for me), but the issue, for you, is to wrap your head around having two independent Processors (the PC, running LabVIEW, and the PXI, running LabVIEW Real-Time, and a separate, independent Operating System, either PharLap or NI Linux Real-Time) running completely independent code, with communication/synchronization handled by TCP/IP (I use Network Streams exclusively for this).
Bob Schor
06-26-2023 07:44 PM
Hi Bob, in the first post of mine, I attached the zip file contains the project.
06-26-2023 08:11 PM
Thank you but can you give me more detail? I am struggling with the problem T.T