LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog out offset 5Vpp square wave FPGA USB-7855R

Solved!
Go to solution

I'm using a USB-7855R with a SCB-68  to handle analog signals. 

I'm having trouble finding an example where all of the wire types/data are compatible with this system in the LabVIEW help files. My problem seems like it should have a simple fix. 

 

My goal: Generate a 5 Vpp square wave with a 2.5V offset so the signal goes from 0 to 5V. I'm attempting to use the Square Wave Generator VI. It seems that it will not allow me to put in a decimal number for the amplitude which my understanding is that this is due to the data type; however, I've been running into problems where certain wiring and data types are not compatible with this FPGA system. 

 

Two questions: (1) Can someone help me generate my desired analog output signal? (2) Is there a way to set up my code such that I can control the frequency in units of Hz and have the conversion to periods/tick done for me that is compatible with this FPGA system? Code is attached. Thank you. 

 

0 Kudos
Message 1 of 4
(2,334 Views)
Solution
Accepted by topic author mdot

If you are having trouble with data types, it may be simpler to create your own function for switching between high and low.  That way you can specify the outputs manually.  

 

One such way to do so would be having a timing function provide a tick count.  You could pick a timing function that provides time defined in a unit such as ms, making defining control in Hz simpler.  Given that tick count, you can choose to output a high or low value that you specify with a constant.  Depending on your needs, you could design the logic for switching high or low.

Trevor H.
Technical Support Engineer
National Instruments
Message 2 of 4
(2,298 Views)

That helped solve the problem. I used a Loop Timer VI inside of the while loop and set the loop iteration time in terms of ms. Then I used a case structure to do either high or low voltage output based on the loop timing to make a square wave with a period as long as 1 while loop iteration. Thanks for your help!

0 Kudos
Message 3 of 4
(2,288 Views)

Glad it is up and running, and that I could be of assistance!

Trevor H.
Technical Support Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,264 Views)