03-08-2024 02:22 AM
Solved! Go to Solution.
03-08-2024 01:25 PM
The myRIO runs the NI Linux Real-Time Operating System, and (when being programmed) is the Target of a LabVIEW Real-Time Project. I suspect that you are not operating in this paradigm. Here are some questions:
You can easily check and get the answers to these questions (and, please, post a "Picture" of a Screen-capture of MAX with the myRIO connected and the Real-Time. Here's what MAX shows me when I plug in a myRIO configured with the LabVIEW 2019 myRIO Software Toolkit:
My strong suspicion is that you do not have a working version of LabVIEW configured with the appropriate myRIO Software Toolkit. Note that while there may be possibly earlier Toolkits available, the two most recent are the myRIO Software Toolkit 2019 and the myRIO Software Toolkit 2021. To the best of my knowledge (and, believe me, I tried!), these will only work with 32-bit LabViEW 2019 or 2021 (they'll probably work with the SP1 versions of either, as well).
When working with a Real-Time Project, the Project file becomes extremely important. For this reason, I urge you to post the entire Project by taking the following steps:
Bob Schor
03-13-2024 12:23 AM
Hi Bob Schor,
Thanks for such a detailed answer.
Here are the answers to the questions.
1.What Operating System are you running? Windows 10 (64-bit)
2.What version of LabVIEW are you running? LabVIEW 2021 (32-bit)
3.Have you installed the appropriate (2019 or 2021) version of the myRIO Software Toolkit? Yes
4.Have you installed LabVIEW Real-Time? yes
The issue which was with the VI not running on target is solved! Thanks a lot.
I am sorry due to some reasons I cannot upload the entire code.
But I can state the problem I am facing so that you can help me.
I am working with myRIO 1900.
In this I have used the tic function to determine the time taken to execute each iteration of the loop.
The difficulty is that the logic is taking more than 20 ms to execute so I need to change the logic and make it such that the task is completed in 20ms.
03-13-2024 04:49 AM
In this I have used the tic function to determine the time taken to execute each iteration of the loop.
The difficulty is that the logic is taking more than 20 ms to execute so I need to change the logic and make it such that the task is completed in 20ms.
03-13-2024 04:57 AM - edited 03-13-2024 04:58 AM
Hi Aliza,
@Aliza24102002 wrote:
In this I have used the tic function to determine the time taken to execute each iteration of the loop.The difficulty is that the logic is taking more than 20 ms to execute so I need to change the logic and make it such that the task is completed in 20ms.
Please don't create new threads for the very same question!
I don't see any timing in the innermost FOR loop where you actually output the DO samples: is this intended?
Which samplerate do you want to use? Does the myRIO even support that samplerate when you output "one sample on demand"?
As the myRIO also comes with a FPGA you could also let the FPGA do the "hard work" by implementing the pulse train generation in FPGA code. Atleast it will be much more accurate regarding the timings...
03-13-2024 05:02 AM - edited 03-13-2024 05:04 AM
Sorry I won't create new post for same question again.
I am using 50k/s sample rate, and it is supported by myRIO.
I don't see any timing in the innermost FOR loop where you actually output the DO samples: is this intended? Yes
ok i will try with FPGA and update here
03-13-2024 07:04 AM
Hi Aliza,
@Aliza24102002 wrote:
I am using 50k/s sample rate, and it is supported by myRIO.
While the myRIO will surely support 50kS/s you will not be able to reach this using functions made to output single samples...
@Aliza24102002 wrote:
I don't see any timing in the innermost FOR loop where you actually output the DO samples: is this intended? Yes
How will you ensure any timing without using any timing functions???
@Aliza24102002 wrote:
ok i will try with FPGA and update here
It seems you only need to create pulse trains, which is quite easy on FPGA...
03-13-2024 08:23 AM
Hello, Aliza.
A really tiny "picture of LabVIEW code" (which I can't "play with" and can barely read) used to cause me to rant and rave on the Forums. Couldn't you have attached a VI (or part of a VI)?
I wanted to generate a 100 Hz biphasic Pulse Train, with a Pulse Width of .5 to 1.5 ms, and take an A/D sample of the voltage at the middle of each pulse in the pulse pair. I used a Time Loop to generate the Pulses, and calls to the FPGA to generate them, call the A/D to do the sample mid-pulse, and return the A/D data (for each Pulse) through a DMA channel to the myRIO, which eventually sent them to the Host via Network Streams.
Here is a picture. The routine "Post Script 2" calls the FPGA code passing in the direction (polarity) of the Pulse, and Get CB POST Data pulls in the A/D samples the FPGA takes midway through each Pulse, with the results from the Train passed out at the end of the Train.
Bob Schor
03-13-2024 01:25 PM
Thanks, GredW.
I will update with the FPGA code.
03-13-2024 08:20 PM
Hello, Aliza.
I'm concerned that you might not understand the central idea of LabVIEW Real-Time programming, namely that the "Real-Time" part (which, in your case, runs on the myRIO) is a specialized "subset" of LabVIEW-as-we-know-it on the PC (the so-called "Host" part of a LabVIEW Real-Time Project). I went looking on the Web for some introductory or tutorial material, and found a recent "Real-Time Manual" that may help clarify why you can't simply port your "LabVIEW-on-the-PC" code to the myRIO and have it work.
I recommend you look at this Manual for the LabVIEW Real-Time Module. Note that when the manual discusses a CompactRIO, you can consider the myRIO being a close relative of these devices. Once you have the basic idea of LabVIEW Real-Time programming and realize why certain operations (like anything having to do with a Graphical Interface, including producing graphs, or doing file I/O) cannot (or should not) be done on the Real-Time Target, I'll point you to some other tutorials that can demonstrate how to use LabVIEW Real-Time to do such things as communicate with SPI chips (by implementing the SPI protocol with your myRIO).
Bob Schor