Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate PWM in sbRIO 9606

Hi everyone!

 

I have a sbRIO 9606 and, as a beginner,  I'm trying to implement this code (http://www.ni.com/white-paper/11197/en) using my target. I need to set a PWM in a digital output but I don't know how to do it. In the paragraph 10 it gives the instructions about adding the PWM output, but I can't see this "C Series Module" in my project.

 

Any tips would be appreciated.

 

Thanks in advance.

0 Kudos
Message 1 of 7
(8,923 Views)

Hi Reimon05, the module that is mention in the document you have is a actual hardware module that you can connect to cRIOs and some sbRIOs. If your are just using the digital outputs of your sbRIO, you would have to write the code for the PWM.

 The code for generating the PWM in LabVIEW FPGA can be really simple:

 

pwm.PNG

 

You can find more examples in LabVIEW>> Help >> Example Finder

 

Also the following link has a more complex example.

 

Generate multiple offset PWM outputs for FPGA

 

Best Regards

Benjamin C
Principal Systems Engineer // CLA // CLED
Message 2 of 7
(8,862 Views)

Hi Benjamin C!

 

Thank you so much for your tip.
I'll try to implement the PWM on my target.

Best Regards.

 

Reimon

0 Kudos
Message 3 of 7
(8,832 Views)

Hi Benjamin!

 

I was following another exemple to creat a PWM, but I can't connect the output of the PWM to the output of a I/O Node.

LabView says that I can't connect an output of SubVi to the output of I/O Node.

 

 

error de conexión.JPG

 

 

 

 

This is my "Project window", and you can see the I/O's of the Rio Mezzanine Card.

 

ventana de proyecto.JPG

 

 

 

 

 

Dou you know how I can use these I/O's in my VI?

 

 

Best Regards.

Reimon.

0 Kudos
Message 4 of 7
(8,827 Views)

HI Reimon05 the probelm is on your subVi, you should be conecting the output of the io node to the input of the subVI, to change that terminal to an input in the subVI you need to set it as a control in the subVI so it becomes an input in the conector pane.

FOr the ones your writing ( the ones on the left of your diagram you need to change the i/o node to write not to read so your conecting a output of a subVI to the input of a IO node.

Best Regards

 

 

Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 5 of 7
(8,823 Views)

Hi Benjamin !

 

Well, I would like to ask another thing...

I am working with another person with the target sb-RIO 9606. We are trying to implement another aplication but we don't know how to work with "shared variables".

There is a photo of the tutorial the we are using:

 

 

 

variables compartidas.JPG

 

 

 

Do you know how to use it? And could you tell us how ?

 

Regards.

Reimon

0 Kudos
Message 6 of 7
(8,782 Views)

Hi Reimon, when is a new question of a different topic is always better to start a new tread, that makes it easier for us to make sure everything is answered. What is the problem your having with the shared variables?

  Shared variables are variables that are stored inside of the projects. To create new variables you right click the target you want to host the shared variable and select new >> Variable. This will create the variable in the project. If you want to edit them, you just have to double click them or right click properties.

  Once you have created the shared variable or if they are already in your project you just need to drag them to the block diagram to see them as a node, as your showing in the image.

   Shared variables are a nice tool, but as with all variables over using shared variables can reduce performance in your application, and increase race conditions.

This documents should also give you more details and examples:

Developer Zone Tutorial: Using the LabVIEW Shared Variable

Local, Global and Shared Variable

Best Regards

Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 7 of 7
(8,775 Views)