LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRIO Not able to generate digital signal through taking waveform pulse plus it is not running on myRIO target.

Solved!
Go to solution
Please refer to the following issues faced by us, while deploying programs on myRio.
1. Programs running well on Computer, don't run at all when deployed on myRio Target. (Fig. 1)
 
2. Not able to generate digital signal through taking waveform pulse, converting it to Boolean value and sending it to the Digital Output function block. (Fig. 2)
 
3. Some functions like Time Count (ms) don't run when deployed in program on myRio.
Download All
0 Kudos
Message 1 of 13
(885 Views)
Solution
Accepted by Aliza24102002

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:

  1. What Operating System are you running?  [The hoped-for "Correct Answer" is Windows 10 (64-bit)]
  2. What version of LabVIEW are you running?  [The hoped-for Answers are LabVIEW 2019 (32-bit) or LabVIEW 2021 (32-bit)].
  3. Have you installed the appropriate (2019 or 2021) version of the myRIO Software Toolkit?  [The hoped-for Answer is Yes].
  4. Have you installed LabVIEW Real-Time?  The myRIO is a "Target" part of a 2-computer Real-Time Project, the "Host" computer being a PC running a LabVIEW program and the "Target" being a computer running the NI Linux Real-Time OS, programmed with LabVIEW that has Real-Time Extensions enabled.

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:

MAX, myRIO Software 2019.png

 

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:

  1. Make sure that all the VIs that you create in your Project are in a single "Project" folder.  I generally name the Folder the same as the Project, e.g. folder "BS Acquisition" holds a file called BS Acquisition.lvproj and all of the Sub-VIs, TypeDefs, and other files needed to include with the Project.
  2. Right-click the Project folder, and from the Drop-down, click "Send to:".
  3. From the list, select "Compressed (zipped) Folder.
  4. The result should be a <Project>.zip (such as "BS Acquisition.zip") file.
  5. Attach that .zip file to your Reply.
  6. Do not use .rar or any other "compression" method, please.

Bob Schor

Message 2 of 13
(844 Views)

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.

A) Problem Statement:
We have a set of frequencies (f1,f2,...,fn). We want to generate square wave of these frequencies (one after the other) on a given digital IO pin. We want each of the frequency to be run for a given time t. So our total wave time will be  n*t.
For this problem I have written a logic the picture of which I have attached to this reply.
 Aliza24102002_0-1710307128029.png

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.

0 Kudos
Message 3 of 13
(800 Views)
We have a set of frequencies (f1,f2,...,fn). We want to generate square wave of these frequencies (one after the other) on a given digital IO pin. We want each of the frequency to be run for a given time t Here I need t= 20ms . So our total wave time will be  n*t.
For this problem I have written a logic the picture of which I have attached to this reply.
 Aliza24102002_0-1710323313272.png

 

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.

0 Kudos
Message 4 of 13
(791 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 13
(786 Views)

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

0 Kudos
Message 6 of 13
(779 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 13
(763 Views)

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.

myRIO Pulse Train Generation.png

Bob Schor

Message 8 of 13
(753 Views)

Thanks, GredW.

I will update with the FPGA code.

 

0 Kudos
Message 9 of 13
(732 Views)

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

Message 10 of 13
(721 Views)