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

so here is the update.

My 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.
Aliza24102002_0-1711436150160.png

 

For us the t is 20 ms.

I tried writing code in myRIO, I am attaching the code with this reply. The name of the VI is OLD CODE.

Now we realized that the processing time itself takes more than 20ms. Because we are trying to read more than 1000 values in 20ms.

 

I shifted my code to FPGA than. 

That is, I tried to apply the same logic in using FPGA.

As we know there is limited function available in FPGA I got stuck when I used square wave generator available in FPGA. The FPGA code is named as NEW CODE.

The Problem I am facing is that when I am trying to configure the generate wave form VI it has frequency input as periods/ticks (conceptually I am not able to understand it fully)

Aliza24102002_1-1711437415937.png

I have changed the clock rate to achieve 20ms time in the graph.

but when I try to compile this code, it gives me an error which is below.

Aliza24102002_2-1711437571373.png

The block diagram clock rate does not match the clock rate for which the Square Wave Generator VI was configured. The diagram clock is set to 40.000MHz and the Square Wave Generator VI clock is set to 1.0000MHz. Reconfigure the Square Wave Generator VI for the new clock rate. You might also need to modify computed values for the scaled inputs.

 

Now I tried to change the clock rate by trying to change the property of FPGA code.

Aliza24102002_3-1711437745725.png

 

But I was unable to do so, because it supports mini 40MHz for top level.

 

How do I approach this issue? I am a new developer and I have never used myRIO before.

Please correct where I am wrong.

I am curious and interested to work on my weak points.

 

0 Kudos
Message 11 of 13
(102 Views)
Solution
Accepted by Aliza24102002

Sigh.  It seems to me you are getting into "Real-Time Programming in LabVIEW" without a good grasp of programming in LabVIEW (you should be able to write simple programs in LabVIEW, including using DAQmx to measure and deliver "real signals").  The "Real-Time" aspect of the myRIO means that things like File I/O and Front Panel (human) Indicators (like Charts and Graphs) should be restricted to the "Host" (PC) part of the code, with data transferred from Target to Host through mechanisms such as Network Streams.

 

Let's assume you run your RT code using a 2 MHz clock, with the idea that you spend n "ticks" High and n "ticks" Low to make a wave of frequency 1000/n kHz.

  • Use a For loop for each frequency:
    • Change Frequency to number of High and Low clock Ticks
    • Pass to an inner For Loop to generate alternating High/Low DIO output with an appropriate Delay/Wait from RT Timing Palette.

That should generate exactly the waveform that you want.  Do not try to look at it in the myRIO code -- instead, attach an oscilloscope to the DIO pin and look for the waveform being generated.  Alternatively, develop a true LabVIEW RT Project with a Host "Main" that starts the Target running, establishes communication with it, including a method to pass data from target to host over TCP/IP (I favor Network Streams), and get the Host to display (in a Chart) the incoming data.

 

Do you know anyone wherever you are who has LabVIEW RT experience?  Have you done simpler myRIO Real-Time projects before?

 

Bob Schor

Message 12 of 13
(89 Views)

Sigh.  It seems to me you are getting into "Real-Time Programming in LabVIEW" without a good grasp of programming in LabVIEW (you should be able to write simple programs in LabVIEW, including using DAQmx to measure and deliver "real signals").  The "Real-Time" aspect of the myRIO means that things like File I/O and Front Panel (human) Indicators (like Charts and Graphs) should be restricted to the "Host" (PC) part of the code, with data transferred from Target to Host through mechanisms such as Network Streams

-> Thank you so much for making efforts to make me understand the basics.

Let's assume you run your RT code using a 2 MHz clock, with the idea that you spend n "ticks" High and n "ticks" Low to make a wave of frequency 1000/n kHz.

  • Use a For loop for each frequency:
    • Change Frequency to number of High and Low clock Ticks
    • Pass to an inner For Loop to generate alternating High/Low DIO output with an appropriate Delay/Wait from RT Timing Palette.

That should generate exactly the waveform that you want.  Do not try to look at it in the myRIO code -- instead, attach an oscilloscope to the DIO pin and look for the waveform being generated.  Alternatively, develop a true LabVIEW RT Project with a Host "Main" that starts the Target running, establishes communication with it, including a method to pass data from target to host over TCP/IP (I favor Network Streams), and get the Host to display (in a Chart) the incoming data.

-> I will definitely work on the basics first and get back to you with the updated code with all points as suggested above.

 

Do you know anyone wherever you are who has LabVIEW RT experience?  Have you done simpler myRIO Real-Time projects before?

-> Yes, but they are little busy that's why I came here. 

 

Bob_Schor thanks for always being descriptive, these efforts mean a lot and you are making me understand things without me feeling dumb. Grateful for efforts...I hope I solve it:) 😉 

0 Kudos
Message 13 of 13
(75 Views)